Exemplo n.º 1
0
 @Override
 public void execute() {
   IDialogModelTemplate template = templateFactory.createTemplate();
   if (template == ItemTemplateFactory.NO_TEMPLATE) {
     return;
   }
   try {
     itemCreator.operate(template);
   } catch (PersistenceException e) {
     Message message =
         new Message(resources.getString("AnathemaPersistence.NewMenu.Message.Error"), e);
     MessageUtilities.indicateMessage(
         NewItemCommand.class, SwingApplicationFrame.getParentComponent(), message);
   }
 }
Exemplo n.º 2
0
 @Override
 public void execute() {
   Version currentVersion = getCurrentVersion();
   UpdateSystem updateSystem = createUpdateSystem(currentVersion);
   Updater updater = updateSystem.checkForUpdates();
   Version installedVersion = updateSystem.getInstalledVersion();
   UpdateDialogPage page = new UpdateDialogPage(resources, currentVersion);
   prepareForInstallation(page, updater);
   DefaultDialogConfiguration dialogConfiguration =
       DefaultDialogConfiguration.createWithOkOnly(page);
   UserDialog dialog =
       new UserDialog(SwingApplicationFrame.getParentComponent(), dialogConfiguration);
   updateSystem.reportAllProgressTo(new VersionDiscoveryReport(page, installedVersion));
   updateSystem.reportAllProgressTo(new InstallationProgressReport(page));
   updateSystem.reportAllProgressTo(new DialogUpdater(dialog));
   updateSystem.reportAllProgressTo(new ConfigureAnathema(updateSystem));
   dialog.getDialog().setModal(false);
   dialog.show();
   runUpdateCheck(updater);
 }