Пример #1
0
 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);
     }
   }
 }
Пример #2
0
 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();
   }
 }
Пример #3
0
 public void addView(ConfigurationView view) {
   tabbedPane.addTab(view.getName(), view);
   views.add(view);
 }