@Override public void restored() { if (SWITCH_EDITOR_COLORS) { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { switchEditorColorsProfile(); } }); }; }
public void importSettings() { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { Upgrader upgrader = new Upgrader(); upgrader.upgrade(); } }); } }
private void initGephi() { final ProjectController pc = Lookup.getDefault().lookup(ProjectController.class); WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { pc.startup(); DragNDropFrameAdapter.register(); } }); }
@Override public void restored() { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { public void run() { //Do something System.out.println("WhenUIIsReady called"); } }); } }
private void resume() { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { log.finest("resume"); loginView.setVisible(false); worldsView.setVisible(false); final JFrame mainWin = (JFrame) WindowManager.getDefault().getMainWindow(); mainWin.setGlassPane(orgGlassPane); } } ); }
static void init () { if (!Boolean.getBoolean("netbeans.full.hack") && !Boolean.getBoolean("netbeans.close")) { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { public void run() { RP.post(new Runnable() { public void run() { checkStatus(); } }); } }); } }
/** * Activate the login page, switches main window glasspane */ private void activateLogin() { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { log.finest("activateLogin"); worldsView.setVisible(false); final JFrame mainWin = (JFrame) WindowManager.getDefault().getMainWindow(); mainWin.setGlassPane(loginView); loginView.setVisible(true); } } ); }
/** * activate the worlds page, switches main window glasspane */ private void activateWorlds() { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { log.finest("activateWorlds"); worldsView.loadWorlds(); loginView.setVisible(false); final JFrame mainWin = (JFrame) WindowManager.getDefault().getMainWindow(); mainWin.setGlassPane(worldsView); worldsView.setVisible(true); } } ); }
@Override public void restored() { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { //Check drivers if (JDBCDriverManager.getDefault().getDrivers(mysqlDriverClass).length == 0) { try { LOG.fine("Registering MySQL driver!"); JDBCDriverManager.getDefault().addDriver( JDBCDriver.create("mysql", "MySQL", mysqlDriverClass, new URL[]{new URL( "nbinst:/modules/ext/com.validation.manager.mysql/1/mysql/mysql-connector-java.jar")})); } catch (DatabaseException ex) { Exceptions.printStackTrace(ex); } catch (MalformedURLException ex) { Exceptions.printStackTrace(ex); } } } }); } }
@Override public void restored() { if (NbPreferences.forModule(WelcomeTopComponent.class).getBoolean(WelcomeTopComponent.STARTUP_PREF, Boolean.TRUE)) { WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { WelcomeTopComponent component = WelcomeTopComponent.getInstance(); JDialog dialog = new JDialog(WindowManager.getDefault().getMainWindow(), component.getName(), false); dialog.getContentPane().add(component); dialog.setBounds(212, 237, 679, 378); dialog.setVisible(true); } }); } } }
@Override public void restored() { log.finest("method.onShowLogin"); WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { // // store origional glasspane // log.finest("store origional glasspane"); final JFrame mainWin = (JFrame) WindowManager.getDefault().getMainWindow(); orgGlassPane = mainWin.getGlassPane(); } }); // // activate login // activateLogin(); }
@Override public void restored() { WindowManager.getDefault().invokeWhenUIReady(new TweetRetrieverScheduler()); }
@Override public void restored () { super.restored(); WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run () { RequestProcessor.getDefault().post(new Runnable() { @Override public void run() { TaskProcessorControl.initialize(); } }); } }); }
@Override public void restored() { //Init initGephi(); //GTK Slider issue #529913 UIManager.put("Slider.paintValue", Boolean.FALSE); //Handler if (System.getProperty("org.gephi.crashReporter.enabled", "true").equals("true")) { Logger.getLogger("").addHandler(new ReporterHandler()); } //Memory Starvation Manager if (System.getProperty("org.gephiMemoryStarvationManager.enabled", "true").equals("true")) { MemoryStarvationManager memoryStarvationManager = new MemoryStarvationManager(); memoryStarvationManager.startup(); } //Check for new major release: WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { new Thread() { @Override public void run() { checkForNewMajorRelease(); } }.start(); } }); //Output logger installOutputLogger(); }
@Override public void restored() { // Attempt to deal with load order problem deadlocking on the mac // This was a quickfix for a similar bug to 126558; see // http://hg.netbeans.org/main/rev/63c10f6d307b // for a better way to fix it SourceAccessor.dummy = 1; SourceTaskFactoryManager.register(); WindowManager.getDefault().invokeWhenUIReady(new Runnable() { public void run() { RP.post(new Runnable() { public void run() { RepositoryUpdater.getDefault(); ActivatedDocumentListener.register(); } }); } }); if (ENABLE_MBEANS) { registerMBeans(); } }
WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() {
WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() {
/** * Gets default instance. Do not use directly: reserved for *.settings files * only, i.e. deserialization routines; otherwise you could get a * non-deserialized instance. To obtain the singleton instance, use * {@link #findInstance}. */ @Override public void componentOpened() { removeAll(); filterPanel.addDocumentListener(filterListener); add(filterPanel, new GridBagConstraints(0, 3, 2, 1, 1.0, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 1, 0, 0), 0, 0)); add(dashboardComponent, new GridBagConstraints(0, 5, 2, 1, 1.0, 0.8, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(1, 1, 0, 0), 0, 0)); RepositoryRegistry.getInstance().addPropertyChangeListener(dashboard); addComponentListener(componentAdapter); DashboardSettings.getInstance().addPropertyChangedListener(dashboard); TopComponent.getRegistry().addPropertyChangeListener(dashboardSelectionListener); refresher.setRefreshEnabled(true); refresher.setDashboardBusy(false); if (firstStart) { firstStart = false; //load data after the component is displayed WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { dashboard.loadData(); } }); } }
public GlobalActionContextProxy() { try { this.content = new InstanceContent(); // The default GlobalContextProvider this.globalContextProvider = new GlobalActionContextImpl(); this.globalContextLookup = this.globalContextProvider.createGlobalContext(); // Monitor the activation of the Projects Tab TopComponent TopComponent.getRegistry().addPropertyChangeListener(this.registryListener); // Monitor the existance of a Project in the principle lookup this.resultProjects = globalContextLookup.lookupResult(Project.class); this.resultProjects.addLookupListener(this.resultListener); } catch (Exception e) { Exceptions.printStackTrace(e); } WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override public void run() { // Hack to force the current Project selection when the application starts up TopComponent tc = WindowManager.getDefault().findTopComponent(PROJECT_LOGICAL_TAB_ID); if (tc != null) { tc.requestActive(); } } }); }
/** * Opens a new window in SNAP Desktop. * * @param window The window which must must be an instance of {@link TopComponent}. * @param location The location where the window should appear when it is first opened. * Possible docking areas are * "explorer" (upper left), "navigator" (lower left), "properties" (upper right), * "output" (bottom). You may choose "floating" to not dock the window at all. Note * that this mode requires explicitly setting the window's position and size. * @param requestActive {@code true} if a request will be made to activate the window after opening it. */ public static void openWindow(TopComponent window, String location, boolean requestActive) { WindowManager.getDefault().invokeWhenUIReady(() -> { Mode mode = WindowManager.getDefault().findMode(location); if (mode != null) { mode.dockInto(window); } window.open(); if (requestActive) { window.requestActive(); } }); }