Package net.sourceforge.squirrel_sql.client.action

Examples of net.sourceforge.squirrel_sql.client.action.ActionCollection


      _tabbedExecutionsPanel.setIconAt(selectedIndex, icon);
   }

   private ImageIcon getStickyIcon()
   {
      ActionCollection actionCollection = _session.getApplication().getActionCollection();

      ImageIcon icon =
         (ImageIcon) actionCollection.get(ToggleCurrentSQLResultTabStickyAction.class).getValue(Action.SMALL_ICON);
      return icon;
   }


     replay(result);
     return result;
  }

  public static ActionCollection getEasyMockActionCollection() {
     ActionCollection result = createMock(ActionCollection.class);
     result.add(isA(Action.class));
     expectLastCall().anyTimes();
     AppTestUtil.expectActionCollectionGet("refreshSchema",
                               RefreshSchemaInfoAction.class,
                               result);
     AppTestUtil.expectActionCollectionGet("refreshObjectTree",

     replay(result);
     return result;
  }

  public static ActionCollection getEasyMockActionCollection(boolean replay) {
     ActionCollection result = createMock(ActionCollection.class);
     if (replay) {
        replay(result);
     }
     return result;
  }

     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();

        resource =
            new SquirrelResources("net.sourceforge.squirrel_sql.client.resources.squirrel");
        prefs = SquirrelPreferences.load();
        threadPool = new TaskThreadPool();
        pluginManager = new PluginManager(this);
        actions = new ActionCollection(this);
        history = new SQLHistory();
        messageHandler = new MockMessageHandler();
        sessionHandler = new MockSessionManager(this);
        fontInfoStore = new FontInfoStore();
    }

        resource =
            new SquirrelResources("net.sourceforge.squirrel_sql.client.resources.squirrel");
        prefs = SquirrelPreferences.load();
        threadPool = new TaskThreadPool();
        pluginManager = new PluginManager(this);
        actions = new ActionCollection(this);
        history = new SQLHistory();
        sqlEntryPanelFactory = new MockSQLEntryPanelFactory();
        messageHandler = new MockMessageHandler();
        sessionHandler = new MockSessionManager(this);
        fontInfoStore = new FontInfoStore();

    {
         _catalogsPanel = new CatalogsPanel(session, this);
         _catalogsPanel.addActionListener(new CatalogsComboListener());
         add(_catalogsPanel);

         ActionCollection actions = session.getApplication()
          .getActionCollection();
      setUseRolloverButtons(true);
      setFloatable(false);
      add(actions.get(RefreshSchemaInfoAction.class));
    }

      }
      _app = app;
      setUseRolloverButtons(true);
      setFloatable(true);

      ActionCollection actions = _app.getActionCollection();
      JLabel lbl = new JLabel(s_stringMgr.getString("MainFrameToolBar.connectTo"));
      lbl.setAlignmentY(0.5f);
      add(lbl);
      AliasesDropDown drop = new AliasesDropDown(app);
      drop.setAlignmentY(0.5f);
      add(drop);
      addSeparator();
      add(actions.get(GlobalPreferencesAction.class));
      add(actions.get(NewSessionPropertiesAction.class));
      if (_app.getDesktopStyle().isInternalFrameStyle())
      {
         addSeparator();
         add(actions.get(TileAction.class));
         add(actions.get(TileHorizontalAction.class));
         add(actions.get(TileVerticalAction.class));
         add(actions.get(CascadeAction.class));
         add(actions.get(MaximizeAction.class));
         addSeparator();
      }
      JLabel lbl2 = new JLabel(" " + s_stringMgr.getString("MainFrameToolBar.activeSession") + " ");
      lbl.setAlignmentY(0.5f);
      add(lbl2);
      SessionDropDown sessionDropDown = new SessionDropDown(app);
      sessionDropDown.setAlignmentY(0.5f);
      add(sessionDropDown);

      addToggleAction((IToggleAction) actions.get(ToggleAutoCommitAction.class));
      add(actions.get(CommitAction.class));
      add(actions.get(RollbackAction.class));

      addSeparator();

      add(actions.get(NewSQLWorksheetAction.class));
      add(actions.get(NewObjectTreeAction.class));
   }

      _app = app;
//      _driversList = new DriversList(app);
      _driversList = list;

      final ActionCollection actions = app.getActionCollection();
      _pm.add(actions.get(CreateDriverAction.class));
      _pm.addSeparator();
      _pm.add(actions.get(ModifyDriverAction.class));
      _pm.add(actions.get(CopyDriverAction.class));
            _pm.add(actions.get(ShowDriverWebsiteAction.class));
            _pm.addSeparator();
      _pm.add(actions.get(DeleteDriverAction.class));
      _pm.addSeparator();
    }

            final JLabel lbl = new JLabel(getWindowTitle(), SwingConstants.CENTER);
            lbl.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
            _tb.add(lbl, 0);
         }

         final ActionCollection actions = _app.getActionCollection();
      _tb.add(actions.get(CreateDriverAction.class));
      _tb.add(actions.get(ModifyDriverAction.class));
      _tb.add(actions.get(CopyDriverAction.class));
         _tb.add(actions.get(ShowDriverWebsiteAction.class));
      _tb.add(actions.get(DeleteDriverAction.class));
      _tb.addSeparator();
      _tb.add(actions.get(InstallDefaultDriversAction.class));
      _tb.addSeparator();
//      _tb.add(actions.get(ShowLoadedDriversOnlyAction.class));

      final Action act = actions.get(ShowLoadedDriversOnlyAction.class);
      final JToggleButton btn = new JToggleButton(act);
      final boolean show = _app.getSquirrelPreferences().getShowLoadedDriversOnly();
      btn.setSelected(show);
      btn.setText(null);
      _tb.add(btn);

TOP

Related Classes of net.sourceforge.squirrel_sql.client.action.ActionCollection

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.