Examples of IApplication


Examples of net.sourceforge.squirrel_sql.client.IApplication

    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

Examples of net.sourceforge.squirrel_sql.client.IApplication

      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

Examples of net.sourceforge.squirrel_sql.client.IApplication

  }

  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

Examples of net.sourceforge.squirrel_sql.client.IApplication

    }
  }

  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

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
    {
      new CloseAllButCurrentSessionsCommand(app).execute();
    }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

   *
   * @param  evt  The current event.
   */
  public void actionPerformed(ActionEvent evt)
  {
    final IApplication app = getApplication();
    final Frame parentFrame = getParentFrame(evt);
    final FileExtensionFilter[] filters = new FileExtensionFilter[1];
    filters[0] = new FileExtensionFilter(s_stringMgr.getString("DumpApplicationAction.textfiles"), new String[] { ".txt" });
    final JLabel lbl = new JLabel(s_stringMgr.getString("DumpApplicationAction.warning"));
    lbl.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    final File outFile = Dialogs.selectFileForWriting(parentFrame, filters, lbl);
    if (outFile != null)
    {
      ListMessageHandler msgHandler = new ListMessageHandler();
      ICommand cmd = new DumpApplicationCommand(app, outFile, msgHandler);
      try
      {
        cmd.execute();
        String[] msgs = msgHandler.getMessages();
            String[] warnings = msgHandler.getWarningMessages();
        Throwable[] errors = msgHandler.getExceptions();
            if (msgs.length > 0 || errors.length > 0 || warnings.length > 0)
        {
          for (int i = 0; i < msgs.length; ++i)
          {
            app.showErrorDialog(msgs[i]);
          }
          for (int i = 0; i < warnings.length; ++i)
          {
            app.showErrorDialog(warnings[i]);
          }
          for (int i = 0; i < errors.length; ++i)
          {
            app.showErrorDialog(errors[i]);
          }
        }
        else
        {
          final String msg = s_stringMgr.getString("DumpApplicationAction.success", outFile.getAbsolutePath());
          ErrorDialog dlg = new ErrorDialog(getApplication().getMainFrame(), msg);
          // i18n[DumpApplicationAction.titleSuccess=Dump successful]
          dlg.setTitle(s_stringMgr.getString("DumpApplicationAction.titleSuccess"));
          dlg.setVisible(true);
        }
      }
      catch (Throwable ex)
      {
        final String msg = s_stringMgr.getString("DumpApplicationAction.failure");
        app.showErrorDialog(msg, ex);
        s_log.error(msg, ex);
      }
    }
  }
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();
    DriversListInternalFrame tw = app.getWindowManager().getDriversListInternalFrame();
    tw.moveToFront();
    try
    {
      tw.setSelected(true);
    }
    catch (PropertyVetoException ex)
    {
            //i18n[CreateDriverAction.error.selectingwindow=Error selecting window]
      s_log.error(s_stringMgr.getString("CreateDriverAction.error.selectingwindow"), ex);
    }
           
        try {
            final URL url = app.getResources().getDefaultDriversUrl();
            net.sourceforge.squirrel_sql.client.gui.db.DataCache cache = _app.getDataCache();
            ISQLDriver[] missingDrivers = cache.findMissingDefaultDrivers(url);
            if (missingDrivers != null) {
                String msg =
                    s_stringMgr.getString("CreateDriverAction.confirm");
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.IApplication

   *
   * @param  evt   The current event.
   */
  public void actionPerformed(ActionEvent evt)
  {
    final IApplication app = getApplication();

    if (Dialogs.showYesNo(app.getMainFrame(),
                s_stringMgr.getString("InstallDefaultDriversAction.confirm")))
    {
      final DriversListInternalFrame tw = app.getWindowManager().getDriversListInternalFrame();
      tw.moveToFront();
      try
      {
        tw.setSelected(true);
      }
      catch (PropertyVetoException ex)
      {
                //i18n[InstallDefaultDriversAction.error.selectingwindow=Error selecting window]
        s_log.error(s_stringMgr.getString("InstallDefaultDriversAction.error.selectingwindow"), ex);
      }
      final URL url = app.getResources().getDefaultDriversUrl();
      try
      {
        new InstallDefaultDriversCommand(app, url).execute();
      }
      catch (BaseException ex)
      {
        app.showErrorDialog(s_stringMgr.getString("InstallDefaultDriversAction.error.install"), ex);
      }
    }
  }
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();
    DriversListInternalFrame tw = app.getWindowManager().getDriversListInternalFrame();
    tw.moveToFront();
    try
    {
      tw.setSelected(true);
    }
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();
    DriversListInternalFrame tw = app.getWindowManager().getDriversListInternalFrame();
    tw.moveToFront();
    try
    {
      tw.setSelected(true);
    }
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.