Examples of IApplication


Examples of net.sourceforge.squirrel_sql.client.IApplication

//    setTitle(getTitle() + ": " + _session.getSessionSheet().getTitle());

    // This is a tool window.
    makeToolWindow(true);

    final IApplication app = getSession().getApplication();

    // Property panels for SQuirreL.
    _panels.add(new GeneralSessionPropertiesPanel());
    _panels.add(new SessionObjectTreePropertiesPanel(app));
    _panels.add(new SessionSQLPropertiesPanel(app, session));

    // Go thru all plugins attached to this session asking for panels.
    SessionPluginInfo[] plugins = app.getPluginManager().getPluginInformation(getSession());
    for (int i = 0; i < plugins.length; ++i)
    {
      SessionPluginInfo spi = plugins[i];
      if (spi.isLoaded())
      {
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

      if(null == _panel)
      {
         return;
      }

    IApplication app = getApplication();
    CursorChanger cursorChg = new CursorChanger(app.getMainFrame());
    cursorChg.show();
    try
    {
      new CloseAllSQLResultTabsCommand(_panel).execute();
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

    ObjectTreePanel localMockObjectTreePanel =
      localMockHelper.createMock("localMockObjectTreePanel", ObjectTreePanel.class);
    SquirrelPreferences localMockSquirrelPreferences =
      localMockHelper.createMock("mockSquirrelPreferences", SquirrelPreferences.class);
    ISession localMockSession = localMockHelper.createMock("localMockSession", ISession.class);
    IApplication localMockApplication =
      localMockHelper.createMock("localMockApplication", IApplication.class);
    Statement localMockStatement = localMockHelper.createMock("localMockStatement", Statement.class);
    ITableInfo localMockTableInfo = localMockHelper.createMock("localMockTableInfo", ITableInfo.class);
    ResultSet localMockResultSet = localMockHelper.createMock("localMockResultSet", ResultSet.class);
    ResultSetMetaData localMockResultSetMetaData =
      localMockHelper.createMock("localMockResultSetMetaData", ResultSetMetaData.class);

    expect(localMockObjectTreePanel.getSession()).andStubReturn(localMockSession);
    expect(localMockSession.getApplication()).andStubReturn(localMockApplication);
    expect(localMockApplication.getSquirrelPreferences()).andStubReturn(localMockSquirrelPreferences);
    expect(localMockSquirrelPreferences.getShowPleaseWaitDialog()).andStubReturn(false);
    expect(localMockTableInfo.getQualifiedName()).andStubReturn("Test Qualified TableName");

    localMockStatement.close();
    expect(localMockResultSet.getMetaData()).andStubReturn(localMockResultSetMetaData);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

   *
   * @param  evt  The current event.
   */
  public void actionPerformed(ActionEvent evt)
  {
    IApplication app = getApplication();
    CursorChanger cursorChg = new CursorChanger(app.getMainFrame());
    cursorChg.show();
    try
    {
         ISession activeSession = getApplication().getSessionManager().getActiveSession();
         if(   activeSession.getActiveSessionWindow() instanceof SessionInternalFrame
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

  public void execute()
  {
    if (_objectTree != null)
    {
      final ISession session = _objectTree.getSession();
      final IApplication app = session.getApplication();
      final WindowManager winMgr = app.getWindowManager();
      winMgr.showSQLFilterDialog( _objectTree, _objectInfo);
    }
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

      setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

      final Container cont = getContentPane();
      cont.setLayout(new BorderLayout());
      final IApplication app = session.getApplication();


      JPanel pnlButtons = new JPanel(new GridBagLayout());
      GridBagConstraints gbc;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

    /* (non-Javadoc)
     * @see javax.swing.event.UndoableEditListener#undoableEditHappened(javax.swing.event.UndoableEditEvent)
     */
    public void undoableEditHappened(UndoableEditEvent e) {
        IApplication app = getSession().getApplication();
        SquirrelPreferences prefs = app.getSquirrelPreferences();
       
        if (fileOpened || fileSaved) {
            if (prefs.getWarnForUnsavedFileEdits()) {
                unsavedEdits = true;
            }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

        }
    }   
   
  private void createGUI()
  {
    final IApplication app = _session.getApplication();
    synchronized (getClass())
    {
      if (!s_loadedSQLHistory)
      {
        final SQLHistory sqlHistory = app.getSQLHistory();
        SQLHistoryComboBoxModel.initializeSharedInstance(sqlHistory.getData());
        s_loadedSQLHistory = true;
      }
    }

//    _tabbedResultsPanel = UIFactory.getInstance().createTabbedPane();
    _tabbedExecuterPanel = UIFactory.getInstance().createTabbedPane();
    _tabbedExecuterPanel.addChangeListener(new MyExecuterPaneListener());

    setLayout(new BorderLayout());

    _nbrRows.setColumns(8);

    final SessionProperties props = _session.getProperties();
    _sqlCombo = new SQLHistoryComboBox(props.getSQLShareHistory());
    _sqlCombo.setEditable(false);
    if (_sqlCombo.getItemCount() > 0)
    {
      _sqlCombo.setSelectedIndex(_sqlCombo.getItemCount() - 1);
    }

    {
      JPanel pnl = new JPanel();
      pnl.setLayout(new BorderLayout());
      pnl.add(_sqlCombo, BorderLayout.CENTER);

      Box box = Box.createHorizontalBox();
      box.add(new CopyLastButton(app));
      box.add(new ShowHistoryButton(app));
      box.add(Box.createHorizontalStrut(10));
            // i18n[SQLPanel.limitrowscheckbox.hint=Limit rows: ]
            String hint =
                s_stringMgr.getString("SQLPanel.limitrowscheckbox.label");
            _limitRowsChk = new JCheckBox(hint);
      box.add(_limitRowsChk);
      box.add(Box.createHorizontalStrut(5));
      box.add(_nbrRows);
      pnl.add(box, BorderLayout.EAST);
      add(pnl, BorderLayout.NORTH);
    }

      createSplitPaneWithHackToSetSplitLocation();
    _splitPane.setOneTouchExpandable(true);

    installSQLEntryPanel(
            app.getSQLEntryPanelFactory().createSQLEntryPanel(
                    _session,
                    new HashMap<String, Object>()));

      _executerPanleHolder = new JPanel(new GridLayout(1,1));
      _simpleExecuterPanel = new JPanel(new GridLayout(1,1));
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

  public static IApplication getEasyMockApplication() {
     return AppTestUtil.getEasyMockApplication(true, true, null);
  }

  public static IApplication getEasyMockApplication(ActionCollection col) {
     IApplication result = AppTestUtil.getEasyMockApplication(false, false, col);
     replay(result);
     return result;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

     return mockSqlAlias;
  }

  public static IApplication getEasyMockApplication(boolean nice,
        boolean replay, ActionCollection col) {
     IApplication result = null;
     if (nice) {
        result = createNiceMock(IApplication.class);
     } else {
        result = createMock(IApplication.class);
     }
     SquirrelResources resoures = getEasyMockSquirrelResources();
     SessionProperties props = getEasyMockSessionProperties(";", "--", true);
     SquirrelPreferences prefs = getEasyMockSquirrelPreferences(props);
     expect(result.getMainFrame()).andReturn(null).anyTimes();
     expect(result.getResources()).andReturn(resoures).anyTimes();
     expect(result.getSquirrelPreferences()).andReturn(prefs).anyTimes();
     TaskThreadPool mockThreadPool = FwTestUtil.getEasyMockTaskThreadPool();
     expect(result.getThreadPool()).andReturn(mockThreadPool).anyTimes();
     ActionCollection mockActColl = col;
     if (col == null) {
        mockActColl = getEasyMockActionCollection();
     }
     expect(result.getActionCollection()).andReturn(mockActColl).anyTimes();
     SQLDriverManager driverManager = FwTestUtil.getEasyMockSQLDriverManager();
     expect(result.getSQLDriverManager()).andReturn(driverManager).anyTimes();
     SessionManager mockSessionManager = getEasyMockSessionManager();
     expect(result.getSessionManager()).andReturn(mockSessionManager)
                                       .anyTimes();
     if (replay) {
        replay(result);
     }
     return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.