/** Exit NetBeans with the given exit code. * This method will return only if {@link java.lang.System#exit} fails, or if at least one component of the * system refuses to exit (because it cannot be properly shut down). The * default implementation calls {@link #exit()} for compatibility reasons, * but subclasses are encouraged to provide better implementation. * * @param status the exit code of the application * @since 8.23 */ public void exit(int status) { exit(); }
public void performAction() { LifecycleManager.getDefault().saveAll(); }
@Override public void run() { LifecycleManager.getDefault().exit(); }
@Override public void shutdown(boolean restart) { if(restart) { LifecycleManager.getDefault().markForRestart(); } LifecycleManager.getDefault().exit(); }
@Override protected void performAction(Node[] activatedNodes) { // Save everything first LifecycleManager.getDefault().saveAll(); for (int i = 0; i < activatedNodes.length; i++) { performAction(activatedNodes[i]); } }
private void exit() { LifecycleManager.getDefault().exit(); }
private void restart() { if (isDebug()) { return; } //Restart if (canRestart()) { //On Mac the change is applied only if restarted manually LifecycleManager.getDefault().markForRestart(); } LifecycleManager.getDefault().exit(); } }
@Override protected void performAction(Node[] activatedNodes) { // Save everything first LifecycleManager.getDefault().saveAll(); for (int i = 0; i < activatedNodes.length; i++) { performAction(activatedNodes[i]); } }
@Override public void publish(LogRecord record) { if (record.getThrown() == null) { return; } throwable = record.getThrown(); if (throwable != null && throwable instanceof OutOfMemoryError) { Handler[] handlers = Logger.getLogger("").getHandlers(); for (int i = 0; i < handlers.length; i++) { Handler h = handlers[i]; h.close(); } NotifyDescriptor nd = new NotifyDescriptor.Message(MEMORY_ERROR, NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(nd); LifecycleManager.getDefault().exit(); } }
e -> { try { LifecycleManager.getDefault().markForRestart(); } catch (UnsupportedOperationException uex) { LifecycleManager.getDefault().exit();
/** Exit NetBeans with the given exit code. * This method will return only if {@link java.lang.System#exit} fails, or if at least one component of the * system refuses to exit (because it cannot be properly shut down). The * default implementation calls {@link #exit()} for compatibility reasons, * but subclasses are encouraged to provide better implementation. * * @param status the exit code of the application * @since 8.23 */ public void exit(int status) { exit(); }
@Override protected void performAction(Node[] activatedNodes) { // Save everything first LifecycleManager.getDefault().saveAll(); for (int i = 0; i < activatedNodes.length; i++) { performAction(activatedNodes[i]); } }
private void terminate() { synchronized (lock) { long ptime = ParserQueue.instance().getStopWatchTime(); System.err.println("disposing at " + ptime); // NOI18N String xmlOutput = System.getProperty("cnd.close.report.xml"); // NOI18N if (xmlOutput != null) { BufferedWriter out; try { out = new BufferedWriter(new FileWriter(xmlOutput, true)); String result = timeout ? "failed" : "passed"; // NOI18N out.write("<result>" + result + "</result>"); // NOI18N out.write("<parsetime>" + ptime + "</parsetime>"); // NOI18N out.close(); } catch (IOException ex) { DiagnosticExceptoins.register(ex); } } } LifecycleManager.getDefault().exit(); } }
public void upgrade() { String currentVersion = getCurrentVersion(); Logger.getLogger("").log(Level.INFO, "Current Version is {0}", currentVersion); String lastVersion = NbPreferences.forModule(Upgrader.class).get(UPGRADER_LAST_VERSION, null); if (lastVersion == null || !lastVersion.equals(currentVersion)) { File latestPreviousVersion = checkPrevious(); if (latestPreviousVersion != null && !latestPreviousVersion.getName().replace(".", "").equals(currentVersion)) { File source = new File(latestPreviousVersion, "dev"); File dest = new File(System.getProperty("netbeans.user")); if (source.exists() && dest.exists()) { NbPreferences.forModule(Upgrader.class).put(UPGRADER_LAST_VERSION, currentVersion); boolean confirm = showUpgradeDialog(latestPreviousVersion); if (confirm) { try { CopyFiles.copyDeep(source, dest); //Restart if (showRestartDialog()) { LifecycleManager.getDefault().markForRestart(); LifecycleManager.getDefault().exit(); } } catch (IOException ex) { Exceptions.printStackTrace(ex); } } } } } }
/** Exit NetBeans with the given exit code. * This method will return only if {@link java.lang.System#exit} fails, or if at least one component of the * system refuses to exit (because it cannot be properly shut down). The * default implementation calls {@link #exit()} for compatibility reasons, * but subclasses are encouraged to provide better implementation. * * @param status the exit code of the application * @since 8.23 */ public void exit(int status) { exit(); }
public final void actionPerformed(ActionEvent e) { LifecycleManager.getDefault().saveAll(); doActionPerformed(e); }
public void run() { Frame f = WindowManager.getDefault().getMainWindow(); if (f == null || f.isShowing()) { LifecycleManager.getDefault().exit(); } else { f.addWindowListener(new WindowAdapter() { public @Override void windowOpened(WindowEvent e) { LifecycleManager.getDefault().exit(); } }); } } });
@Override public void run() { LifecycleManager.getDefault().saveAll(); docProvider.generateDocumentation(phpProject.getPhpModule()); } });
public void run() { Frame f = WindowManager.getDefault().getMainWindow(); if (f == null || f.isShowing()) { LifecycleManager.getDefault().exit(); } else { f.addWindowListener(new WindowAdapter() { public @Override void windowOpened(WindowEvent e) { LifecycleManager.getDefault().exit(); } }); } } });
@Override protected void perform(final HistoryEntry entry, final Set<VCSFileProxy> files) { // XXX try to save files in invocation context only // list somehow modified file in the context and save // just them. // The same (global save) logic is in CVS, no complaint LifecycleManager.getDefault().saveAll(); super.perform(entry, files); }