[Squirrel-sql-commits] sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties EditWher
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Gerd W. <ger...@us...> - 2006-01-25 21:37:03
|
Update of /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8629/app/src/net/sourceforge/squirrel_sql/client/session/properties Modified Files: EditWhereColsPanel.java EditWhereColsSheet.java GeneralSessionPropertiesPanel.java I18NStrings.properties SessionObjectTreePropertiesPanel.java SessionPropertiesSheet.java Log Message: I18n Index: GeneralSessionPropertiesPanel.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/GeneralSessionPropertiesPanel.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GeneralSessionPropertiesPanel.java 9 Jun 2004 16:47:39 -0000 1.9 --- GeneralSessionPropertiesPanel.java 25 Jan 2006 21:36:49 -0000 1.10 *************** *** 36,43 **** --- 36,50 ---- import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetViewerTablePanel; import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetViewerTextPanel; + import net.sourceforge.squirrel_sql.fw.util.StringManager; + import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; public class GeneralSessionPropertiesPanel implements INewSessionPropertiesPanel, ISessionPropertiesPanel { + + private static final StringManager s_stringMgr = + StringManagerFactory.getStringManager(GeneralSessionPropertiesPanel.class); + + /** * This interface defines locale specific strings. This should be *************** *** 46,66 **** interface GeneralSessionPropertiesPanelI18n { ! String HINT = "General settings for the current session"; ! String MAIN_TAB_PLACEMENT = "Main Tabs:"; ! String META_DATA = "Meta Data:"; ! String SHOW_TOOLBAR = "Show toolbar"; ! String OBJECT_TAB_PLACEMENT = "Object Tabs:"; ! String SQL_EXECUTION_TAB_PLACEMENT = "SQL Execution Tabs:"; ! String SQL_RESULTS = "SQL Results:"; ! String SQL_RESULTS_TAB_PLACEMENT= "SQL Results Tabs:"; ! String TITLE = "General"; ! String TABLE_CONTENTS = "Table Contents:"; ! String TABLE = "Table"; ! String EDITABLE_TABLE = "Editable Table"; ! String TEXT = "Text"; ! ! String DATA_TYPE1 = "Properties for the individual Data Types may be set in the"; ! String DATA_TYPE2 = "'General Preferences' window under the 'Data Type Controls' tab."; } --- 53,88 ---- interface GeneralSessionPropertiesPanelI18n { ! // i18n[generalSessionPropertiesPanel.generalSettings=General settings for the current session] ! String HINT = s_stringMgr.getString("generalSessionPropertiesPanel.generalSettings"); ! // i18n[generalSessionPropertiesPanel.mainTabs=Main Tabs:] ! String MAIN_TAB_PLACEMENT = s_stringMgr.getString("generalSessionPropertiesPanel.mainTabs"); ! // i18n[generalSessionPropertiesPanel.metaData=Meta Data:] ! String META_DATA = s_stringMgr.getString("generalSessionPropertiesPanel.metaData"); ! // i18n[generalSessionPropertiesPanel.showToolbar=Show toolbar] ! String SHOW_TOOLBAR = s_stringMgr.getString("generalSessionPropertiesPanel.showToolbar"); ! // i18n[generalSessionPropertiesPanel.objectTabs=Object Tabs:] ! String OBJECT_TAB_PLACEMENT = s_stringMgr.getString("generalSessionPropertiesPanel.objectTabs"); ! // i18n[generalSessionPropertiesPanel.sqlExecTabs=SQL Execution Tabs:] ! String SQL_EXECUTION_TAB_PLACEMENT = s_stringMgr.getString("generalSessionPropertiesPanel.sqlExecTabs"); ! // i18n[generalSessionPropertiesPanel.sqlResults=SQL Results:] ! String SQL_RESULTS = s_stringMgr.getString("generalSessionPropertiesPanel.sqlResults"); ! // i18n[generalSessionPropertiesPanel.sqlResultTabs=SQL Results Tabs:] ! String SQL_RESULTS_TAB_PLACEMENT= s_stringMgr.getString("generalSessionPropertiesPanel.sqlResultTabs"); ! // i18n[generalSessionPropertiesPanel.general=General] ! String TITLE = s_stringMgr.getString("generalSessionPropertiesPanel.general"); ! // i18n[generalSessionPropertiesPanel.tableContents=Table Contents:] ! String TABLE_CONTENTS = s_stringMgr.getString("generalSessionPropertiesPanel.tableContents"); ! // i18n[generalSessionPropertiesPanel.table=Table] ! String TABLE = s_stringMgr.getString("generalSessionPropertiesPanel.table"); ! // i18n[generalSessionPropertiesPanel.editableTable=Editable Table] ! String EDITABLE_TABLE = s_stringMgr.getString("generalSessionPropertiesPanel.editableTable"); ! // i18n[generalSessionPropertiesPanel.text=Text] ! String TEXT = s_stringMgr.getString("generalSessionPropertiesPanel.text"); ! ! // i18n[generalSessionPropertiesPanel.dataTYpe1=Properties for the individual Data Types may be set in the] ! String DATA_TYPE1 = s_stringMgr.getString("generalSessionPropertiesPanel.dataTYpe1"); ! // i18n[generalSessionPropertiesPanel.dataTYpe2='General Preferences' window under the 'Data Type Controls' tab.] ! String DATA_TYPE2 = s_stringMgr.getString("generalSessionPropertiesPanel.dataTYpe2"); } *************** *** 253,257 **** { JPanel pnl = new JPanel(new GridBagLayout()); ! pnl.setBorder(BorderFactory.createTitledBorder("Appearance")); final GridBagConstraints gbc = new GridBagConstraints(); --- 275,280 ---- { JPanel pnl = new JPanel(new GridBagLayout()); ! // i18n[generalSessionPropertiesPanel.appearance=Appearance] ! pnl.setBorder(BorderFactory.createTitledBorder(s_stringMgr.getString("generalSessionPropertiesPanel.appearance"))); final GridBagConstraints gbc = new GridBagConstraints(); *************** *** 301,305 **** { JPanel pnl = new JPanel(new GridBagLayout()); ! pnl.setBorder(BorderFactory.createTitledBorder("Output")); final GridBagConstraints gbc = new GridBagConstraints(); --- 324,329 ---- { JPanel pnl = new JPanel(new GridBagLayout()); ! // i18n[editWherColsSheet.output=Output] ! pnl.setBorder(BorderFactory.createTitledBorder(s_stringMgr.getString("editWherColsSheet.output"))); final GridBagConstraints gbc = new GridBagConstraints(); *************** *** 401,408 **** private static final class TabPlacement { ! static final TabPlacement TOP = new TabPlacement("Top", SwingConstants.TOP); ! static final TabPlacement LEFT = new TabPlacement("Left", SwingConstants.LEFT); ! static final TabPlacement BOTTOM = new TabPlacement("Bottom", SwingConstants.BOTTOM); ! static final TabPlacement RIGHT = new TabPlacement("Right", SwingConstants.RIGHT); private final String _name; --- 425,436 ---- private static final class TabPlacement { ! // i18n[generalPropertiesPanel.top=Top] ! static final TabPlacement TOP = new TabPlacement(s_stringMgr.getString("generalPropertiesPanel.top"), SwingConstants.TOP); ! // i18n[generalPropertiesPanel.left=Left] ! static final TabPlacement LEFT = new TabPlacement(s_stringMgr.getString("generalPropertiesPanel.left"), SwingConstants.LEFT); ! // i18n[generalPropertiesPanel.bottom=Bottom] ! static final TabPlacement BOTTOM = new TabPlacement(s_stringMgr.getString("generalPropertiesPanel.bottom"), SwingConstants.BOTTOM); ! // i18n[generalPropertiesPanel.right=Right] ! static final TabPlacement RIGHT = new TabPlacement(s_stringMgr.getString("generalPropertiesPanel.right"), SwingConstants.RIGHT); private final String _name; Index: SessionPropertiesSheet.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionPropertiesSheet.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** SessionPropertiesSheet.java 18 Dec 2005 00:30:42 -0000 1.20 --- SessionPropertiesSheet.java 25 Jan 2006 21:36:49 -0000 1.21 *************** *** 38,41 **** --- 38,43 ---- import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; + import net.sourceforge.squirrel_sql.fw.util.StringManager; + import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; import net.sourceforge.squirrel_sql.client.IApplication; *************** *** 45,53 **** import net.sourceforge.squirrel_sql.client.plugin.SessionPluginInfo; import net.sourceforge.squirrel_sql.client.session.ISession; ! // JASON: Move to package gui...something ! // JASON: Create thru WindowManager public class SessionPropertiesSheet extends BaseSessionInternalFrame { ! /** * This interface defines locale specific strings. This should be * replaced with a property file. --- 47,58 ---- import net.sourceforge.squirrel_sql.client.plugin.SessionPluginInfo; import net.sourceforge.squirrel_sql.client.session.ISession; ! public class SessionPropertiesSheet extends BaseSessionInternalFrame { ! private static final StringManager s_stringMgr = ! StringManagerFactory.getStringManager(SessionPropertiesSheet.class); ! ! ! /** * This interface defines locale specific strings. This should be * replaced with a property file. *************** *** 55,59 **** private interface i18n { ! String TITLE = "- Session Properties"; } --- 60,66 ---- private interface i18n { ! ! // i18n[sessionPropertiesSheet.sessionProperties=- Session Properties] ! String TITLE = s_stringMgr.getString("sessionPropertiesSheet.sessionProperties"); } *************** *** 231,235 **** JPanel pnl = new JPanel(); ! JButton okBtn = new JButton("OK"); okBtn.addActionListener(new ActionListener() { --- 238,243 ---- JPanel pnl = new JPanel(); ! // i18n[sessionPropertiesSheet.ok=OK] ! JButton okBtn = new JButton(s_stringMgr.getString("sessionPropertiesSheet.ok")); okBtn.addActionListener(new ActionListener() { *************** *** 239,243 **** } }); ! JButton closeBtn = new JButton("Close"); closeBtn.addActionListener(new ActionListener() { --- 247,253 ---- } }); ! ! // i18n[sessionPropertiesSheet.close=Close] ! JButton closeBtn = new JButton(s_stringMgr.getString("sessionPropertiesSheet.close")); closeBtn.addActionListener(new ActionListener() { Index: EditWhereColsSheet.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/EditWhereColsSheet.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EditWhereColsSheet.java 27 Nov 2005 02:26:25 -0000 1.7 --- EditWhereColsSheet.java 25 Jan 2006 21:36:49 -0000 1.8 *************** *** 46,49 **** --- 46,52 ---- import net.sourceforge.squirrel_sql.fw.util.log.ILogger; import net.sourceforge.squirrel_sql.fw.util.log.LoggerController; + import net.sourceforge.squirrel_sql.fw.util.StringManager; + import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; + /** * Edit Where Cols dialog gui. *************** *** 52,55 **** --- 55,63 ---- public class EditWhereColsSheet extends BaseSessionInternalFrame { + + private static final StringManager s_stringMgr = + StringManagerFactory.getStringManager(EditWhereColsSheet.class); + + /** * This interface defines locale specific strings. This should be *************** *** 59,63 **** { /** Title */ ! String TITLE = "Edit 'WHERE' columns"; } --- 67,72 ---- { /** Title */ ! // i18n[editWhereColsSheet.editWhereColumns=Edit 'WHERE' columns] ! String TITLE = s_stringMgr.getString("editWhereColsSheet.editWhereColumns"); } *************** *** 206,219 **** { final SQLConnection conn = session.getSQLConnection(); ! TableColumnInfo[] infos = conn.getSQLMetaData().getColumnInfo((ITableInfo)_objectInfo); ! for (int i = 0; i < infos.length; i++) { ! TableColumnInfo info = infos[i]; ! columnNames.add(info.getColumnName()); ! } } catch (SQLException ex) { session.getApplication().showErrorDialog( ! "Unable to get list of columns, " + ex); } --- 215,229 ---- { final SQLConnection conn = session.getSQLConnection(); ! TableColumnInfo[] infos = conn.getSQLMetaData().getColumnInfo((ITableInfo)_objectInfo); ! for (int i = 0; i < infos.length; i++) { ! TableColumnInfo info = infos[i]; ! columnNames.add(info.getColumnName()); ! } } catch (SQLException ex) { session.getApplication().showErrorDialog( ! // i18n[editWhereColsSheet.unableToEdit=Unable to get list of columns, {0}] ! s_stringMgr.getString("editWhereColsSheet.unableToEdit", ex)); } *************** *** 225,229 **** sp.setBorder(BorderFactory.createEmptyBorder()); ! _titleLbl.setText(getTitle() + ": " + _objectInfo.getSimpleName()); --- 235,239 ---- sp.setBorder(BorderFactory.createEmptyBorder()); ! _titleLbl.setText(getTitle() + ": " + _objectInfo.getSimpleName()); *************** *** 254,262 **** ++gbc.gridy; contentPane.add( ! new JLabel("Limit the size of the WHERE clause used behind the scenes when editing cell contents."), gbc); gbc.gridx = 0; ++gbc.gridy; contentPane.add( ! new JLabel("The 'use' window should include at least the primary keys for the table."), gbc); // leave a blank line just to make it look a bit nicer --- 264,274 ---- ++gbc.gridy; contentPane.add( ! // i18n[editWhereColsSheet.limitSizeOfWhereClause=Limit the size of the WHERE clause used behind the scenes when editing cell contents.] ! new JLabel(s_stringMgr.getString("editWhereColsSheet.limitSizeOfWhereClause")), gbc); gbc.gridx = 0; ++gbc.gridy; contentPane.add( ! // i18n[editWhereColsSheet.shouldIncludePKs=The 'use' window should include at least the primary keys for the table.] ! new JLabel(s_stringMgr.getString("editWhereColsSheet.shouldIncludePKs")), gbc); // leave a blank line just to make it look a bit nicer *************** *** 288,292 **** JPanel pnl = new JPanel(); ! JButton okBtn = new JButton("OK"); okBtn.addActionListener(new ActionListener() { --- 300,305 ---- JPanel pnl = new JPanel(); ! // i18n[editWherColsSheet.ok=OK] ! JButton okBtn = new JButton(s_stringMgr.getString("editWherColsSheet.ok")); okBtn.addActionListener(new ActionListener() { *************** *** 296,300 **** } }); ! JButton resetBtn = new JButton("Reset"); resetBtn.addActionListener(new ActionListener() { --- 309,314 ---- } }); ! // i18n[editWherColsSheet.reset=Reset] ! JButton resetBtn = new JButton(s_stringMgr.getString("editWherColsSheet.reset")); resetBtn.addActionListener(new ActionListener() { *************** *** 304,308 **** } }); ! JButton closeBtn = new JButton("Close"); closeBtn.addActionListener(new ActionListener() { --- 318,323 ---- } }); ! // i18n[editWherColsSheet.close=Close] ! JButton closeBtn = new JButton(s_stringMgr.getString("editWherColsSheet.close")); closeBtn.addActionListener(new ActionListener() { Index: SessionObjectTreePropertiesPanel.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionObjectTreePropertiesPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SessionObjectTreePropertiesPanel.java 25 Sep 2005 02:56:14 -0000 1.4 --- SessionObjectTreePropertiesPanel.java 25 Jan 2006 21:36:49 -0000 1.5 *************** *** 39,42 **** --- 39,44 ---- import net.sourceforge.squirrel_sql.fw.gui.IntegerField; import net.sourceforge.squirrel_sql.fw.gui.MultipleLineLabel; + import net.sourceforge.squirrel_sql.fw.util.StringManager; + import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; /** *************** *** 46,285 **** */ public class SessionObjectTreePropertiesPanel ! implements INewSessionPropertiesPanel, ISessionPropertiesPanel { - /** Application API. */ - private final IApplication _app; ! /** The actual GUI panel that allows user to do the maintenance. */ ! private final ObjectTreepropsPanel _myPanel; - /** Session properties object being maintained. */ - private SessionProperties _props; ! /** ! * ctor specifying the Application API. ! * ! * @param app Application API. ! * ! * @throws IllegalArgumentException ! * Thrown if <tt>null</tt> <tt>IApplication</tt> ! * passed. ! */ ! public SessionObjectTreePropertiesPanel(IApplication app) ! throws IllegalArgumentException ! { ! super(); ! if (app == null) ! { ! throw new IllegalArgumentException("Null IApplication passed"); ! } ! _app = app; ! _myPanel = new ObjectTreepropsPanel(app); ! } ! /** ! * Initialize this panel with the "New Session" settings. ! * ! * @param app Application API. ! */ ! public void initialize(IApplication app) ! { ! _props = _app.getSquirrelPreferences().getSessionProperties(); ! _myPanel.loadData(_props); ! } ! public void initialize(IApplication app, ISession session) ! throws IllegalArgumentException ! { ! if (session == null) ! { ! throw new IllegalArgumentException("Null ISession passed"); ! } ! _props = session.getProperties(); ! _myPanel.loadData(_props); ! } ! public Component getPanelComponent() ! { ! return _myPanel; ! } ! public String getTitle() ! { ! return ObjectTreepropsPanel.i18n.OBJECT_TREE; ! } ! public String getHint() ! { ! return ObjectTreepropsPanel.i18n.OBJECT_TREE; ! } ! public void applyChanges() ! { ! _myPanel.applyChanges(_props); ! } ! private static final class ObjectTreepropsPanel extends JPanel ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! interface i18n ! { ! String CATALOG_PREFIX = "Limit Catalog Objects using these comma-delimited prefixes:"; ! String LIMIT_ROWS_CONTENTS = "Contents - Limit rows"; ! String SCHEMA_PREFIX = "Limit Schema Objects using these comma-delimited prefixes:"; ! String SHOW_ROW_COUNT = "Show Row Count for Tables (can slow application)"; ! String OBJECT_TREE = "Object Tree"; ! } ! private IntegerField _contentsNbrRowsToShowField = new IntegerField(5); ! private JCheckBox _contentsLimitRowsChk = new JCheckBox(i18n.LIMIT_ROWS_CONTENTS); ! private JCheckBox _showRowCountChk = new JCheckBox(i18n.SHOW_ROW_COUNT); ! private JTextField _schemaPrefixField = new JTextField(20); ! private JTextField _catalogPrefixField = new JTextField(20); ! private JTextField _objectFilterField = new JTextField(20); ! private JCheckBox _loadSchemasCatalogsChk = new JCheckBox("Load Schemas/Catalogs into object tree"); ! /** ! * This object will update the status of the GUI controls as the user ! * makes changes. ! */ ! private final ControlMediator _controlMediator = new ControlMediator(); ! ObjectTreepropsPanel(IApplication app) ! { ! super(); ! createGUI(); ! } ! void loadData(SessionProperties props) ! { ! _contentsNbrRowsToShowField.setInt(props.getContentsNbrRowsToShow()); ! _contentsLimitRowsChk.setSelected(props.getContentsLimitRows()); ! _showRowCountChk.setSelected(props.getShowRowCount()); ! _schemaPrefixField.setText(props.getSchemaPrefixList()); ! _catalogPrefixField.setText(props.getCatalogPrefixList()); ! if (props.getObjectFilter() != null) ! _objectFilterField.setText(props.getObjectFilter()); ! _loadSchemasCatalogsChk.setSelected(props.getLoadSchemasCatalogs()); ! updateControlStatus(); ! } ! void applyChanges(SessionProperties props) ! { ! props.setContentsNbrRowsToShow(_contentsNbrRowsToShowField.getInt()); ! props.setContentsLimitRows(_contentsLimitRowsChk.isSelected()); ! props.setShowRowCount(_showRowCountChk.isSelected()); ! props.setSchemaPrefixList(_schemaPrefixField.getText()); ! props.setCatalogPrefixList(_catalogPrefixField.getText()); ! props.setObjectFilter(_objectFilterField.getText()); ! props.setLoadSchemasCatalogs(_loadSchemasCatalogsChk.isSelected()); ! } ! private void updateControlStatus() ! { ! _contentsNbrRowsToShowField.setEnabled(_contentsLimitRowsChk.isSelected()); ! } ! private void createGUI() ! { ! setLayout(new GridBagLayout()); ! final GridBagConstraints gbc = new GridBagConstraints(); ! gbc.anchor = GridBagConstraints.WEST; ! gbc.fill = GridBagConstraints.HORIZONTAL; ! gbc.insets = new Insets(4, 4, 4, 4); ! gbc.gridx = 0; ! gbc.gridy = 0; ! add(createObjectTreePanel(), gbc); ! ++gbc.gridy; ! add(createFilterPanel(), gbc); ! } ! private JPanel createObjectTreePanel() ! { ! final JPanel pnl = new JPanel(new GridBagLayout()); ! pnl.setBorder(BorderFactory.createTitledBorder(i18n.OBJECT_TREE)); ! final GridBagConstraints gbc = new GridBagConstraints(); ! gbc.fill = GridBagConstraints.HORIZONTAL; ! gbc.insets = new Insets(4, 4, 4, 4); ! gbc.anchor = GridBagConstraints.CENTER; ! _contentsLimitRowsChk.addChangeListener(_controlMediator); ! _contentsNbrRowsToShowField.setColumns(5); ! gbc.gridwidth = GridBagConstraints.REMAINDER; ! gbc.gridx = 0; ! gbc.gridy = 0; ! pnl.add(_loadSchemasCatalogsChk, gbc); ! ++gbc.gridy; // new line ! gbc.gridx = 0; ! pnl.add(_showRowCountChk, gbc); ! ++gbc.gridy; // new line ! gbc.gridx = 0; ! gbc.gridwidth = 2; ! pnl.add(_contentsLimitRowsChk, gbc); ! gbc.gridwidth = 1; ! gbc.gridx+=2; ! pnl.add(_contentsNbrRowsToShowField, gbc); ! ++gbc.gridx; ! gbc.gridwidth = GridBagConstraints.REMAINDER; ! pnl.add(new JLabel("rows"), gbc); ! return pnl; ! } ! private JPanel createFilterPanel() ! { ! final JPanel pnl = new JPanel(new GridBagLayout()); ! pnl.setBorder(BorderFactory.createTitledBorder("Filters")); ! final GridBagConstraints gbc = new GridBagConstraints(); ! gbc.fill = GridBagConstraints.HORIZONTAL; ! gbc.anchor = GridBagConstraints.WEST; ! gbc.insets = new Insets(4, 4, 4, 4); ! gbc.weightx = 1.0; ! gbc.gridx = 0; ! gbc.gridy = 0; ! pnl.add(new JLabel(i18n.SCHEMA_PREFIX, SwingConstants.RIGHT), gbc); ! ++gbc.gridy; ! pnl.add(_schemaPrefixField, gbc); ! ++gbc.gridy; ! pnl.add(new JLabel(i18n.CATALOG_PREFIX, SwingConstants.RIGHT), gbc); ! ++gbc.gridy; ! pnl.add(_catalogPrefixField, gbc); ! ++gbc.gridy; ! pnl.add(new MultipleLineLabel("Object Filter:\n\"%\" means match any substring of 0 or more characters\n\"_\" means match any one character"), gbc); ! ++gbc.gridy; ! pnl.add(_objectFilterField, gbc); ! return pnl; ! } ! /** ! * This class will update the status of the GUI controls as the user ! * makes changes. ! */ ! private final class ControlMediator implements ChangeListener, ! ActionListener ! { ! public void stateChanged(ChangeEvent evt) ! { ! updateControlStatus(); ! } ! public void actionPerformed(ActionEvent evt) ! { ! updateControlStatus(); ! } ! } ! } } --- 48,301 ---- */ public class SessionObjectTreePropertiesPanel ! implements INewSessionPropertiesPanel, ISessionPropertiesPanel { ! private static final StringManager s_stringMgr = ! StringManagerFactory.getStringManager(SessionObjectTreePropertiesPanel.class); ! /** Application API. */ ! private final IApplication _app; ! /** The actual GUI panel that allows user to do the maintenance. */ ! private final ObjectTreepropsPanel _myPanel; ! /** Session properties object being maintained. */ ! private SessionProperties _props; ! /** ! * ctor specifying the Application API. ! * ! * @param app Application API. ! * ! * @throws IllegalArgumentException ! * Thrown if <tt>null</tt> <tt>IApplication</tt> ! * passed. ! */ ! public SessionObjectTreePropertiesPanel(IApplication app) ! throws IllegalArgumentException ! { ! super(); ! if (app == null) ! { ! throw new IllegalArgumentException("Null IApplication passed"); ! } ! _app = app; ! _myPanel = new ObjectTreepropsPanel(app); ! } ! /** ! * Initialize this panel with the "New Session" settings. ! * ! * @param app Application API. ! */ ! public void initialize(IApplication app) ! { ! _props = _app.getSquirrelPreferences().getSessionProperties(); ! _myPanel.loadData(_props); ! } ! public void initialize(IApplication app, ISession session) ! throws IllegalArgumentException ! { ! if (session == null) ! { ! throw new IllegalArgumentException("Null ISession passed"); ! } ! _props = session.getProperties(); ! _myPanel.loadData(_props); ! } ! public Component getPanelComponent() ! { ! return _myPanel; ! } ! public String getTitle() ! { ! return ObjectTreepropsPanel.i18n.OBJECT_TREE; ! } ! public String getHint() ! { ! return ObjectTreepropsPanel.i18n.OBJECT_TREE; ! } ! public void applyChanges() ! { ! _myPanel.applyChanges(_props); ! } ! private static final class ObjectTreepropsPanel extends JPanel ! { ! /** ! * This interface defines locale specific strings. This should be ! * replaced with a property file. ! */ ! interface i18n ! { ! // i18n[sessionPropertiesPanel.catalogPrefix=Limit Catalog Objects using these comma-delimited prefixes:] ! String CATALOG_PREFIX = s_stringMgr.getString("sessionPropertiesPanel.catalogPrefix"); ! // i18n[sessionPropertiesPanel.limitRowsContents=Contents - Limit rows] ! String LIMIT_ROWS_CONTENTS = s_stringMgr.getString("sessionPropertiesPanel.limitRowsContents"); ! // i18n[sessionPropertiesPanel.schemaPrefix=Limit Schema Objects using these comma-delimited prefixes:] ! String SCHEMA_PREFIX = s_stringMgr.getString("sessionPropertiesPanel.schemaPrefix"); ! // i18n[sessionPropertiesPanel.showRowCount=Show Row Count for Tables (can slow application)] ! String SHOW_ROW_COUNT = s_stringMgr.getString("sessionPropertiesPanel.showRowCount"); ! // i18n[sessionPropertiesPanel.objectTree=Object Tree] ! String OBJECT_TREE = s_stringMgr.getString("sessionPropertiesPanel.objectTree"); ! } ! private IntegerField _contentsNbrRowsToShowField = new IntegerField(5); ! private JCheckBox _contentsLimitRowsChk = new JCheckBox(i18n.LIMIT_ROWS_CONTENTS); ! private JCheckBox _showRowCountChk = new JCheckBox(i18n.SHOW_ROW_COUNT); ! private JTextField _schemaPrefixField = new JTextField(20); ! private JTextField _catalogPrefixField = new JTextField(20); ! private JTextField _objectFilterField = new JTextField(20); ! // i18n[sessionPropertiesPanel.loadSchemasCatalogs=Load Schemas/Catalogs into object tree] ! private JCheckBox _loadSchemasCatalogsChk = new JCheckBox(s_stringMgr.getString("sessionPropertiesPanel.loadSchemasCatalogs")); ! /** ! * This object will update the status of the GUI controls as the user ! * makes changes. ! */ ! private final ControlMediator _controlMediator = new ControlMediator(); ! ObjectTreepropsPanel(IApplication app) ! { ! super(); ! createGUI(); ! } ! void loadData(SessionProperties props) ! { ! _contentsNbrRowsToShowField.setInt(props.getContentsNbrRowsToShow()); ! _contentsLimitRowsChk.setSelected(props.getContentsLimitRows()); ! _showRowCountChk.setSelected(props.getShowRowCount()); ! _schemaPrefixField.setText(props.getSchemaPrefixList()); ! _catalogPrefixField.setText(props.getCatalogPrefixList()); ! if (props.getObjectFilter() != null) ! _objectFilterField.setText(props.getObjectFilter()); ! _loadSchemasCatalogsChk.setSelected(props.getLoadSchemasCatalogs()); ! updateControlStatus(); ! } ! void applyChanges(SessionProperties props) ! { ! props.setContentsNbrRowsToShow(_contentsNbrRowsToShowField.getInt()); ! props.setContentsLimitRows(_contentsLimitRowsChk.isSelected()); ! props.setShowRowCount(_showRowCountChk.isSelected()); ! props.setSchemaPrefixList(_schemaPrefixField.getText()); ! props.setCatalogPrefixList(_catalogPrefixField.getText()); ! props.setObjectFilter(_objectFilterField.getText()); ! props.setLoadSchemasCatalogs(_loadSchemasCatalogsChk.isSelected()); ! } ! private void updateControlStatus() ! { ! _contentsNbrRowsToShowField.setEnabled(_contentsLimitRowsChk.isSelected()); ! } ! private void createGUI() ! { ! setLayout(new GridBagLayout()); ! final GridBagConstraints gbc = new GridBagConstraints(); ! gbc.anchor = GridBagConstraints.WEST; ! gbc.fill = GridBagConstraints.HORIZONTAL; ! gbc.insets = new Insets(4, 4, 4, 4); ! gbc.gridx = 0; ! gbc.gridy = 0; ! add(createObjectTreePanel(), gbc); ! ++gbc.gridy; ! add(createFilterPanel(), gbc); ! } ! private JPanel createObjectTreePanel() ! { ! final JPanel pnl = new JPanel(new GridBagLayout()); ! pnl.setBorder(BorderFactory.createTitledBorder(i18n.OBJECT_TREE)); ! final GridBagConstraints gbc = new GridBagConstraints(); ! gbc.fill = GridBagConstraints.HORIZONTAL; ! gbc.insets = new Insets(4, 4, 4, 4); ! gbc.anchor = GridBagConstraints.CENTER; ! _contentsLimitRowsChk.addChangeListener(_controlMediator); ! _contentsNbrRowsToShowField.setColumns(5); ! gbc.gridwidth = GridBagConstraints.REMAINDER; ! gbc.gridx = 0; ! gbc.gridy = 0; ! pnl.add(_loadSchemasCatalogsChk, gbc); ! ++gbc.gridy; // new line ! gbc.gridx = 0; ! pnl.add(_showRowCountChk, gbc); ! ++gbc.gridy; // new line ! gbc.gridx = 0; ! gbc.gridwidth = 2; ! pnl.add(_contentsLimitRowsChk, gbc); ! gbc.gridwidth = 1; ! gbc.gridx+=2; ! pnl.add(_contentsNbrRowsToShowField, gbc); ! ++gbc.gridx; ! gbc.gridwidth = GridBagConstraints.REMAINDER; ! // i18n[generalPropertiesPanel.rows=rows] ! pnl.add(new JLabel(s_stringMgr.getString("generalPropertiesPanel.rows")), gbc); ! return pnl; ! } ! private JPanel createFilterPanel() ! { ! final JPanel pnl = new JPanel(new GridBagLayout()); ! // i18n[sessionObjectTreePropetiesPanel.filters=Filters] ! pnl.setBorder(BorderFactory.createTitledBorder(s_stringMgr.getString("sessionObjectTreePropetiesPanel.filters"))); ! final GridBagConstraints gbc = new GridBagConstraints(); ! gbc.fill = GridBagConstraints.HORIZONTAL; ! gbc.anchor = GridBagConstraints.WEST; ! gbc.insets = new Insets(4, 4, 4, 4); ! gbc.weightx = 1.0; ! gbc.gridx = 0; ! gbc.gridy = 0; ! pnl.add(new JLabel(i18n.SCHEMA_PREFIX, SwingConstants.RIGHT), gbc); ! ++gbc.gridy; ! pnl.add(_schemaPrefixField, gbc); ! ++gbc.gridy; ! pnl.add(new JLabel(i18n.CATALOG_PREFIX, SwingConstants.RIGHT), gbc); ! ++gbc.gridy; ! pnl.add(_catalogPrefixField, gbc); ! ++gbc.gridy; ! // i18n[sessionPropertiesPanel.objectFilterMeans=Object Filter:\n"%" means match any substring of 0 or more characters\n"_" means match any one character] ! pnl.add(new MultipleLineLabel(s_stringMgr.getString("sessionPropertiesPanel.objectFilterMeans")), gbc); ! ++gbc.gridy; ! pnl.add(_objectFilterField, gbc); ! ! return pnl; ! } ! ! /** ! * This class will update the status of the GUI controls as the user ! * makes changes. ! */ ! private final class ControlMediator implements ChangeListener, ! ActionListener ! { ! public void stateChanged(ChangeEvent evt) ! { ! updateControlStatus(); ! } ! ! public void actionPerformed(ActionEvent evt) ! { ! updateControlStatus(); ! } ! } ! } } Index: EditWhereColsPanel.java =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/EditWhereColsPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EditWhereColsPanel.java 23 Apr 2004 18:33:55 -0000 1.2 --- EditWhereColsPanel.java 25 Jan 2006 21:36:49 -0000 1.3 *************** *** 18,21 **** --- 18,24 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + import net.sourceforge.squirrel_sql.fw.util.StringManager; + import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory; + import java.awt.Dimension; import java.awt.BorderLayout; *************** *** 43,46 **** --- 46,53 ---- public class EditWhereColsPanel extends JPanel { + private static final StringManager s_stringMgr = + StringManagerFactory.getStringManager(EditWhereColsPanel.class); + + /** The name of the database table the Where clause applies to. */ private String _tableName; *************** *** 68,73 **** */ interface EditWhereColsPanelI18N { ! String TITLE = "Limit Columns in Cell Edit"; ! String HINT = "Limit columns used in WHERE clause when editing table "; } --- 75,82 ---- */ interface EditWhereColsPanelI18N { ! // i18n[editWhereColsPanel.limitColsInCell=Limit Columns in Cell Edit] ! String TITLE = s_stringMgr.getString("editWhereColsPanel.limitColsInCell"); ! // i18n[editWhereColsPanel.limitColsInCellHint=Limit columns used in WHERE clause when editing table] ! String HINT = s_stringMgr.getString("editWhereColsPanel.limitColsInCellHint"); } *************** *** 171,175 **** if (useColsModel.getSize() == 0) { JOptionPane.showMessageDialog(this, ! "You cannot remove all of the fields from the 'use columns' list."); return false; } --- 180,185 ---- if (useColsModel.getSize() == 0) { JOptionPane.showMessageDialog(this, ! // i18n[editWhereColsPanel.cannotRemoveAllCols=You cannot remove all of the fields from the 'use columns' list.] ! s_stringMgr.getString("editWhereColsPanel.cannotRemoveAllCols")); return false; } *************** *** 254,258 **** JPanel useColsPanel = new JPanel(new BorderLayout()); ! useColsPanel.add(new JLabel("Use Columns"), BorderLayout.NORTH); useColsList = new JList(initalUseColsArray); JScrollPane scrollPane = new JScrollPane(useColsList); --- 264,269 ---- JPanel useColsPanel = new JPanel(new BorderLayout()); ! // i18n[editWhereColsPanel.useColumns=Use Columns] ! useColsPanel.add(new JLabel(s_stringMgr.getString("editWhereColsPanel.useColumns")), BorderLayout.NORTH); useColsList = new JList(initalUseColsArray); JScrollPane scrollPane = new JScrollPane(useColsList); *************** *** 287,291 **** JPanel notUseColsPanel = new JPanel(new BorderLayout()); ! notUseColsPanel.add(new JLabel("Not Use Columns"), BorderLayout.NORTH); notUseColsList = new JList(initalNotUseColsArray); JScrollPane notUseScrollPane = new JScrollPane(notUseColsList); --- 298,303 ---- JPanel notUseColsPanel = new JPanel(new BorderLayout()); ! // i18n[editWhereColsPanel.notUseColumns=Not Use Columns] ! notUseColsPanel.add(new JLabel(s_stringMgr.getString("editWhereColsPanel.notUseColumns")), BorderLayout.NORTH); notUseColsList = new JList(initalNotUseColsArray); JScrollPane notUseScrollPane = new JScrollPane(notUseColsList); *************** *** 294,296 **** add(notUseColsPanel); } ! } \ No newline at end of file --- 306,308 ---- add(notUseColsPanel); } ! } Index: I18NStrings.properties =================================================================== RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/I18NStrings.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** I18NStrings.properties 9 Oct 2005 11:09:25 -0000 1.4 --- I18NStrings.properties 25 Jan 2006 21:36:49 -0000 1.5 *************** *** 17,19 **** SessionSQLPropertiesPanel.tabs=tabs SessionSQLPropertiesPanel.loadColumsInBackground=Load columns in background ! SessionSQLPropertiesPanel.loadColsInBackgroundDescription=Loading columns in background might help users with databases that contain a lot of objects and/or users that work with low data transfer rates. Syntax highlightning and code completion may work less exact if this option is checked. It is recommended to use this option only if you feel that the SQL editor hangs. \ No newline at end of file --- 17,69 ---- SessionSQLPropertiesPanel.tabs=tabs SessionSQLPropertiesPanel.loadColumsInBackground=Load columns in background ! SessionSQLPropertiesPanel.loadColsInBackgroundDescription=Loading columns in background might help users with databases that contain a lot of objects and/or users that work with low data transfer rates. Syntax highlightning and code completion may work less exact if this option is checked. It is recommended to use this option only if you feel that the SQL editor hangs. ! # ! #Missing/changed properties generated by I18n Plugin on Wed Jan 25 22:27:53 CET 2006 ! # ! editWherColsSheet.close=Close ! editWherColsSheet.ok=OK ! editWherColsSheet.output=Output ! editWherColsSheet.reset=Reset ! editWhereColsPanel.cannotRemoveAllCols=You cannot remove all of the fields from the 'use columns' list. ! editWhereColsPanel.limitColsInCell=Limit Columns in Cell Edit ! editWhereColsPanel.limitColsInCellHint=Limit columns used in WHERE clause when editing table ! editWhereColsPanel.notUseColumns=Not Use Columns ! editWhereColsPanel.useColumns=Use Columns ! editWhereColsSheet.editWhereColumns=Edit 'WHERE' columns ! editWhereColsSheet.limitSizeOfWhereClause=Limit the size of the WHERE clause used behind the scenes when editing cell contents. ! editWhereColsSheet.shouldIncludePKs=The 'use' window should include at least the primary keys for the table. ! editWhereColsSheet.unableToEdit=Unable to get list of columns, {0} ! generalPropertiesPanel.bottom=Bottom ! generalPropertiesPanel.left=Left ! generalPropertiesPanel.right=Right ! generalPropertiesPanel.rows=rows ! generalPropertiesPanel.top=Top ! generalSessionPropertiesPanel.appearance=Appearance ! generalSessionPropertiesPanel.dataTYpe1=Properties for the individual Data Types may be set in the ! generalSessionPropertiesPanel.dataTYpe2='General Preferences' window under the 'Data Type Controls' tab. ! generalSessionPropertiesPanel.editableTable=Editable Table ! generalSessionPropertiesPanel.generalSettings=General settings for the current session ! generalSessionPropertiesPanel.mainTabs=Main Tabs: ! generalSessionPropertiesPanel.metaData=Meta Data: ! generalSessionPropertiesPanel.objectTabs=Object Tabs: ! generalSessionPropertiesPanel.showToolbar=Show toolbar ! generalSessionPropertiesPanel.sqlExecTabs=SQL Execution Tabs: ! generalSessionPropertiesPanel.sqlResultTabs=SQL Results Tabs: ! generalSessionPropertiesPanel.sqlResults=SQL Results: ! generalSessionPropertiesPanel.tableContents=Table Contents: ! generalSessionPropertiesPanel.text=Text ! sessionObjectTreePropetiesPanel.filters=Filters ! sessionPropertiesPanel.catalogPrefix=Limit Catalog Objects using these comma-delimited prefixes: ! sessionPropertiesPanel.limitRowsContents=Contents - Limit rows ! sessionPropertiesPanel.loadSchemasCatalogs=Load Schemas/Catalogs into object tree ! sessionPropertiesPanel.objectTree=Object Tree ! sessionPropertiesPanel.schemaPrefix=Limit Schema Objects using these comma-delimited prefixes: ! sessionPropertiesPanel.showRowCount=Show Row Count for Tables (can slow application) ! sessionPropertiesSheet.close=Close ! sessionPropertiesSheet.ok=OK ! sessionPropertiesSheet.sessionProperties=- Session Properties ! ! sessionPropertiesPanel.objectFilterMeans=Object Filter:\n"%" means match any substring of 0 or more characters\n"_" means match any one character ! generalSessionPropertiesPanel.general=General ! ! generalSessionPropertiesPanel.table=Table |