Package net.sourceforge.squirrel_sql.client

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


    /* (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

        }
    }   
   
  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

  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

     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

    public static void main(String[] args) {
      new GeneralPreferencesPanelUITest().constructTestFrame().setVisible(true);
    }

    private JFrame constructTestFrame() {
      IApplication mockApplication = mockHelper.createMock("mockApplication", IApplication.class);
      SquirrelPreferences prefs = new SquirrelPreferences();
      expect(mockApplication.getSquirrelPreferences()).andStubReturn(prefs);
      mockHelper.replayAll();
       final JFrame frame = new JFrame("Test UpdatePreferencesPanel");
       GeneralPreferencesPanel panel = new GeneralPreferencesPanel();
       panel.initialize(mockApplication);
       frame.getContentPane().add(panel.getPanelComponent());
View Full Code Here

      ApplicationArguments.initialize(new String[] {});
     
      EasyMockHelper mockHelper = new EasyMockHelper();
     
      // mocks
      IApplication mockApplication = mockHelper.createMock(IApplication.class);
      SquirrelPreferences mockPreferences = mockHelper.createMock(SquirrelPreferences.class);
      IUpdateSettings mockUpdateSettings = mockHelper.createMock(IUpdateSettings.class);
     
      expect(mockApplication.getSquirrelPreferences()).andStubReturn(mockPreferences);
      expect(mockPreferences.getUpdateSettings()).andStubReturn(mockUpdateSettings);
      expect(mockUpdateSettings.getUpdateServer()).andStubReturn("aTestServer");
      expect(mockUpdateSettings.getUpdateServerPort()).andStubReturn("aTestServerPort");
      expect(mockUpdateSettings.getUpdateServerPath()).andStubReturn("aTestServerPath");
      expect(mockUpdateSettings.getUpdateServerChannel()).andStubReturn("aTestServerChannel");
View Full Code Here

  }

  private void createGUI(ISession session)
  {
    setVisible(false);
    final IApplication app = session.getApplication();
    Icon icon = app.getResources().getIcon(getClass(), "frameIcon"); //i18n
    if (icon != null)
    {
      setFrameIcon(icon);
    }
View Full Code Here

    }
  }

  private void createGUI(ISession session)
  {
    final IApplication app = session.getApplication();

    _mainTabPane = _mainPanelFactory.createMainPanel(session);

    add(_mainTabPane, BorderLayout.CENTER);

    Font fn = app.getFontInfoStore().getStatusBarFontInfo().createFont();
    _statusBar.setFont(fn);
    add(_statusBar, BorderLayout.SOUTH);

    _objTreeSelectionLis = new ObjectTreeSelectionListener();
    getObjectTreePanel().addTreeSelectionListener(_objTreeSelectionLis);
View Full Code Here

   *
   * @param  evt  The current event.
   */
  public void actionPerformed(ActionEvent evt)
  {
    IApplication app = getApplication();
    CursorChanger cursorChg = new CursorChanger(app.getMainFrame());
    cursorChg.show();
    try
    {
      new CloseAllButCurrentSessionsCommand(app).execute();
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.IApplication

Copyright © 2018 www.massapicom. 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.