Package net.sourceforge.squirrel_sql.fw.sql

Examples of net.sourceforge.squirrel_sql.fw.sql.SQLDriverProperty


          new SQLDriverPropertyCollection();
       
        DriverPropertyInfo mockDriverPropertyInfo = new DriverPropertyInfo("propName", "propValue");
        mockDriverPropertyInfo.description = "Test prop description";
       
        SQLDriverProperty prop = new SQLDriverProperty(mockDriverPropertyInfo);
       
        propertyCollection.setDriverProperties(new SQLDriverProperty[] { prop });
        DriverPropertiesPanel panel = new DriverPropertiesPanel(propertyCollection);
       
        frame.getContentPane().add(panel);
View Full Code Here


    load(props);
  }

  public Object getValueAt(int row, int col)
  {
    final SQLDriverProperty sdp = _props.getDriverProperty(row);
    switch (col)
    {
      case IColumnIndexes.IDX_NAME:
        return sdp.getName();

      case IColumnIndexes.IDX_SPECIFY:
        return Boolean.valueOf(sdp.isSpecified());

      case IColumnIndexes.IDX_VALUE:
        return sdp.getValue();

      case IColumnIndexes.IDX_REQUIRED:
      {
        // Use valueof when min supported JDK is 1.4
        //return Boolean.valueOf(_props[row].required);
        DriverPropertyInfo dpi = sdp.getDriverPropertyInfo();
        if (dpi != null)
        {
          return Boolean.valueOf(dpi.required);
        }
        return Boolean.FALSE;
      }

      case IColumnIndexes.IDX_DESCRIPTION:
      {
        DriverPropertyInfo dpi = sdp.getDriverPropertyInfo();
        if (dpi != null)
        {
          return dpi.description;
        }
        return s_stringMgr.getString("DriverPropertiesTableModel.unknown");
View Full Code Here

  public void setValueAt(Object value, int row, int col)
  {
    if (col == IColumnIndexes.IDX_VALUE)
    {
      final SQLDriverProperty sdp = _props.getDriverProperty(row);
      sdp.setValue(value.toString());
    }
    else if (col == IColumnIndexes.IDX_SPECIFY)
    {
      final SQLDriverProperty sdp = _props.getDriverProperty(row);
      Boolean bool = Boolean.valueOf(value.toString());
      sdp.setIsSpecified(bool.booleanValue());
    }
    else
    {
      throw new IllegalStateException("Can only edit value/specify column. Trying to edit " + col);
    }
View Full Code Here

   * @param description a description of the driver property.
   */
  public void addRow(String name, String value, String description) {
    DriverPropertyInfo propInfo = new DriverPropertyInfo(name, value);
    propInfo.description = description;
    SQLDriverProperty newProp = new SQLDriverProperty(propInfo);
    _props.addDriverProperty(newProp);
    fireTableDataChanged();
  }
View Full Code Here

      int col)
    {
      if (col != IDX_VALUE) { throw new IllegalStateException("Editor used for cell other than value"); }

      SQLDriverPropertyCollection coll = getTypedModel().getSQLDriverProperties();
      SQLDriverProperty sdp = coll.getDriverProperty(row);
      DriverPropertyInfo prop = sdp.getDriverPropertyInfo();
      if (prop.choices != null && prop.choices.length > 0)
      {
        _comboEditor.removeAllItems();
        for (int i = 0; i < prop.choices.length; ++i)
        {
          _comboEditor.addItem(prop.choices[i]);
        }
        if (sdp.getValue() != null)
        {
          _comboEditor.setSelectedItem(sdp.getValue());
        }
        _currentEditor = _comboEditor;
      }
      else
      {
        _textEditor.setText(sdp.getValue());
        _currentEditor = _textEditor;
      }
      return _currentEditor;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.fw.sql.SQLDriverProperty

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.