public void addDocument(String path) { if (!(new File(path)).exists()) { JOptionPane.showMessageDialog(this, "Error opening file: \"" + path + "\""); return; } JComponent editor = createTextArea(path); editor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14)); final DocumentComponent txtDocument = new DocumentComponent(new JScrollPane(editor), path, path, JideIconsFactory.getImageIcon(JideIconsFactory.FileType.TEXT)); txtDocument.setDefaultFocusComponent(editor); list.add(0,txtDocument); pane.setOpenedDocuments(list); pane.getLayoutPersistence().setProfileKey("documents"); pane.getLayoutPersistence().loadLayoutData(); this.pack(); this.setVisible(true); }
private void configureLayoutPersitence() { getMainFrame().getLayoutPersistence().setProfileKey(getAppName()); getMainFrame().getLayoutPersistence().setUsePref(false); getMainFrame().getLayoutPersistence().setLayoutDirectory(appUserDir.getPath()); getMainFrame().getLayoutPersistence().beginLoadLayoutData(); getMainFrame().getDockableBarManager().setProfileKey(getAppName()); }
@Override public void actionPerformed(CommandEvent event) { final LayoutPersistence layoutPersistence = VisatApp.getApp().getMainFrame().getLayoutPersistence(); layoutPersistence.loadLayoutDataFrom("user"); }
getMainFrame().getLayoutPersistence().loadLayoutData(); // </JIDE> clearStatusBarMessage(); pm.worked(1);
@Override public void actionPerformed(CommandEvent event) { final LayoutPersistence layoutPersistence = VisatApp.getApp().getMainFrame().getLayoutPersistence(); layoutPersistence.resetToDefault(); }
@Override public void actionPerformed(CommandEvent event) { final LayoutPersistence layoutPersistence = VisatApp.getApp().getMainFrame().getLayoutPersistence(); layoutPersistence.saveLayoutDataAs("user"); }
/** * Called by the <code>exit</code> method. The default implementation first saves the user preferences. * You should not call this method directly. If you override this method, make sure to call the base * class version as well. * * @see #savePreferences() */ protected void handleImminentExit() { Debug.trace(getAppName() + ": handleImminentExit entered"); if (!unexpectedShutdown) { // fix BEAM-712 (nf 2007.11.02) Debug.trace("(1)"); LayoutPersistence layoutPersistence = getMainFrame().getLayoutPersistence(); if (layoutPersistence != null) { layoutPersistence.saveLayoutData(); // produces a dead lock, method is certainly not threadsafe! } } Debug.trace("(2)"); savePreferences(); Debug.trace("(3)"); HelpSys.dispose(); // todo - disposing the HelpSystem should be done in the BeamUiActivator.stop() method Debug.trace(getAppName() + ": handleImminentExit exited"); }
public void addDocument(String path) { if (!(new File(path)).exists()) { JOptionPane.showMessageDialog(this, "Error opening file: \"" + path + "\""); return; } JComponent editor = createTextArea(path); editor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14)); final DocumentComponent txtDocument = new DocumentComponent(new JScrollPane(editor), path, path, JideIconsFactory.getImageIcon(JideIconsFactory.FileType.TEXT)); txtDocument.setDefaultFocusComponent(editor); list.add(0,txtDocument); pane.setOpenedDocuments(list); pane.getLayoutPersistence().setProfileKey("documents"); pane.getLayoutPersistence().loadLayoutData(); this.pack(); this.setVisible(true); }