@PostConstruct
	private void init() {
		frame.addWindowListener(this);
		registerAction(frame.getCancelarButton(), new AbstractAction() {
			public void action() {
				cleanUp();
			}
		});
		
		registerAction(frame.getSalvarButton(), 
			ConditionalAction.build()
				.addConditional(new BooleanExpression() {
					
					@Override
					public boolean conditional() {
						Mercadoria m = frame.getMercadoria();
						String msg = validador.validate(m);
						if (!"".equals(msg == null ? "" : msg)) {
							JOptionPane.showMessageDialog(frame, msg, "Validação", JOptionPane.INFORMATION_MESSAGE);
							return false;
						}
						return true;
					}
				})
				.addAction(new AbstractAction() {
						private Mercadoria m;
						
						@Transactional
						@Override
						protected void action() {
							m = frame.getMercadoria();
							dao.save(m);
						}
						
						@Override
						public void posAction() {
							cleanUp();
							fireEvent(new IncluirMercadoriaEvent(m));
							m = null;
						}
					}));
		
		registerAction(frame.getExcluirButton(), 
			new AbstractAction() {
				private Mercadoria m;
					
				@Transactional
				@Override
				protected void action() {
					m = frame.getMercadoria();
					Integer id = frame.getMercadoriaId();
					if (id != null) {
						dao.delete(id);
					}
				}
				
				public void posAction() {
					cleanUp();
					fireEvent(new DeletarMercadoriaEvent(m));
					m = null;
				}
			});
	}