public void stateChanged(ChangeEvent e) { ConfigurationView view = (ConfigurationView) tabbedPane.getSelectedComponent(); if (!view.isInitialized()) { try { view.initialize(); } catch (Exception e1) { POSMessageDialog.showError(this, POSConstants.ERROR_MESSAGE, e1); } } }
public void actionPerformed(ActionEvent e) { if (OK.equalsIgnoreCase(e.getActionCommand())) { try { for (ConfigurationView view : views) { if (view.isInitialized()) view.save(); } setCanceled(false); dispose(); } catch (PosException x) { POSMessageDialog.showError(this, x.getMessage()); } catch (Exception x) { POSMessageDialog.showError(this, POSConstants.ERROR_MESSAGE, x); } } else if (CANCEL.equalsIgnoreCase(e.getActionCommand())) { setCanceled(true); dispose(); } }
public void addView(ConfigurationView view) { tabbedPane.addTab(view.getName(), view); views.add(view); }