Package net.sourceforge.squirrel_sql.client.action

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



   private void createMenu()
   {
      IApplication app = getApplication();
      ActionCollection coll = app.getActionCollection();

      JMenu menu = _resources.createMenu(IMenuResourceKeys.USER_SCRIPT);

      _resources.addToMenu(coll.get(UserScriptSQLAction.class), menu);

      app.addToMenu(IApplication.IMenuIDs.SESSION_MENU, menu);
   }


      }

      _resources = new CachePluginResources("de.ixdb.squirrel_sql.plugins.cache.cache", this);

      // Load plugin preferences.
      ActionCollection coll = app.getActionCollection();
      coll.add(new ScriptViewAction(app, _resources, this));
      coll.add(new ScriptFunctionAction(app, _resources, this));
      coll.add(new ScriptCdlAction(app, _resources, this));
      coll.add(new ShowNamespacesAction(app, _resources, this));
      coll.add(new ShowQueryPlanAction(app, _resources, this));
      coll.add(new ShowProcessesAction(app, _resources, this));

//    coll.add(new ScriptProcedureAction(app, _resources, this, _userSettingsFolder));
//    coll.add(new RefreshRepositoryAction(app, _resources, this, _userSettingsFolder));
   }

   {
      try
      {
         if(-1 != session.getSQLConnection().getConnection().getMetaData().getDriverName().toUpperCase().indexOf("CACHE"))
         {
            ActionCollection coll = getApplication().getActionCollection();
            IObjectTreeAPI otApi = session.getSessionInternalFrame().getObjectTreeAPI();
            otApi.addToPopup(DatabaseObjectType.VIEW, coll.get(ScriptViewAction.class));
            otApi.addToPopup(DatabaseObjectType.SESSION, coll.get(ShowNamespacesAction.class));
            otApi.addToPopup(DatabaseObjectType.SESSION, coll.get(ShowProcessesAction.class));
            otApi.addToPopup(DatabaseObjectType.PROCEDURE, coll.get(ScriptFunctionAction.class));
            otApi.addToPopup(DatabaseObjectType.PROCEDURE, coll.get(ScriptCdlAction.class));
            otApi.addToPopup(DatabaseObjectType.TABLE, coll.get(ScriptCdlAction.class));
            otApi.addToPopup(DatabaseObjectType.VIEW, coll.get(ScriptCdlAction.class));


            ISQLPanelAPI sqlApi = session.getSessionInternalFrame().getSQLPanelAPI();
            sqlApi.addToSQLEntryAreaMenu(coll.get(ShowQueryPlanAction.class));

            session.addSeparatorToToolbar();
            session.addToToolbar(coll.get(ShowNamespacesAction.class));
            session.addToToolbar(coll.get(ShowProcessesAction.class));
            session.addToToolbar(coll.get(ShowQueryPlanAction.class));
            session.getSessionInternalFrame().addToToolsPopUp("cachequeryplan", coll.get(ShowQueryPlanAction.class));


            return new PluginSessionCallback()
            {
               public void sqlInternalFrameOpened(SQLInternalFrame sqlInternalFrame, ISession sess)

    }

    _resources = new DBDiffPluginResources(DBDiffPlugin.BUNDLE_BASE_NAME, this);

    IApplication app = getApplication();
    ActionCollection coll = app.getActionCollection();
    coll.add(new SelectAction(app, _resources, this));
    coll.add(new CompareAction(app, _resources, this));

  }

   * @param api
   */
  protected void addMenuItemsToContextMenu(ISession session)
  {
    final IObjectTreeAPI api = session.getObjectTreeAPIOfActiveSessionWindow();
    final ActionCollection coll = getApplication().getActionCollection();

    if (SwingUtilities.isEventDispatchThread())
    {
      addToPopup(api, coll);
    }

  }
  }
  */
  public void setCompareMenuEnabled(boolean enabled)
  {
    final ActionCollection coll = getApplication().getActionCollection();
    CompareAction compareAction = (CompareAction) coll.get(CompareAction.class);
    compareAction.setEnabled(enabled);
  }

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


         add(_catalogsPanel);
         ActionCollection actions = session.getApplication().getActionCollection();
         setUseRolloverButtons(true);
         setFloatable(false);
         add(actions.get(SessionPropertiesAction.class));
         add(actions.get(RefreshSchemaInfoAction.class));
         addSeparator();
         add(actions.get(ExecuteSqlAction.class));
         addSeparator();
//      actions.get(ExecuteSqlAction.class).setEnabled(false);
         add(actions.get(SQLFilterAction.class));
//      actions.get(SQLFilterAction.class).setEnabled(false);
         addSeparator();
         add(actions.get(FileNewAction.class));
         add(actions.get(FileOpenAction.class));
         add(actions.get(FileAppendAction.class));
         add(actions.get(FileSaveAction.class));
         add(actions.get(FileSaveAsAction.class));
         add(actions.get(FilePrintAction.class));
         add(actions.get(FileCloseAction.class));
         addSeparator();
         add(actions.get(PreviousSqlAction.class));
         add(actions.get(NextSqlAction.class));
         add(actions.get(SelectSqlAction.class));

      }

      createGUI(session, panel);
    }

    private void createGUI(ISession session, ISQLPanelAPI panel)
    {
      ActionCollection actions = session.getApplication().getActionCollection();
      setUseRolloverButtons(true);
      setFloatable(false);
      add(actions.get(ExecuteSqlAction.class));
      addSeparator();
      add(actions.get(FileNewAction.class));
      add(actions.get(FileOpenAction.class));
      add(actions.get(FileAppendAction.class));
      add(actions.get(FileSaveAction.class));
      add(actions.get(FileSaveAsAction.class));
            add(actions.get(FilePrintAction.class));
      add(actions.get(FileCloseAction.class));
      addSeparator();
      add(actions.get(PreviousSqlAction.class));
      add(actions.get(NextSqlAction.class));
      add(actions.get(SelectSqlAction.class));
      addSeparator();
      add(actions.get(SQLFilterAction.class));
      actions.get(SQLFilterAction.class).setEnabled(true);
    }

  private void createAliasesListUI()
  {
    final IToogleableAliasesList al = new AliasesList(_app);

    final ActionCollection actions = _app.getActionCollection();
    actions.add(new ModifyAliasAction(_app, al));
    actions.add(new DeleteAliasAction(_app, al));
    actions.add(new CopyAliasAction(_app, al));
    actions.add(new ConnectToAliasAction(_app, al));
    actions.add(new CreateAliasAction(_app));
    actions.add(new SortAliasesAction(_app, al));
    actions.add(new AliasPropertiesAction(_app, al));
    actions.add(new ToggleTreeViewAction(_app, al));
    actions.add(new NewAliasFolderAction(_app, al));
      actions.add(new CopyToPasteAliasFolderAction(_app, al));
    actions.add(new CutAliasFolderAction(_app, al));
    actions.add(new PasteAliasFolderAction(_app, al));
    actions.add(new CollapseAllAliasFolderAction(_app, al));
    actions.add(new ExpandAllAliasFolderAction(_app, al));

      _aliasesListWindow = new AliasesListInternalFrame(_app, al);

   }

  private void createDriversListUI()
  {
    final DriversList dl = new DriversList(_app);

    final ActionCollection actions = _app.getActionCollection();
    actions.add(new ModifyDriverAction(_app, dl));
    actions.add(new DeleteDriverAction(_app, dl));
    actions.add(new CopyDriverAction(_app, dl));
    actions.add(new CreateDriverAction(_app));
        actions.add(new ShowDriverWebsiteAction(_app, dl));

    _driversListWindow = new DriversListInternalFrame(_app, dl);
  }

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.