Package net.sourceforge.squirrel_sql.client.session

Examples of net.sourceforge.squirrel_sql.client.session.SessionManager


          _session.getAlias().getSchemaProperties();
      SchemaLoadInfo[] schemaLoadInfos =
          schemaProps.getSchemaLoadInfos(_schemaPropsCacheIsBasedOn,
                                         _tabelTableTypesCacheable,
                                         _viewTableTypesCacheable);
      SessionManager sessionMgr = _session.getApplication().getSessionManager();
      boolean allSchemasAllowed = sessionMgr.areAllSchemasAllowed(_session);
     
      if(   1 == schemaLoadInfos.length
         && null == schemaLoadInfos[0].schemaName
         && false == allSchemasAllowed)
      {
         if(false == allSchemasAllowed)
         {
            String[] allowedSchemas = sessionMgr.getAllowedSchemas(_session);

            ArrayList<SchemaLoadInfo> ret = new ArrayList<SchemaLoadInfo>();

            for (int i = 0; i < allowedSchemas.length; i++)
            {
View Full Code Here


  public void testCreateDataSet() throws DataSetException {
   
    ISession mockSession = mockHelper.createMock(ISession.class);
    IApplication mockApplication = mockHelper.createMock(IApplication.class);
    IIdentifier mockIdentifier = mockHelper.createMock(IIdentifier.class);
    SessionManager mockSessionManager = mockHelper.createMock(SessionManager.class);
    ISQLConnection mockSqlConnection = mockHelper.createMock(ISQLConnection.class);
    SQLDatabaseMetaData mockMetaData = mockHelper.createMock(SQLDatabaseMetaData.class);
    IProcedureInfo mockProcedureInfo = mockHelper.createMock(IProcedureInfo.class);
   
    expect(mockSessionManager.getSession(mockIdentifier)).andStubReturn(mockSession);
    expect(mockSession.getApplication()).andStubReturn(mockApplication);
    expect(mockSession.getIdentifier()).andStubReturn(mockIdentifier);
    expect(mockApplication.getSessionManager()).andStubReturn(mockSessionManager);
    expect(mockSession.getSQLConnection()).andStubReturn(mockSqlConnection);
    expect(mockSqlConnection.getSQLMetaData()).andStubReturn(mockMetaData);
View Full Code Here

    if (args == null) { throw new IllegalArgumentException("ApplicationArguments == null"); }

    indicateNewStartupTask(splash, s_stringMgr.getString("Application.splash.createSessionManager"));
    // AliasMaintSheetFactory.initialize(this);
    // DriverMaintSheetFactory.initialize(this);
    _sessionManager = new SessionManager(this);

    indicateNewStartupTask(splash, s_stringMgr.getString("Application.splash.loadingprefs"));

    final boolean loadPlugins = args.getLoadPlugins();
    if (loadPlugins)
View Full Code Here

     replay(session);
     return session;
  }

  public static SessionManager getEasyMockSessionManager() {
     SessionManager result = createMock(SessionManager.class);
     result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class));
     expectLastCall().anyTimes();
     replay(result);
     return result;
  }
View Full Code Here

        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);
     }
View Full Code Here

    SessionDropDown(IApplication app)
    {
      super();
      _app = app;
      final SessionManager sessionManager = _app.getSessionManager();
      final SessionDropDownModel model = new SessionDropDownModel(
                              sessionManager);
      setModel(model);

      // Under JDK1.4 the first item in a JComboBox
      // is no longer automatically selected.
      if (getModel().getSize() > 0)
      {
        setSelectedIndex(0);
      }
      else
      {
        // Under JDK1.4 an empty JComboBox has an almost zero width.
        Dimension dm = getPreferredSize();
        dm.width = 200;
        setPreferredSize(dm);
        // Dont enable the session drop down if it is empty
        setEnabled(false);
      }
      addActionListener(this);
      setMaximumSize(getPreferredSize());

      sessionManager.addSessionListener(new MySessionListener(model, this));
    }
View Full Code Here

    }
  }

  public void activateNextSessionWindow()
  {
    final SessionManager sessMgr = _app.getSessionManager();
    final ISession sess = sessMgr.getActiveSession();

    if (sess == null)
    {
         return;
    }
View Full Code Here

    }
  }

  public void activatePreviousSessionWindow()
  {
      final SessionManager sessMgr = _app.getSessionManager();
      final ISession sess = sessMgr.getActiveSession();

      if (sess == null)
      {
         return;
      }
View Full Code Here

    }

    private ISession createSession(ISQLDriver sqlDriver,
                        SQLConnection conn)
    {
      SessionManager sm = _app.getSessionManager();
      final ISession session = sm.createSession(_app, sqlDriver,
                        _alias, conn, _user, _password);
      _callback.sessionCreated(session);
      SwingUtilities.invokeLater(new Runner(session, _connSheet));
      return session;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.session.SessionManager

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.