/** * Called by VISAT after the plug-in instance has been registered in VISAT's plug-in manager. * * @param visatApp a reference to the VISAT application instance. */ public void start(VisatApp visatApp) { if (!isVersionCheckQuestionSuppressed() || isVersionCheckEnabled()) { final Timer timer = new Timer(DELAY_MILLIS, new ActionListener() { public void actionPerformed(ActionEvent e) { runAuto(); } }); timer.setRepeats(false); timer.start(); } CommandAdapter versionCheckerAction = new CommandAdapter() { @Override public void actionPerformed(CommandEvent event) { runManual(); } }; CommandManager commandManager = visatApp.getCommandManager(); ExecCommand versionCheckerCommand = commandManager.createExecCommand("checkForUpdate", versionCheckerAction); versionCheckerCommand.setText("Check for New Release..."); versionCheckerCommand.setShortDescription("Checks for a new release"); versionCheckerCommand.setParent("help"); versionCheckerCommand.setPlaceAfter("showUpdateDialog"); versionCheckerCommand.setPlaceBefore("about"); }
static Command createCommand(String name, Anchor anchor, String relativeId) { ExecCommand command = new ExecCommand(name); command.setText(name); if (anchor != null) { if (anchor == FIRST) { command.setPlaceFirst(true); } if (anchor == LAST) { command.setPlaceLast(true); } if (anchor == BEFORE) { command.setPlaceBefore(relativeId); } if (anchor == AFTER) { command.setPlaceAfter(relativeId); } } return command; }
command.setShortDescription(getDescription()); command.setLongDescription(getDescription()); command.setText(getTabTitle()); KeyStroke accelerator = getAccelerator(); if (accelerator != null) {