/** * Creates a new SQL View internal frame for the passed session. * * @param session Session we are creating internal frame for. * * @throws IllegalArgumentException * Thrown if ISession is passed as null. */ public synchronized SQLInternalFrame createSQLInternalFrame(ISession session) { if (session == null) { throw new IllegalArgumentException("ISession == null"); } final SQLInternalFrame sif = new SQLInternalFrame(session); getMainFrame().addWidget(sif); // If we don't invokeLater here no Short-Cut-Key is sent // to the internal frame // seen under java version "1.4.1_01" and Linux SwingUtilities.invokeLater(new Runnable() { public void run() { sif.setVisible(true); sif.requestFocus(); } }); return sif; }
private void createUserInterface() setVisible(false); setDefaultCloseOperation(MainFrame.DO_NOTHING_ON_CLOSE); getDesktopContainer().setDesktopManager(new SquirrelDesktopManager(_app)); final Container content = getContentPane(); final JScrollPane sp = new JScrollPane(getDesktopContainer().getComponent()); sp.setBorder(BorderFactory.createEmptyBorder()); _statusBar.setFont(fn); setJMenuBar(new MainFrameMenuBar(_app, getDesktopContainer(), _app.getActionCollection())); setupFromPreferences(); setIconImage(icon.getImage()); getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( KeyStroke.getKeyStroke(KeyEvent.VK_ALT, Event.ALT_MASK, false), "repaint"); validate(); addWindowListener(new WindowAdapter()
public void windowClosing(WindowEvent evt) { dispose(); } });
getDesktopContainer().putClientProperty("JDesktopPane.dragMode", null); getDesktopContainer().putClientProperty("JDesktopPane.dragMode", "outline"); if (!show && _statusBarVisible) getContentPane().remove(_statusBar); _statusBarVisible = false; getContentPane().add(_statusBar, BorderLayout.SOUTH); _statusBarVisible = true; if (!show && _toolBar != null) getContentPane().remove(_toolBar); _toolBar = null; getContentPane().add(_toolBar, BorderLayout.NORTH);
createUserInterface(); preferencesHaveChanged(null); // Initial load of prefs. _app.getSquirrelPreferences().addPropertyChangeListener(new PropertyChangeListener()
private IWidget isInternalFrameUsed(IApplication application, int sheetType) { IWidget[] frames = application.getMainFrame().getDesktopContainer().getAllWidgets(); for (int i = 0; i < frames.length; i++) { if ((sheetType == ST_SHEET_TYPE_FIND_VALUES && frames[i] instanceof SmarttoolFindBadNullValuesFrame) || (sheetType == ST_SHEET_TYPE_CHANGE_VALUES && frames[i] instanceof SmarttoolChangeValuesFrame) || (sheetType == ST_SHEET_TYPE_MISSING_INICES && frames[i] instanceof SmarttoolMissingIndicesFrame) ) { return frames[i]; } } return null; }
private void prepareAliasWindow(MainFrameWindowState ws) _mainFrame.addWidget(_aliasesListWindow); toolWs = ws.getAliasesWindowState(); _aliasesListWindow.setBounds(toolWs.getBounds().createRectangle()); _mainFrame.setEnabledAliasesMenu(true); _mainFrame.setEnabledAliasesMenu(false);
private void prepareDriversWindow(MainFrameWindowState ws) { _mainFrame.addWidget(_driversListWindow); WindowState toolWs = ws.getDriversWindowState(); _driversListWindow.setBounds(toolWs.getBounds().createRectangle()); if (toolWs.isVisible() && _app.getDesktopStyle().isInternalFrameStyle()) { _driversListWindow.setVisible(true); // Has to be done directly on the main frame because of racing condition at start up. _mainFrame.setEnabledDriversMenu(true); //_driversListWindow.nowVisible(true); try { _driversListWindow.setSelected(true); } catch (PropertyVetoException ex) { // i18n[WindowManager.errorselectingwindow=Error selecting window] s_log.error(s_stringMgr.getString("WindowManager.errorselectingwindow"), ex); } } else { _driversListWindow.setVisible(false); // Has to be done directly on the main frame because of racing condition at start up. _mainFrame.setEnabledDriversMenu(false); //_driversListWindow.nowVisible(false); } }
public synchronized void addToMenu(int menuId, JMenu menu) { final MainFrame mf = getMainFrame(); if (mf != null) { mf.addToMenu(menuId, menu); } else { throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding")); } }
private void createMainFrame() { _mainFrame = new MainFrame(_app); }
public void dispose() { boolean shouldDispose = true; if (!_app.shutdown(true)) { String msg = s_stringMgr.getString("MainFrame.errorOnClose"); shouldDispose = Dialogs.showYesNo(_app.getMainFrame(), msg); } if (shouldDispose) { closeAllToolWindows(); super.dispose(); System.exit(0); } }
/** * Add component to the main frames status bar. * * @param comp * Component to add. */ public void addToStatusBar(JComponent comp) { final MainFrame mf = getMainFrame(); if (mf != null) { mf.addToStatusBar(comp); } else { throw new IllegalStateException(s_stringMgr.getString("Application.error.compadding")); } }
_app.getMainFrame().addWindowFocusListener(new WindowFocusListener()
private IWidget isInternalFrameUsed(IApplication application, int sheetType) { IWidget[] frames = application.getMainFrame().getDesktopContainer().getAllWidgets(); for (int i = 0; i < frames.length; i++) { if ((sheetType == FB_SHEET_TYPE_CREATE && frames[i] instanceof FirebirdManagerCreateDatabaseFrame) || (sheetType == FB_SHEET_TYPE_USER && frames[i] instanceof FirebirdManagerUserManagerFrame) || (sheetType == FB_SHEET_TYPE_BACKUP && frames[i] instanceof FirebirdManagerBackupRestoreFrame) || (sheetType == FB_SHEET_TYPE_GRANT && frames[i] instanceof FirebirdManagerGrantFrame) || (sheetType == FB_SHEET_TYPE_ROLE && frames[i] instanceof FirebirdManagerRoleFrame) ) { return frames[i]; } } return null; }
private void prepareAliasWindow(MainFrameWindowState ws) _mainFrame.addWidget(_aliasesListWindow); toolWs = ws.getAliasesWindowState(); _aliasesListWindow.setBounds(toolWs.getBounds().createRectangle()); _mainFrame.setEnabledAliasesMenu(true); _mainFrame.setEnabledAliasesMenu(false);
private void prepareDriversWindow(MainFrameWindowState ws) { _mainFrame.addWidget(_driversListWindow); WindowState toolWs = ws.getDriversWindowState(); _driversListWindow.setBounds(toolWs.getBounds().createRectangle()); if (toolWs.isVisible() && _app.getDesktopStyle().isInternalFrameStyle()) { _driversListWindow.setVisible(true); // Has to be done directly on the main frame because of racing condition at start up. _mainFrame.setEnabledDriversMenu(true); //_driversListWindow.nowVisible(true); try { _driversListWindow.setSelected(true); } catch (PropertyVetoException ex) { // i18n[WindowManager.errorselectingwindow=Error selecting window] s_log.error(s_stringMgr.getString("WindowManager.errorselectingwindow"), ex); } } else { _driversListWindow.setVisible(false); // Has to be done directly on the main frame because of racing condition at start up. _mainFrame.setEnabledDriversMenu(false); //_driversListWindow.nowVisible(false); } }
getDesktopContainer().putClientProperty("JDesktopPane.dragMode", null); getDesktopContainer().putClientProperty("JDesktopPane.dragMode", "outline"); if (!show && _statusBarVisible) getContentPane().remove(_statusBar); _statusBarVisible = false; getContentPane().add(_statusBar, BorderLayout.SOUTH); _statusBarVisible = true; if (!show && _toolBar != null) getContentPane().remove(_toolBar); _toolBar = null; getContentPane().add(_toolBar, BorderLayout.NORTH);
createUserInterface(); preferencesHaveChanged(null); // Initial load of prefs. _app.getSquirrelPreferences().addPropertyChangeListener(new PropertyChangeListener()
public synchronized void addToMenu(int menuId, Action action) { final MainFrame mf = getMainFrame(); if (mf != null) { mf.addToMenu(menuId, action); } else { throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding")); } }
private void createMainFrame() { _mainFrame = new MainFrame(_app); }