Package net.sourceforge.squirrel_sql.client.session.properties

Examples of net.sourceforge.squirrel_sql.client.session.properties.SessionProperties


  public synchronized void setSessionProperties(SessionProperties data)
  {
    if (_sessionProps != data)
    {
      final SessionProperties oldValue = _sessionProps;
      _sessionProps = data;
      getPropertyChangeReporter().firePropertyChange(IPropertyNames.SESSION_PROPERTIES,
                        oldValue, _sessionProps);
    }
  }
View Full Code Here


      try
      {
         final Statement stmt = conn.createStatement();
         try
         {
            final SessionProperties props = session.getProperties();
            if (props.getContentsLimitRows())
            {
               try
               {
                  stmt.setMaxRows(props.getContentsNbrRowsToShow());
               }
               catch (Exception ex)
               {
                  s_log.error("Error on Statement.setMaxRows()", ex);
               }
View Full Code Here

          public void run() {
              if (session == null || session.getProperties() == null) {
                  setEnabled(false);
                 _toogleComponentHolder.setSelected(false);
              } else {
                 SessionProperties props = session.getProperties();
                 setEnabled(true);
                 props.addPropertyChangeListener(_propertyListener);
                 _toogleComponentHolder.setSelected(props.getAutoCommit());
              }
          }
      });

   }
View Full Code Here

   private static class MyTextArea extends JTextArea
  {
    private MyTextArea(ISession session)
    {
      SessionProperties props = session.getProperties();
      final FontInfo fi = props.getFontInfo();
      if (fi != null)
      {
        this.setFont(props.getFontInfo().createFont());
      }
    }
View Full Code Here

      }
  }

   private void checkResultTabLimit()
   {
      SessionProperties props = _session.getProperties();

      while(props.getLimitSQLResultTabs() && props.getSqlResultTabLimit() < _tabbedExecutionsPanel.getTabCount())
      {
         closeResultTabAt(0);
      }
   }
View Full Code Here

   }


   private void propertiesHaveChanged(String propName)
  {
    final SessionProperties props = _session.getProperties();

    if (propName == null
            || propName.equals(SessionProperties.IPropertyNames.AUTO_COMMIT))
    {
            SetAutoCommitTask task = new SetAutoCommitTask();
        if (SwingUtilities.isEventDispatchThread()) {
                _session.getApplication().getThreadPool().addTask(task);
            } else {
                task.run();
            }
        }

    if (propName == null
        || propName
            .equals(SessionProperties.IPropertyNames.SQL_EXECUTION_TAB_PLACEMENT))
    {
      _tabbedExecutionsPanel.setTabPlacement(props.getSQLExecutionTabPlacement());
    }
  }
View Full Code Here

        }
    }
  
  private void createGUI()
  {
      final SessionProperties props = _session.getProperties();
    _tabbedExecutionsPanel = UIFactory.getInstance().createTabbedPane(props.getSQLExecutionTabPlacement());


      createTabPopup();

View Full Code Here

    private class SetAutoCommitTask implements Runnable {
               
        public void run() {
            final ISQLConnection conn = _session.getSQLConnection();
            final SessionProperties props = _session.getProperties();
            if (conn != null)
            {
                boolean auto = true;
                try
                {
                    auto = conn.getAutoCommit();
                }
                catch (SQLException ex)
                {
                    s_log.error("Error with transaction control", ex);
                    _session.showErrorMessage(ex);
                }
                try
                {
                    conn.setAutoCommit(props.getAutoCommit());
                }
                catch (SQLException ex)
                {
                    props.setAutoCommit(auto);
                    _session.showErrorMessage(ex);
                }
            }       
        }
View Full Code Here

            // i18n[SQLResultExecuterPanel.outputStatus=Building output...]
            String outputStatus =
                s_stringMgr.getString("SQLResultExecuterPanel.outputStatus");
      _cancelPanel.setStatusLabel(outputStatus);
      rsds = new ResultSetDataSet();
      SessionProperties props = getSession().getProperties();
      ResultSetMetaDataDataSet rsmdds = null;
            if (props.getShowResultsMetaData())
            {
               rsmdds = new ResultSetMetaDataDataSet(rs);
            }
         DialectType dialectType =
            DialectFactory.getDialectType(getSession().getMetaData());
View Full Code Here

      }
    });

    _allowEditing = new EditableSqlCheck(exInfo).allowsEditing();

    final SessionProperties props = _session.getProperties();

    if (_allowEditing)
    {
      _resultSetOutput = BaseDataSetViewerDestination.getInstance(props.getSQLResultsOutputClassName(), _creator);

    }
    else
    {
      // sql contains columns from multiple tables,
      // so we cannot use all of the columns in a WHERE clause
      // and it becomes difficult to know which table (or tables!) an
      // edited column belongs to.  Therefore limit the output
      // to be read-only
      _resultSetOutput = BaseDataSetViewerDestination.getInstance(
        props.getReadOnlySQLResultsOutputClassName(), null);
    }


    _resultSetSp.setViewportView(_resultSetOutput.getComponent());
      _resultSetSp.setRowHeader(null);

      if (_session.getProperties().getShowResultsMetaData())
      {
         _metaDataOutput = BaseDataSetViewerDestination.getInstance(props.getMetaDataOutputClassName(), null);
         _metaDataSp.setViewportView(_metaDataOutput.getComponent());
         _metaDataSp.setRowHeader(null);
      }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.client.session.properties.SessionProperties

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.