Esempio n. 1
0
  public static void preferences() {
    if (pref == null) {
      JFrame parent = null;
      if (window.isVisible()) {
        parent = window;
      }
      PrefPanel panel;
      if (prefclass == null) {
        panel = new PrefPanel();
      } else {
        panel = (PrefPanel) newInstance(prefclass);
      }
      panel.setParentFrame(parent);
      int result =
          JOptionPane.showConfirmDialog(
              parent,
              panel,
              "Preferences",
              JOptionPane.OK_CANCEL_OPTION,
              JOptionPane.PLAIN_MESSAGE,
              new ImageIcon());
      if (result == JOptionPane.OK_OPTION) {
        panel.savePreferences();
      } else {

      }
    } else {
      pref.setVisible(true);
    }
  }
Esempio n. 2
0
 public static void closeWindow(AbstractWindow window) {
   if (window.getJustHide()) {
     window.setVisible(false);
   } else {
     if (window.onClose() && instance.onClose(window)) {
       window.setVisible(false);
       removeWindow(window);
     }
   }
 }
Esempio n. 3
0
 public static void closeActiveWindow() {
   for (int i = 0; i < windows.size(); i++) {
     try {
       AbstractWindow window = (AbstractWindow) windows.get(i);
       if (window != null && window.isActive()) {
         closeWindow(window);
       }
     } catch (Exception e) {
       logger.warning("Cannot close window: " + e.getMessage());
     }
   }
 }
Esempio n. 4
0
 public void cancelUpdate(String window_name) {
   try {
     saveUpdateSettings();
     if (!cmd.getQuiet()) {
       if (window_name == null) {
         window = new MainWindow();
       } else {
         window = (AbstractWindow) newInstance(window_name);
       }
       addWindow(window);
       window.setVisible(window.getWindowSettings().getVisible());
       window.postLoad();
     }
   } catch (Exception ex) {
     ex.printStackTrace();
     logger.severe("Could not start application: " + ex.getMessage());
   }
 }
Esempio n. 5
0
 public static void about() {
   Component parent = null;
   if (window.isVisible()) {
     parent = window;
   }
   AboutPanel panel;
   if (aboutclass == null) {
     panel = new AboutPanel();
   } else {
     panel = (AboutPanel) newInstance(aboutclass);
   }
   JOptionPane.showMessageDialog(
       parent, panel, "About", JOptionPane.INFORMATION_MESSAGE, AboutImage());
 }
Esempio n. 6
0
  public void commandAction(Command command, Displayable displayable) {
    super.commandAction(command, displayable);
    if (command == _exitCommand) {
      App currentApp = App.getCurrentApp();
      currentApp.destroyApp(false);
    } else if (command == _synchronizeCommand) {
      System.out.println("MainForm::Synchronize");
      if (TagKeeper.getInstance().hasRecords())
        App.getCurrentApp().getWebServiceIteractor().uploadTagList(null);
      else System.out.println("there's nothing to UPLOAD again");

    } else if (command == _settingsCommand) {
      UIManager.getInstance().show(UIManager.SCREEN_SETTINGS);
    } else if (command == _inviteCommand) {
      UIManager.getInstance().show(UIManager.SCREEN_CONTACTS);
    } else if (command == Alert.DISMISS_COMMAND) {
      refresh();
    }
  }