Exemplo n.º 1
0
  private void processClose() {
    if (Registry.getInstance().isRestartNeeded()) {
      final ApplicationEx app = (ApplicationEx) ApplicationManager.getApplication();
      final ApplicationInfo info = ApplicationInfo.getInstance();

      final int r =
          Messages.showOkCancelDialog(
              myContent,
              "You need to restart " + info.getVersionName() + " for the changes to take effect",
              "Restart Required",
              (app.isRestartCapable() ? "Restart Now" : "Shutdown Now"),
              (app.isRestartCapable() ? "Restart Later" : "Shutdown Later"),
              Messages.getQuestionIcon());

      if (r == 0) {
        LaterInvocator.invokeLater(
            new Runnable() {
              public void run() {
                if (app.isRestartCapable()) {
                  app.restart();
                } else {
                  app.exit(true);
                }
              }
            },
            ModalityState.NON_MODAL);
      }
    }
  }
Exemplo n.º 2
0
 private void restoreDefaults() {
   final int r =
       Messages.showYesNoDialog(
           myContent,
           "Are you sure you want to revert registry settings to default values?",
           "Revert To Defaults",
           Messages.getQuestionIcon());
   if (r == 0) {
     Registry.getInstance().restoreDefaults();
     myModel.fireChanged();
     revaliateActions();
   }
 }
Exemplo n.º 3
0
 private void revaliateActions() {
   myRestoreDefaultsAction.setEnabled(!Registry.getInstance().isInDefaultState());
 }
 public static synchronized boolean removeDevice(CaptureDeviceInfo device) {
   return Registry.getInstance().removeDevice(device);
 }
 public static synchronized Vector<CaptureDeviceInfo>
     getDeviceList() // not in javax.media.CaptureDeviceManager
     {
   return Registry.getInstance().getDeviceList();
 }
 public static synchronized void commit() throws java.io.IOException {
   Registry.getInstance().commit();
 }
 public static synchronized boolean addDevice(CaptureDeviceInfo newDevice) {
   return Registry.getInstance().addDevice(newDevice);
 }