Package net.sourceforge.squirrel_sql.client.gui.session

Examples of net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame


                  ISessionWidget widget = frames[i];
                  try
                  {
                     if (widget instanceof SessionInternalFrame)
                     {
                        SessionInternalFrame sif =
                           (SessionInternalFrame) widget;
                        sif.getObjectTreeAPI().refreshSelectedNodes();
                     }
                  }
                  catch (Exception e)
                  {
                     s_log.error(
View Full Code Here


    expectLastCall().anyTimes();
    SessionPanel panel = AppTestUtil.getEasyMockSessionPanel();
    expect(session.getSessionSheet()).andReturn(panel).anyTimes();
    session.addToToolbar(isA(Action.class));
    expectLastCall().anyTimes();
    SessionInternalFrame frame = AppTestUtil.getEasyMockSessionInternalFrame();
    expect(session.getSessionInternalFrame()).andReturn(frame).anyTimes();

    if (replay)
    {
      replay(session);
View Full Code Here

     replay(resources);
     return resources;
  }

  public static SessionInternalFrame getEasyMockSessionInternalFrame() {
     SessionInternalFrame result = createMock(SessionInternalFrame.class);
     result.addToToolsPopUp(isA(String.class), isA(SquirrelAction.class));
     expectLastCall().anyTimes();
     return result;
  }
View Full Code Here

        ((IObjectTreeAction)act).setObjectTree(((ObjectTreeInternalFrame)frame).getObjectTreePanel());
      }

      if ((isSessionInternalFrame) && (act instanceof ISQLPanelAction))
      {
            SessionInternalFrame sif = (SessionInternalFrame) frame;
            if(sif.getSessionPanel().isSQLTabSelected())
            {
           ((ISQLPanelAction)act).setSQLPanel(sif.getSessionPanel().getSQLPaneAPI());
            }
            else
            {
               ((ISQLPanelAction)act).setSQLPanel(null);
            }
      }
      if ((isSessionInternalFrame) && (act instanceof IObjectTreeAction))
      {
            SessionInternalFrame sif = (SessionInternalFrame) frame;
            if(sif.getSessionPanel().isObjectTreeTabSelected())
            {
               ((IObjectTreeAction)act).setObjectTree(((SessionInternalFrame)frame).getSessionPanel().getObjectTreePanel());
            }
            else
            {
View Full Code Here

      session.addSeparatorToToolbar();
      session.addToToolbar(coll.get(FindAction.class));
      session.addToToolbar(coll.get(ReplaceAction.class));
      session.addToToolbar(coll.get(ConfigureAutoCorrectAction.class));

      SessionInternalFrame sif = session.getSessionInternalFrame();

      ISQLPanelAPI sqlPanelAPI = sif.getSQLPanelAPI();

      new ToolsPopupHandler(this).initToolsPopup(sif, coll);

      JMenuItem mnuComment = sqlPanelAPI.addToSQLEntryAreaMenu(coll.get(CommentAction.class));
      _resources.configureMenuItem(coll.get(CommentAction.class), mnuComment);
View Full Code Here

  {
      try
      {
         PreparedStatement stat = _session.getSQLConnection().prepareStatement(sql);

         SessionInternalFrame sessMainFrm = _session.getSessionInternalFrame();
         IDatabaseObjectInfo[] dbObjs = sessMainFrm.getObjectTreeAPI().getSelectedDatabaseObjects();


         StringBuffer script = new StringBuffer();
         for (int i = 0; i < dbObjs.length; i++)
         {
            ITableInfo ti = (ITableInfo) dbObjs[i];

            stat.setString(1, ti.getSimpleName());
            if (s_log.isDebugEnabled()) {
                s_log.debug("Running SQL: "+sql);
                s_log.debug("Bind var value is: "+ti.getSimpleName());
            }
            ResultSet res = stat.executeQuery();

            while(res.next())
            {
                script.append(res.getString("text"));           
            }
            script.append(getStatementSeparator());
            res.close();
            //
            ///////////////////////////////////////////////////////////
         }

         stat.close();

         sessMainFrm.getSQLPanelAPI().appendSQLScript(script.toString());
         sessMainFrm.getSessionPanel().selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);
      }
      catch (Exception e)
      {
         s_log.error(
             "Unexpected exception while attempting to get source for view: "+
View Full Code Here

             //
             ///////////////////////////////////////////////////////////
         }
         stat.close();

         SessionInternalFrame sessMainFrm = _session.getSessionInternalFrame();
         sessMainFrm.getSQLPanelAPI().appendSQLScript(script.toString());
         sessMainFrm.getSessionPanel().selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

                script.append(getStatementSeparator());
                res.close();
            }
            stat.close();

            SessionInternalFrame sessMainFrm = _session
                    .getSessionInternalFrame();
            sessMainFrm.getSQLPanelAPI().appendSQLScript(script.toString());
            sessMainFrm.getSessionPanel().selectMainTab(
                    ISession.IMainPanelTabIndexes.SQL_TAB);
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            SQLUtilities.closeResultSet(res);
View Full Code Here

  {
      try
      {
         Statement stat = _session.getSQLConnection().createStatement();

         SessionInternalFrame sessMainFrm = _session.getSessionInternalFrame();
         IDatabaseObjectInfo[] dbObjs = sessMainFrm.getObjectTreeAPI().getSelectedDatabaseObjects();


         StringBuffer script = new StringBuffer();
         for (int i = 0; i < dbObjs.length; i++)
         {
            ITableInfo ti = (ITableInfo) dbObjs[i];

            ///////////////////////////////////////////////////////////
            // IBM DB 2 specific code to read view definitions.
            String sql =
               "SELECT TEXT " +
               "FROM SYSIBM.SYSVIEWS " +
               "WHERE NAME = '" + ti.getSimpleName() + "'";

            ResultSet res = stat.executeQuery(sql);
            res.next();

            script.append(res.getString("TEXT"));
            script.append(getStatementSeparator());
            res.close();
            //
            ///////////////////////////////////////////////////////////
         }

         stat.close();

         sessMainFrm.getSQLPanelAPI().appendSQLScript(script.toString());
         sessMainFrm.getSessionPanel().selectMainTab(ISession.IMainPanelTabIndexes.SQL_TAB);
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

    if (session == null)
    {
      throw new IllegalArgumentException("ISession == null");
    }

    final SessionInternalFrame sif = new SessionInternalFrame(session);

    session.setSessionInternalFrame(sif);
    _app.getPluginManager().sessionStarted(session);
    _app.getMainFrame().addWidget(sif);

    // If we don't invokeLater here no Short-Cut-Key is sent
    // to the internal frame
    // seen under java version "1.4.1_01" and Linux
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        sif.setVisible(true);
                sif.getObjectTreeAPI().selectRoot();
      }
    });

    return sif;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame

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.