[Isql-devevelopment] SF.net SVN: isql: [71] isql-swing/branches/3.0.0-maintenance/src/org/ isqlview
Brought to you by:
mkobold
|
From: <mk...@us...> - 2007-06-07 02:00:25
|
Revision: 71
http://svn.sourceforge.net/isql/?rev=71&view=rev
Author: mkobold
Date: 2007-06-06 19:00:25 -0700 (Wed, 06 Jun 2007)
Log Message:
-----------
* ui/JdbcWorkbench.java
** Corrected an issue where the schema view would be visible on
application startup when it should not be.
** Addressed bug #1732394 about storing big queries into the
preferences sub-system. It is now trimed to the maximum size
allowed by the preferences implementation.
** Added component validation code for JRE 1.5 so that when
bookmarks, schema, or history or open the are visible.
** Modified usage with TabbedResultSet renderer instances, to a
variable substitution problem.
* ui/TabbedResultsetRenderer.java
** Removed clear call so that variable substituions that are
repeated in the same query or in batch queries the user is not
prompted to substitute values they have already substituted.
* ui/wizards/service
** Corrected some missing resource strings
** Updated and corrected the confirm delete service pages
Modified Paths:
--------------
isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/JdbcWorkbench.java
isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/TabbedResultsetRenderer.java
isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmDeleteService.java
isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmNewService.java
isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ResourceBundle.properties
Modified: isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/JdbcWorkbench.java
===================================================================
--- isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/JdbcWorkbench.java 2007-06-03 16:44:33 UTC (rev 70)
+++ isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/JdbcWorkbench.java 2007-06-07 02:00:25 UTC (rev 71)
@@ -172,7 +172,6 @@
private ButtonGroup schemaSelection = new ButtonGroup();
private JdbcService currentService = null;
- private TabbedResultsetRenderer tabRenderer;
private EnhancedTabbedPane rhsTabbedPane = new EnhancedTabbedPane(EnhancedTabbedPane.TOP);
private EnhancedTabbedPane lhsTabbedPane = new EnhancedTabbedPane(EnhancedTabbedPane.TOP);
@@ -281,7 +280,8 @@
String statement = event.getActionCommand();
boolean connected = checkConnection();
if (connected) {
- QueryExecutor executor = new QueryExecutor(currentService, tabRenderer, statement);
+ TabbedResultsetRenderer renderer = new TabbedResultsetRenderer(centerTabbedPane);
+ QueryExecutor executor = new QueryExecutor(currentService, renderer, statement);
executor.run();
}
break;
@@ -307,7 +307,6 @@
public void doLayout(JComponent parentComponent, Preferences userPreferences, SwingEventManager swingEventManager) {
preferences = userPreferences.node("views/jdbc-workbench");
- tabRenderer = new TabbedResultsetRenderer(centerTabbedPane);
this.eventManager = swingEventManager;
this.eventManager.addActionListener(this);
@@ -465,7 +464,9 @@
clientProperty = (Boolean) bookmarkView.getClientProperty(BOOKMARK_VISIBLE);
preferences.putBoolean(BOOKMARK_VISIBLE, clientProperty.booleanValue());
- preferences.put(SESSION_TEXT, commandEditor.getText());
+ String queryText = commandEditor.getText();
+ queryText = StringUtilities.trimToSize(queryText, Preferences.MAX_VALUE_LENGTH);
+ preferences.put(SESSION_TEXT, queryText);
unlocalizeTextComponent(console, undoManager);
}
@@ -932,6 +933,7 @@
action.putValue(CustomAction.ICON_NAME, "information");
addButton(toolbar, manager, action);
+ TabbedResultsetRenderer tabRenderer = new TabbedResultsetRenderer(centerTabbedPane);
SchemaTreeListener listener = new SchemaTreeListener(schemaModel, tabRenderer, manager);
schemaModel.setTablesEnabled(true);
schemaView.setCellRenderer(new JDBCTreeCellRenderer());
@@ -1070,7 +1072,7 @@
if (preferences.getBoolean(SCHEMA_VISIBLE, false)) {
action.actionPerformed(new ActionEvent(this, 0, ""));
} else {
- schemaView.putClientProperty(SCHEMA_VISIBLE, Boolean.TRUE);
+ schemaView.putClientProperty(SCHEMA_VISIBLE, Boolean.FALSE);
}
addMenuItem(viewMenu, action);
@@ -1300,6 +1302,7 @@
}
break;
}
+
return component;
}
@@ -1516,10 +1519,9 @@
private void closeSelectedResult() {
- EnhancedTabbedPane tabbedPane = tabRenderer.getTabbedPane();
int index = centerTabbedPane.getSelectedIndex();
if (index >= 0) {
- tabbedPane.remove(index);
+ centerTabbedPane.remove(index);
}
}
@@ -1583,11 +1585,11 @@
model.addRow(row);
}
dataGrid.setModel(model);
- EnhancedTabbedPane tabbedPane = tabRenderer.getTabbedPane();
- tabbedPane.addTab(messages.format("JdbcWorkbench.database_metadata"), view);
- index = tabbedPane.indexOfComponent(view);
- tabbedPane.setClosableTab(index, true);
- tabbedPane.setIconAt(index, SwingUtilities.loadIconResource("information", 16));
+
+ centerTabbedPane.addTab(messages.format("JdbcWorkbench.database_metadata"), view);
+ index = centerTabbedPane.indexOfComponent(view);
+ centerTabbedPane.setClosableTab(index, true);
+ centerTabbedPane.setIconAt(index, SwingUtilities.loadIconResource("information", 16));
}
private boolean checkConnection() {
@@ -1642,6 +1644,13 @@
public void actionPerformed(ActionEvent e) {
viewComponent = workbench.toggleView(view, viewComponent);
+ String jre = System.getProperty("java.specification.version");
+ if (viewComponent != null && "1.5".equals(jre)) {
+ Window windowOwner = javax.swing.SwingUtilities.getWindowAncestor(viewComponent);
+ if (windowOwner != null) {
+ windowOwner.validate();
+ }
+ }
}
}
}
Modified: isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/TabbedResultsetRenderer.java
===================================================================
--- isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/TabbedResultsetRenderer.java 2007-06-03 16:44:33 UTC (rev 70)
+++ isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/TabbedResultsetRenderer.java 2007-06-07 02:00:25 UTC (rev 71)
@@ -91,7 +91,6 @@
synchronized (isCancelled) {
isCancelled.set(false);
}
- currentSubstitutions.clear();
JPanel componentView = new JPanel();
eyeCandy = new BusyQueryIndicator(isCancelled);
eyeCandy.doLayout(componentView, null, null);
Modified: isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmDeleteService.java
===================================================================
--- isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmDeleteService.java 2007-06-03 16:44:33 UTC (rev 70)
+++ isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmDeleteService.java 2007-06-07 02:00:25 UTC (rev 71)
@@ -33,12 +33,11 @@
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
-import javax.swing.JSeparator;
import javax.swing.JTextField;
-import javax.swing.SwingConstants;
import javax.swing.text.Document;
import org.isqlviewer.ServiceReference;
+import org.isqlviewer.sql.JdbcService;
import org.isqlviewer.sql.embedded.EmbeddedDatabase;
import org.isqlviewer.swing.SwingUtilities;
import org.isqlviewer.swing.action.SharedActions;
@@ -55,6 +54,8 @@
private Document nameDocument = null;
private Document urlDocument = null;
private Document classDocument = null;
+ private Document jdbcDriverDocument = null;
+ private Document jdbcURLDocument = null;
public boolean isFirst() {
@@ -92,10 +93,15 @@
public void activate(WizardContext context) {
ServiceReference service = (ServiceReference) context.getAttribute(ServiceWizard.ATTRIBUTE_SERVICE_REFERENCE);
+ JdbcService jdbcService = (JdbcService) context.getAttribute(ServiceWizard.ATTRIBUTE_SERVICE);
if (service != null) {
SwingUtilities.replaceDocumentContent(nameDocument, service.getName());
SwingUtilities.replaceDocumentContent(urlDocument, service.getCreatedOn().toString());
SwingUtilities.replaceDocumentContent(classDocument, service.getResourceURL().toExternalForm());
+ if (jdbcService != null) {
+ SwingUtilities.replaceDocumentContent(jdbcURLDocument, jdbcService.getUrl());
+ SwingUtilities.replaceDocumentContent(jdbcDriverDocument, jdbcService.getDriverClass());
+ }
}
}
@@ -104,7 +110,7 @@
setTitle(messages.getMessage("ConfirmDeleteService.title"));
setComment(messages.getMessage("ConfirmDeleteService.comment"));
- setImage(SwingUtilities.loadIconResource(ServiceWizard.class, "ok", 22));
+ setImage(SwingUtilities.loadIconResource(ServiceWizard.class, "db_delete", 22));
JPanel panel = new JPanel(new GridBagLayout());
setView(panel);
@@ -130,8 +136,8 @@
GridBagConstraints.HORIZONTAL);
panel.add(component, constraint);
- title = messages.format("newservicewizard.jdbcdriver.title");
- tip = messages.format("newservicewizard.jdbcdriver.tip");
+ title = messages.format("ConfirmDeleteService.service-file.title");
+ tip = messages.format("ConfirmDeleteService.service-file.tip");
component = new JTextField(32);
component.setToolTipText(tip);
component.setFont(component.getFont().deriveFont(Font.BOLD));
@@ -145,8 +151,8 @@
GridBagConstraints.HORIZONTAL);
panel.add(component, constraint);
- title = messages.format("newservicewizard.jdbcurl.title");
- tip = messages.format("newservicewizard.jdbcurl.tip");
+ title = messages.format("ConfirmDeleteService.created-on.title");
+ tip = messages.format("ConfirmDeleteService.created-on.tip");
component = new JTextField(32);
component.setToolTipText(tip);
component.setFont(component.getFont().deriveFont(Font.BOLD));
@@ -160,18 +166,38 @@
GridBagConstraints.HORIZONTAL);
panel.add(component, constraint);
- constraint = ServiceWizard.constrain(0, 3, 2, 1, 1.0d, 0.0d, GridBagConstraints.CENTER,
+ title = messages.format("ConfirmDeleteService.driver-class.title");
+ tip = messages.format("ConfirmDeleteService.driver-class.tip");
+ component = new JTextField(32);
+ component.setToolTipText(tip);
+ component.setFont(component.getFont().deriveFont(Font.BOLD));
+ ((JTextField) component).setEditable(false);
+ jdbcDriverDocument = ((JTextField) component).getDocument();
+ constraint = ServiceWizard.constrain(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE);
+ label = new JLabel(title);
+ label.setLabelFor(component);
+ panel.add(label, constraint);
+ constraint = ServiceWizard.constrain(1, 3, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
GridBagConstraints.HORIZONTAL);
- panel.add(new JSeparator(SwingConstants.HORIZONTAL), constraint);
- panel.add(Box.createVerticalStrut(32), constraint);
+ panel.add(component, constraint);
- title = messages.format("newservicewizard.compatability_info");
- component = new JLabel(title);
- constraint = ServiceWizard.constrain(0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE);
+ title = messages.format("ConfirmDeleteService.jdbc-url.title");
+ tip = messages.format("ConfirmDeleteService.jdbc-url.tip");
+ component = new JTextField(32);
+ component.setToolTipText(tip);
+ component.setFont(component.getFont().deriveFont(Font.BOLD));
+ ((JTextField) component).setEditable(false);
+ jdbcURLDocument = ((JTextField) component).getDocument();
+ constraint = ServiceWizard.constrain(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE);
+ label = new JLabel(title);
+ label.setLabelFor(component);
+ panel.add(label, constraint);
+ constraint = ServiceWizard.constrain(1, 4, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
+ GridBagConstraints.HORIZONTAL);
panel.add(component, constraint);
component = (JComponent) Box.createVerticalGlue();
- constraint = ServiceWizard.constrain(0, 7, 2, 1, 0.0, 1.0, GridBagConstraints.CENTER,
+ constraint = ServiceWizard.constrain(0, 5, 2, 1, 0.0, 1.0, GridBagConstraints.CENTER,
GridBagConstraints.VERTICAL);
panel.add(component, constraint);
}
Modified: isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmNewService.java
===================================================================
--- isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmNewService.java 2007-06-03 16:44:33 UTC (rev 70)
+++ isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ConfirmNewService.java 2007-06-07 02:00:25 UTC (rev 71)
@@ -141,7 +141,7 @@
setTitle(messages.getMessage("newservicewizard.finalize-service.title"));
setComment(messages.getMessage("newservicewizard.finalize-service.tip"));
- setImage(SwingUtilities.loadIconResource(ServiceWizard.class, "ok", 22));
+ setImage(SwingUtilities.loadIconResource(ServiceWizard.class, "db_insert", 22));
JPanel panel = new JPanel(new GridBagLayout());
setView(panel);
Modified: isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ResourceBundle.properties
===================================================================
--- isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ResourceBundle.properties 2007-06-03 16:44:33 UTC (rev 70)
+++ isql-swing/branches/3.0.0-maintenance/src/org/isqlviewer/ui/wizards/service/ResourceBundle.properties 2007-06-07 02:00:25 UTC (rev 71)
@@ -45,6 +45,8 @@
newservicewizard.compatability.tip=Save this service in format that is compatible with previous versions of iSQL-Viewer.
newservicewizard.connect_on_finish=Connect to this Service
newservicewizard.connect_on_finish.tip=Connect to this new service after this wizard is complete.
+newservicewizard.add-resources.tip=Click here to add a new service resource (JAR, Zip, Directory).
+newservicewizard.delete-resources.tip=Click here to remove the selected resource from this service.
SelectServiceStep.title=Select Service
SelectServiceStep.comment=Select an existing iSQL-Viewer service.
@@ -60,6 +62,16 @@
ConfirmUpdateService.failed_to_remove_old_service_file=Failed to remove existing service file:''{0}''; this file will need to be removed manually.
ConfirmDeleteService.internal_sql_error=Failed to remove service:''{0}'' due to an internal error.
+ConfirmDeleteService.title=Confirm Service Deletion
+ConfirmDeleteService.comment=Confirm permanent service deletion.
+ConfirmDeleteService.service-file.title=Service File
+ConfirmDeleteService.service-file.tip=This file will be removed from the local file-system.
+ConfirmDeleteService.created-on.title=Created On
+ConfirmDeleteService.created-on.tip=Date when this service was originally added to iSQL-Viewer.
+ConfirmDeleteService.driver-class.title=Driver Class
+ConfirmDeleteService.driver-class.tip=Fully qualified Java class name for the driver of this service.
+ConfirmDeleteService.jdbc-url.title=JDBC URL
+ConfirmDeleteService.jdbc-url.tip=The JDBC URL used to connect this service to the database.
SelectServiceFunctionStep.title=Select service function
SelectServiceFunctionStep.comment=Choose from one of the following actions you wish to perform.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|