コード例 #1
0
ファイル: Application.java プロジェクト: ryanfox1985/syncany
  private void initUI() throws InitializationException {
    // Settings Dialog
    try {
      EventQueue.invokeAndWait(
          new Runnable() {
            @Override
            public void run() {
              settingsDialog = new SettingsDialog();

              for (Profile p : config.getProfiles().list()) {
                settingsDialog.addProfileToTree(p, false);
              }
            }
          });
    } catch (InterruptedException ex) {
      logger.log(Level.SEVERE, "Unable to init SettingsDialog.", ex);
      throw new InitializationException(ex);
    } catch (InvocationTargetException ex) {
      logger.log(Level.SEVERE, "Unable to init SettingsDialog.", ex);
      throw new InitializationException(ex);
    }

    // Tray
    tray.init("Everything is up to date.");
    tray.addTrayEventListener(new TrayEventListenerImpl());
    tray.updateUI();

    // Desktop integration
    if (config.isServiceEnabled()) {
      desktop.start(); // must be started before indexer!
    }
  }
コード例 #2
0
ファイル: Application.java プロジェクト: ryanfox1985/syncany
  private void initDependencies() {
    logger.info("Instantiating dependencies ...");

    config = Config.getInstance();
    desktop = Desktop.getInstance();
    indexer = Indexer.getInstance();
    localWatcher = LocalWatcher.getInstance();
    tray = Tray.getInstance();
    periodic = new PTreeSearch();
  }