Revision: 6049
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6049&view=rev
Author: manningr
Date: 2010-12-24 00:14:54 +0000 (Fri, 24 Dec 2010)
Log Message:
-----------
Merged code changes from multiple bug-fix revision sets (6008-6013, 6017-6022, 6026-6039). This branch was copied from revision 6007 as this was the latest revision that didn't contain any new *experimental* features (for example, object tree icons)
Revision Links:
--------------
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6007&view=rev
Modified Paths:
--------------
branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ProgressCallBackDialog.java
branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/update/UpdateUtilImpl.java
branches/squirrel-3_2_1-branch/doc/pom.xml
branches/squirrel-3_2_1-branch/doc/src/main/resources/changes.txt
branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/main/resources/izpack-mac.xml
branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/test/resources/auto-install.xml
branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/main/resources/izpack-other.xml
branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/test/resources/optional-auto-install.xml
branches/squirrel-3_2_1-branch/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java
branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsController.java
branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsPanel.java
branches/squirrel-3_2_1-branch/plugins/i18n/src/main/resources/net/sourceforge/squirrel_sql/plugins/i18n/I18NStrings.properties
branches/squirrel-3_2_1-branch/plugins/laf/pom.xml
branches/squirrel-3_2_1-branch/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/prefs/OraclePluginPreferencesPanel.java
branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-assembly-descriptor/pom.xml
branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-parent-pom/pom.xml
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrectController.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrector.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/ConfigureAutoCorrectAction.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SQLEntryPanelFactoryProxy.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/ToolsPopupHandler.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/NetbeansSQLEditorPane.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/NetbeansSQLEntryAreaFactory.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/NetbeansSQLEntryPanel.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/SQLSettingsDefaults.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/SQLSettingsInitializer.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/SquirrelNBDialogFactory.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/oster/OsterSQLEntryAreaFactory.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/rsyntax/RSyntaxSQLEntryAreaFactory.java
branches/squirrel-3_2_1-branch/plugins/syntax/src/test/java/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPluginTest.java
branches/squirrel-3_2_1-branch/pom.xml
branches/squirrel-3_2_1-branch/squirrelsql-translations/src/main/resources/squirrel-sql_it_IT.jar
Added Paths:
-----------
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPlugin.java
Removed Paths:
-------------
branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPugin.java
Property Changed:
----------------
branches/squirrel-3_2_1-branch/
Property changes on: branches/squirrel-3_2_1-branch
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/sql12:6009-6013,6018-6022,6027-6040
Modified: branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ProgressCallBackDialog.java
===================================================================
--- branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ProgressCallBackDialog.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/gui/ProgressCallBackDialog.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -192,10 +192,18 @@
@Override
public void run()
{
- ProgressCallBackDialog.this.dispose();
+ callDisposeFromSuperClass();
}
});
}
+
+ /**
+ * Since {@link #dispose()} uses an {@link Runnable}, we needs an
+ * delegate to call the overridden dispose method.
+ */
+ private void callDisposeFromSuperClass(){
+ super.dispose();
+ }
/**
* @see java.awt.Dialog#setVisible(boolean)
@@ -208,10 +216,19 @@
@Override
public void run()
{
- ProgressCallBackDialog.this.setVisible(b);
+ callSetVisibleFromSuperClass(b);
}
});
}
+
+ /**
+ * Since {@link #setVisible(boolean)} uses an {@link Runnable}, we needs an
+ * delegate to call the overridden setVisible method.
+ */
+ private void callSetVisibleFromSuperClass(final boolean b){
+ super.setVisible(b);
+ }
+
private void init(int totalItems)
{
Modified: branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/update/UpdateUtilImpl.java
===================================================================
--- branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/update/UpdateUtilImpl.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/app/src/main/java/net/sourceforge/squirrel_sql/client/update/UpdateUtilImpl.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -672,7 +672,7 @@
for (PluginInfo info : _pluginManager.getPluginInformation())
{
- result.add(info.getInternalName() + ".zip");
+ result.add(info.getInternalName() + "-assembly.zip");
}
return result;
}
Modified: branches/squirrel-3_2_1-branch/doc/pom.xml
===================================================================
--- branches/squirrel-3_2_1-branch/doc/pom.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/doc/pom.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -58,10 +58,35 @@
<resources>
<resource>
<directory>src/main/resources</directory>
+ <excludes>
+ <exclude>changes.txt</exclude>
+ </excludes>
+ <filtering>false</filtering>
</resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>changes.txt</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
</resources>
<plugins>
+ <!-- Set the squirrelsql.changelog.header if it has not already been set. -->
<plugin>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrelsql-version-plugin</artifactId>
+ <version>${squirrelsql-version-plugin-version}</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <goals>
+ <goal>set-version</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
@@ -72,5 +97,4 @@
</plugin>
</plugins>
</build>
-
-</project>
\ No newline at end of file
+</project>
Modified: branches/squirrel-3_2_1-branch/doc/src/main/resources/changes.txt
===================================================================
--- branches/squirrel-3_2_1-branch/doc/src/main/resources/changes.txt 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/doc/src/main/resources/changes.txt 2010-12-24 00:14:54 UTC (rev 6049)
@@ -2,28 +2,41 @@
==============================
-Not yet released - available from SVN or in the latest snapshot:
-----------------------------------------------------------------
+${squirrelsql.changelog.header}
Enhancements:
+Feature request 3030479: New global preference that allows scrollable tabbed pane for Session tabs.
+Feature request 1608435: (checkbox in I18N administration: "show only bundles with missing translations").
+ Thanks to Ivo Neri for the patch.
+
+New icons in Object tree
+
+Updated translation for Italian (Thanks to Ivo Neri)
+
New translation
- Japanese (thanks to Toshiki IGA)
+ Japanese (Thanks to Toshiki IGA)
-Feature request 3030479: New global preference that allows scrollable tabbed pane for Session tabs.
-
Graph Plugin: Multiple tables can now be selected and moved simultanously
Thanks to Markus Schulz for the patch.
New Session property to let SQuirreL set fetch size (call Statement.setFetchSize(int)).
See Session properties --> SQL tab.
- Thanks to Stefan (wis775) for the patch
+ Thanks to Stefan (wis775) for the patch.
Bug-fixes:
-Bug 3055859: Regular expressions did not work in find & replace dialog
+3138746: Typo within PluginClassName of SyntaxPlugin.
+3137390: Cannot connect after latest software update.
+3136386: Deleting table content via context menu does not work.
+3123014: StackOverflow ProgressCallBackDialog.
+ Thanks to Stefan (wis775) for the patch.
+3055859: Regular expressions did not work in find & replace dialog.
+ Thanks to Stefan (wis775) for the patch.
+Fixed translation label that was not being applied to "Initialize Session Timezone" checkbox.
+ Thanks to Ivo Neri for the patch.
3.2.0 (11/21/2010)
==================
Modified: branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/main/resources/izpack-mac.xml
===================================================================
--- branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/main/resources/izpack-mac.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/main/resources/izpack-mac.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -433,6 +433,15 @@
required="no"
preselected="no"
installGroups="Translations"
+ name="Optional Translation - Japanese">
+ <description>Provides native labels and user messages for use in a Japanese locale (Toshiki IGA)
+ </description>
+ <file targetdir="$INSTALL_PATH/Contents/Resources/Java/lib" src="translations/squirrel-sql_ja_JP.jar" />
+ </pack>
+ <pack
+ required="no"
+ preselected="no"
+ installGroups="Translations"
name="Optional Translation - Korean">
<description>Provides native labels and user messages for use in a Korean locale (Youngwoo)
</description>
Modified: branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/test/resources/auto-install.xml
===================================================================
--- branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/test/resources/auto-install.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/installer/squirrelsql-macosx-installer/src/test/resources/auto-install.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -14,33 +14,35 @@
<pack index="5" name="Optional Plugin - DB2" selected="true"/>
<pack index="6" name="Optional Plugin - Derby" selected="true"/>
<pack index="7" name="Optional Plugin - Firebird " selected="true"/>
-<pack index="8" name="Optional Plugin - Hibernate" selected="true"/>
-<pack index="9" name="Optional Plugin - H2 " selected="true"/>
-<pack index="10" name="Optional Plugin - Informix " selected="true"/>
-<pack index="11" name="Optional Plugin - Microsoft SQL Server " selected="true"/>
-<pack index="12" name="Optional Plugin - MySQL " selected="true"/>
-<pack index="13" name="Optional Plugin - Netezza " selected="true"/>
-<pack index="14" name="Optional Plugin - Oracle" selected="true"/>
-<pack index="15" name="Optional Plugin - PostgreSQL " selected="true"/>
-<pack index="16" name="Optional Plugin - Refactoring" selected="true"/>
-<pack index="17" name="Optional Plugin - Session Scripts" selected="true"/>
-<pack index="18" name="Optional Plugin - Smart Tools " selected="true"/>
-<pack index="19" name="Optional Plugin - SQL Parametrisation " selected="true"/>
-<pack index="20" name="Optional Plugin - SQL Replace " selected="true"/>
-<pack index="21" name="Optional Plugin - SQL Validator " selected="true"/>
-<pack index="22" name="Optional Plugin - Sybase " selected="true"/>
-<pack index="23" name="Optional Plugin - Internationalization " selected="true"/>
-<pack index="24" name="Optional Translation - Brazilian Portuguese" selected="true"/>
-<pack index="25" name="Optional Translation - Bulgarian" selected="true"/>
-<pack index="26" name="Optional Translation - Czech" selected="true"/>
-<pack index="27" name="Optional Translation - Simplified Chinese" selected="true"/>
-<pack index="28" name="Optional Translation - French" selected="true"/>
-<pack index="29" name="Optional Translation - German" selected="true"/>
-<pack index="30" name="Optional Translation - Italian" selected="true"/>
-<pack index="31" name="Optional Translation - Korean" selected="true"/>
-<pack index="32" name="Optional Translation - Polish" selected="true"/>
-<pack index="33" name="Optional Translation - Russian" selected="true"/>
-<pack index="34" name="Optional Translation - Spanish" selected="true"/>
+<pack index="8" name="Optional Plugin - Firebird Manager" selected="true"/>
+<pack index="9" name="Optional Plugin - Hibernate" selected="true"/>
+<pack index="10" name="Optional Plugin - H2 " selected="true"/>
+<pack index="11" name="Optional Plugin - Informix " selected="true"/>
+<pack index="12" name="Optional Plugin - Microsoft SQL Server " selected="true"/>
+<pack index="13" name="Optional Plugin - MySQL " selected="true"/>
+<pack index="14" name="Optional Plugin - Netezza " selected="true"/>
+<pack index="15" name="Optional Plugin - Oracle" selected="true"/>
+<pack index="16" name="Optional Plugin - PostgreSQL " selected="true"/>
+<pack index="17" name="Optional Plugin - Refactoring" selected="true"/>
+<pack index="18" name="Optional Plugin - Session Scripts" selected="true"/>
+<pack index="19" name="Optional Plugin - Smart Tools " selected="true"/>
+<pack index="20" name="Optional Plugin - SQL Parametrisation " selected="true"/>
+<pack index="21" name="Optional Plugin - SQL Replace " selected="true"/>
+<pack index="22" name="Optional Plugin - SQL Validator " selected="true"/>
+<pack index="23" name="Optional Plugin - Sybase " selected="true"/>
+<pack index="24" name="Optional Plugin - Internationalization " selected="true"/>
+<pack index="25" name="Optional Translation - Brazilian Portuguese" selected="true"/>
+<pack index="26" name="Optional Translation - Bulgarian" selected="true"/>
+<pack index="27" name="Optional Translation - Czech" selected="true"/>
+<pack index="28" name="Optional Translation - Simplified Chinese" selected="true"/>
+<pack index="29" name="Optional Translation - French" selected="true"/>
+<pack index="30" name="Optional Translation - German" selected="true"/>
+<pack index="31" name="Optional Translation - Italian" selected="true"/>
+<pack index="32" name="Optional Translation - Japanese" selected="true"/>
+<pack index="33" name="Optional Translation - Korean" selected="true"/>
+<pack index="34" name="Optional Translation - Polish" selected="true"/>
+<pack index="35" name="Optional Translation - Russian" selected="true"/>
+<pack index="36" name="Optional Translation - Spanish" selected="true"/>
</com.izforge.izpack.panels.PacksPanel>
<com.izforge.izpack.panels.InstallPanel id="UNKNOWN (com.izforge.izpack.panels.InstallPanel)"/>
<com.izforge.izpack.panels.FinishPanel id="UNKNOWN (com.izforge.izpack.panels.FinishPanel)"/>
Modified: branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/main/resources/izpack-other.xml
===================================================================
--- branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/main/resources/izpack-other.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/main/resources/izpack-other.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -345,6 +345,13 @@
<file targetdir="$INSTALL_PATH/lib" src="translations/squirrel-sql_it_IT.jar" />
</pack>
+ <pack required="no" preselected="no" installGroups="Translations" name="Optional Translation - Japanese">
+ <description>
+ Provides native labels and user messages for use in a Japanese locale (Toshiki IGA)
+ </description>
+ <file targetdir="$INSTALL_PATH/lib" src="translations/squirrel-sql_ja_JP.jar" />
+ </pack>
+
<pack required="no" preselected="no" installGroups="Translations" name="Optional Translation - Korean">
<description>
Provides native labels and user messages for use in a Korean locale (Youngwoo)
Modified: branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/test/resources/optional-auto-install.xml
===================================================================
--- branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/test/resources/optional-auto-install.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/installer/squirrelsql-other-installer/src/test/resources/optional-auto-install.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -38,10 +38,11 @@
<pack index="29" name="Optional Translation - French" selected="true"/>
<pack index="30" name="Optional Translation - German" selected="true"/>
<pack index="31" name="Optional Translation - Italian" selected="true"/>
-<pack index="32" name="Optional Translation - Korean" selected="true"/>
-<pack index="33" name="Optional Translation - Polish" selected="true"/>
-<pack index="34" name="Optional Translation - Russian" selected="true"/>
-<pack index="35" name="Optional Translation - Spanish" selected="true"/>
+<pack index="32" name="Optional Translation - Japanese" selected="true"/>
+<pack index="33" name="Optional Translation - Korean" selected="true"/>
+<pack index="34" name="Optional Translation - Polish" selected="true"/>
+<pack index="35" name="Optional Translation - Russian" selected="true"/>
+<pack index="36" name="Optional Translation - Spanish" selected="true"/>
</com.izforge.izpack.panels.PacksPanel>
<com.izforge.izpack.panels.InstallPanel id="UNKNOWN (com.izforge.izpack.panels.InstallPanel)"/>
<com.izforge.izpack.panels.ShortcutPanel id="UNKNOWN (com.izforge.izpack.panels.ShortcutPanel)"/>
Modified: branches/squirrel-3_2_1-branch/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -27,14 +27,13 @@
{
TableFrame tf = (TableFrame) f;
- if (!_graphDesktopPane.isGroupFrame(tf))
- {
- _graphDesktopPane.setGroupFrame(tf);
- }
Point correctDelta = checkBounds(newX - f.getX(), newY - f.getY(), _graphDesktopPane);
correctX = f.getX() + correctDelta.x;
correctY = f.getY() + correctDelta.y;
+
+ tolerantlyCheckGroupDissolve(tf, correctDelta);
+
for (TableFrame current : _graphDesktopPane.getGroupFrames())
{
if (current != tf)
@@ -47,9 +46,23 @@
}
super.dragFrame(f, correctX, correctY);
- _graphDesktopPane.repaint(); // Needed in case tbles are moved that don't have any constraints.
+ _graphDesktopPane.repaint(); // Needed in case tables are moved that don't have any constraints.
}
+ private void tolerantlyCheckGroupDissolve(TableFrame tf, Point correctDelta)
+ {
+ double tolerance = 0.005;
+
+ if ( ((double)correctDelta.x) / ((_graphDesktopPane.getWidth())) > tolerance
+ || ((double)correctDelta.y) / ((_graphDesktopPane.getHeight())) > tolerance)
+ {
+ if (!_graphDesktopPane.isGroupFrame(tf))
+ {
+ _graphDesktopPane.setGroupFrame(tf);
+ }
+ }
+ }
+
private void moveFoldingPoints(List<TableFrame> movedTableFrames, Point delta)
{
for (TableFrame f1 : movedTableFrames)
Modified: branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsController.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsController.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsController.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -88,6 +88,16 @@
}
});
+ _panel.cbxExcludeComplete.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ onLoadBundels(_app);
+ String excludeComplete = Boolean.valueOf(_panel.cbxExcludeComplete.isSelected()).toString();
+ Preferences.userRoot().put(TranslatorsPanel.PREF_KEY_EXCLUDE_COMPLETE, excludeComplete);
+ }
+ });
+
_panel.btnChooseWorkDir.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@@ -554,7 +564,9 @@
{
I18nProps i18nProps = defaultI18nProps.get(i);
I18nBundle pack = new I18nBundle(i18nProps, selLocale, getWorkDir(false), sourceUrls);
- i18nBundlesByName.put(i18nProps.getPath(), pack);
+ if (!_panel.cbxExcludeComplete.isSelected() || pack.getMissingTranslationsCount()!=0) {
+ i18nBundlesByName.put(i18nProps.getPath(), pack);
+ }
}
for (int i = 0; i < localizedI18nProps.size(); i++)
Modified: branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsPanel.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsPanel.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/i18n/src/main/java/net/sourceforge/squirrel_sql/plugins/i18n/TranslatorsPanel.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -50,8 +50,12 @@
JCheckBox cbxIncludeTimestamp = null;
+ JCheckBox cbxExcludeComplete = null;
+
private static final String PREF_KEY_INCLUDE_TIMESTAMP = "SquirrelSQL.i18n.includeTimestamp";
+ public static final String PREF_KEY_EXCLUDE_COMPLETE = "SquirrelSQL.i18n.excludeComplete";
+
public TranslatorsPanel(PluginResources resources)
{
setLayout(new GridLayout(1,1));
@@ -70,6 +74,11 @@
Preferences.userRoot().get(PREF_KEY_INCLUDE_TIMESTAMP, "true");
cbxIncludeTimestamp.setSelected(includeTimestamp.equals("true"));
+
+ String excludeComplete =
+ Preferences.userRoot().get(PREF_KEY_EXCLUDE_COMPLETE, "false");
+
+ cbxExcludeComplete.setSelected(excludeComplete.equals("true"));
}
private JPanel getTranslationsPanel(PluginResources resources)
@@ -139,12 +148,16 @@
btnChooseNativeToAsciiOutDir = new JButton(resources.getIcon("Open"));
gbc = new GridBagConstraints(2, 4, 1, 1, 0, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0);
ret.add(btnChooseNativeToAsciiOutDir, gbc);
-
+
gbc = new GridBagConstraints(1,5,1,1,0,0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5,0,0,5),0,0);
// i18n[I18n.includeTimestamp=Include timestamp in modified properties file]
cbxIncludeTimestamp = new JCheckBox(s_stringMgr.getString("I18n.includeTimestamp"));
ret.add(cbxIncludeTimestamp, gbc);
+ // i18n[I18n.excludeComplete=Show only partially translated bundles]
+ cbxExcludeComplete = new JCheckBox(s_stringMgr.getString("I18n.excludeComplete"));
+ gbc = new GridBagConstraints(1,6,1,1,0,0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5,0,0,5),0,0);
+ ret.add(cbxExcludeComplete, gbc);
/* gbc = new GridBagConstraints(1,5,1,1,0,0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(5,0,0,5),0,0);
// i18n[I18n.includeTimestamp=Include timestamp in modified properties file]
@@ -152,11 +165,11 @@
ret.add(timestampLabel, gbc);
*/
- gbc = new GridBagConstraints(0, 6, 3, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0);
+ gbc = new GridBagConstraints(0, 7, 3, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 5), 0, 0);
// i18n[I18n.bundles=Bundles]
ret.add(new JLabel(s_stringMgr.getString("I18n.bundles")), gbc);
- gbc = new GridBagConstraints(0, 7, 3, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 0, 0, 5), 0, 0);
+ gbc = new GridBagConstraints(0, 8, 3, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(5, 0, 0, 5), 0, 0);
ret.add(new JScrollPane(tblBundels), gbc);
return ret;
Modified: branches/squirrel-3_2_1-branch/plugins/i18n/src/main/resources/net/sourceforge/squirrel_sql/plugins/i18n/I18NStrings.properties
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/i18n/src/main/resources/net/sourceforge/squirrel_sql/plugins/i18n/I18NStrings.properties 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/i18n/src/main/resources/net/sourceforge/squirrel_sql/plugins/i18n/I18NStrings.properties 2010-12-24 00:14:54 UTC (rev 6049)
@@ -87,4 +87,6 @@
i18n.noNativeToAsciiOutDirNotCreated=Could not create native2Ascii output dir. native2Ascii will not be executed.
-I18n.includeTimestamp=Include timestamp in new or modified I18nStrings.properties file
\ No newline at end of file
+I18n.includeTimestamp=Include timestamp in new or modified I18nStrings.properties file
+
+I18n.excludeComplete=Show only partially translated bundles
\ No newline at end of file
Modified: branches/squirrel-3_2_1-branch/plugins/laf/pom.xml
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/laf/pom.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/laf/pom.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -1,34 +1,38 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--
This pom is slightly different from other plugin poms because it requires special assembly
instructions since it includes LAF jars from other projects in the lafs/ folder of the assembly.
- Since no other plugin has special needs like this, this plugin's pom overrides the plugin parent's
- assembly definition, providing it's own. To add/remove/modify the LAFS that get included in the
- assembly archive, you must add/remove/modify the dependency below on the maven project that
+ Since no other plugin has special needs like this, this plugin's pom doesn't inherit from the
+ plugin parent pom (the assembly that is inherited from plugin parent somehow cannot be overridden
+ by this pom's assembly plugin configuration). To add/remove/modify the LAFS that get included in
+ the assembly archive, you must add/remove/modify the dependency below on the maven project that
contains the LAF artifact *and* add the artifactId to the laf.artifactIds property.
-->
<parent>
- <groupId>net.sf.squirrel-sql.plugins</groupId>
- <artifactId>squirrelsql-plugins-parent-pom</artifactId>
+ <groupId>net.sf.squirrel-sql</groupId>
+ <artifactId>squirrel-root-pom</artifactId>
<version>3.3.0-SNAPSHOT</version>
- <relativePath>../squirrelsql-plugins-parent-pom/pom.xml</relativePath>
+ <relativePath>../../pom.xml</relativePath>
</parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
<artifactId>laf</artifactId>
<packaging>jar</packaging>
<name>Look and Feel Plugin</name>
<description>
- This plugin gives SQuirreLSQL client the ability to configure alternate LaFs provided by the plugin
- as well as others that the user can provide. All dependencies listed with a groupId of
- net.sf.squirrel-sql and artifactId starting with squirrelsql-lf- are externally available open-source
- look and feels whose project maintainers have decided to not use maven, or those which were built and
- maintained only before the introduction of maven. Maven's central repository policy requires any
- pom that is deployed there to reference only artifacts which are also hosted in central. And a
- project may only use the groupId that is related to that project. So, this only leaves us with one
- option which is to host these external third-party artifacts using our groupId. The hope is that
- someday these projects will start using maven and the need for this will no longer be.
+ This plugin gives SQuirreLSQL client the ability to configure alternate LaFs provided by the plugin
+ as well as others that the user can provide. All dependencies listed with a groupId of
+ net.sf.squirrel-sql and artifactId starting with squirrelsql-lf- are externally available
+ open-source
+ look and feels whose project maintainers have decided to not use maven, or those which were built and
+ maintained only before the introduction of maven. Maven's central repository policy requires any
+ pom that is deployed there to reference only artifacts which are also hosted in central. And a
+ project may only use the groupId that is related to that project. So, this only leaves us with one
+ option which is to host these external third-party artifacts using our groupId. The hope is that
+ someday these projects will start using maven and the need for this will no longer be.
</description>
<inceptionYear>2001</inceptionYear>
<developers>
@@ -78,36 +82,49 @@
<dependency>
<groupId>net.sf.squirrel-sql</groupId>
<artifactId>fw</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.sf.squirrel-sql</groupId>
<artifactId>squirrel-sql</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.sf.squirrel-sql</groupId>
<artifactId>squirrel-sql</artifactId>
+ <version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>gsbase</groupId>
<artifactId>gsbase</artifactId>
+ <version>${gsbase-version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+ <version>${junit-version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
+ <version>${easymock-version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymockclassextension</artifactId>
+ <version>${easymockclassextension-version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
+ <version>${mockito-version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
@@ -185,18 +202,71 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
+ <version>${source-plugin-version}</version>
+ <configuration>
+ <outputDirectory>target</outputDirectory>
+ <finalName>${project.artifactId}</finalName>
+ <includePom>true</includePom>
+ <!--
+ We exclude docs from the source jar, because the assembly has to have them for the plugin
+ install to work; and we don't want the source jar to contain them as well as the assembly jar
+ as that just makes the assembly jar bigger.
+ -->
+ <excludes>
+ <exclude>**/doc/**</exclude>
+ <exclude>**/doc</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire-plugin-version}</version>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <parallel>${surefire-parallel-type}</parallel>
+ <threadCount>${surefire-thread-count}</threadCount>
+ </configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
+ <version>${jar-plugin-version}</version>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ <finalName>${project.artifactId}</finalName>
+ <!--
+ We exclude docs from the classes jar, for the same reason as
+ above
+ -->
+ <excludes>
+ <exclude>**/doc/**</exclude>
+ <exclude>**/doc</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
+ <version>${dependency-plugin-version}</version>
<executions>
<execution>
<id>copy-lafs</id>
@@ -210,13 +280,6 @@
<outputDirectory>${staging.dir}/lafs</outputDirectory>
</configuration>
</execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>${dependency-plugin-version}</version>
- <executions>
<execution>
<id>unpack-skinlf-theme-packs</id>
<phase>process-resources</phase>
@@ -241,6 +304,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
+ <version>${assembly-plugin-version}</version>
<executions>
<execution>
<id>create-plugin-archives</id>
Modified: branches/squirrel-3_2_1-branch/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/prefs/OraclePluginPreferencesPanel.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/prefs/OraclePluginPreferencesPanel.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/oracle/src/main/java/net/sourceforge/squirrel_sql/plugins/oracle/prefs/OraclePluginPreferencesPanel.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -87,7 +87,7 @@
private final static JCheckBox showErrorOffsetCheckBox = new JCheckBox(i18n.SHOW_ERROR_OFFSET_LABEL);
- private final static JCheckBox initSessionTimezoneCheckBox = new JCheckBox("Initialize Session Timezone");
+ private final static JCheckBox initSessionTimezoneCheckBox = new JCheckBox(i18n.SESSION_TIMEZONE_LABEL);
private final static JTextField sessionTimezoneTextField = new JTextField();
Modified: branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-assembly-descriptor/pom.xml
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-assembly-descriptor/pom.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-assembly-descriptor/pom.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -8,6 +8,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
+ <groupId>net.sf.squirrel-sql.plugins</groupId>
<artifactId>squirrelsql-plugins-assembly-descriptor</artifactId>
<packaging>jar</packaging>
Modified: branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-parent-pom/pom.xml
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-parent-pom/pom.xml 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/squirrelsql-plugins-parent-pom/pom.xml 2010-12-24 00:14:54 UTC (rev 6049)
@@ -210,7 +210,7 @@
<dependency>
<groupId>net.sf.squirrel-sql.plugins</groupId>
<artifactId>squirrelsql-plugins-assembly-descriptor</artifactId>
- <version>3.2.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
</dependencies>
<executions>
Modified: branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrectController.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrectController.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrectController.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -18,9 +18,9 @@
private AutoCorrectDlg _dlg;
- private SyntaxPugin _syntaxPugin;
+ private SyntaxPlugin _syntaxPugin;
- public AutoCorrectController(SyntaxPugin syntaxPugin)
+ public AutoCorrectController(SyntaxPlugin syntaxPugin)
{
_syntaxPugin = syntaxPugin;
Modified: branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrector.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrector.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/AutoCorrector.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -17,13 +17,13 @@
private JTextComponent _txtComp;
- private SyntaxPugin _plugin;
+ private SyntaxPlugin _plugin;
private int _autocorrectionsCount = 0;
private static final String PREFS_KEY_AUTO_COORECTIONS_COUNT = "squirrelSql_syntax_autocorrections_count";
- public AutoCorrector(JTextComponent txtComp, SyntaxPugin plugin)
+ public AutoCorrector(JTextComponent txtComp, SyntaxPlugin plugin)
{
_txtComp = txtComp;
_plugin = plugin;
Modified: branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/ConfigureAutoCorrectAction.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/ConfigureAutoCorrectAction.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/ConfigureAutoCorrectAction.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -1,19 +1,18 @@
package net.sourceforge.squirrel_sql.plugins.syntax;
+import java.awt.event.ActionEvent;
+
import net.sourceforge.squirrel_sql.client.IApplication;
-import net.sourceforge.squirrel_sql.client.session.action.ISessionAction;
-import net.sourceforge.squirrel_sql.client.session.ISession;
import net.sourceforge.squirrel_sql.client.action.SquirrelAction;
+import net.sourceforge.squirrel_sql.client.session.ISession;
+import net.sourceforge.squirrel_sql.client.session.action.ISessionAction;
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-
public class ConfigureAutoCorrectAction extends SquirrelAction implements ISessionAction
{
- private SyntaxPugin _syntaxPugin;
+ private SyntaxPlugin _syntaxPugin;
- public ConfigureAutoCorrectAction(IApplication app, SyntaxPluginResources resources, SyntaxPugin syntaxPugin)
+ public ConfigureAutoCorrectAction(IApplication app, SyntaxPluginResources resources, SyntaxPlugin syntaxPugin)
{
super(app, resources);
_syntaxPugin = syntaxPugin;
Modified: branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SQLEntryPanelFactoryProxy.java
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SQLEntryPanelFactoryProxy.java 2010-12-23 05:02:12 UTC (rev 6048)
+++ branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SQLEntryPanelFactoryProxy.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -22,7 +22,7 @@
private NetbeansSQLEntryAreaFactory _netbeansFactory;
private OsterSQLEntryAreaFactory _osterFactory;
- private SyntaxPugin _syntaxPugin;
+ private SyntaxPlugin _syntaxPugin;
/** The original Squirrel SQL CLient factory for creating SQL entry panels. */
private ISQLEntryPanelFactory _originalFactory;
@@ -30,7 +30,7 @@
private RSyntaxSQLEntryAreaFactory _rsyntaxFactory;
- SQLEntryPanelFactoryProxy(SyntaxPugin syntaxPugin, ISQLEntryPanelFactory originalFactory)
+ SQLEntryPanelFactoryProxy(SyntaxPlugin syntaxPugin, ISQLEntryPanelFactory originalFactory)
{
_originalFactory = originalFactory;
_rsyntaxFactory = new RSyntaxSQLEntryAreaFactory(syntaxPugin);
Copied: branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPlugin.java (from rev 6039, trunk/sql12/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPlugin.java)
===================================================================
--- branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPlugin.java (rev 0)
+++ branches/squirrel-3_2_1-branch/plugins/syntax/src/main/java/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPlugin.java 2010-12-24 00:14:54 UTC (rev 6049)
@@ -0,0 +1,588 @@
+package net.sourceforge.squirrel_sql.plugins.syntax;
+/*
+ * Copyright (C) 2003 Colin Bell
+ * co...@us...
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+import net.sourceforge.squirrel_sql.client.IApplication;
+import net.sourceforge.squirrel_sql.client.action.ActionCollection;
+import net.sourceforge.squirrel_sql.client.gui.session.ObjectTreeInternalFrame;
+import net.sourceforge.squirrel_sql.client.gui.session.SQLInternalFrame;
+import net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame;
+import net.sourceforge.squirrel_sql.client.plugin.DefaultSessionPlugin;
+import net.sourceforge.squirrel_sql.client.plugin.PluginException;
+import net.sourceforge.squirrel_sql.client.plugin.PluginSessionCallback;
+import net.sourceforge.squirrel_sql.client.preferences.INewSessionPropertiesPanel;
+import net.sourceforge.squirrel_sql.client.session.ISQLEntryPanelFactory;
+import net.sourceforge.squirrel_sql.client.session.ISQLPanelAPI;
+import net.sourceforge.squirrel_sql.client.session.ISession;
+import net.sourceforge.squirrel_sql.client.session.properties.ISessionPropertiesPanel;
+import net.sourceforge.squirrel_sql.fw.id.IIdentifier;
+import net.sourceforge.squirrel_sql.fw.util.StringManager;
+import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
+import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
+import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
+import net.sourceforge.squirrel_sql.fw.xml.XMLBeanReader;
+import net.sourceforge.squirrel_sql.fw.xml.XMLBeanWriter;
+import net.sourceforge.squirrel_sql.plugins.syntax.netbeans.NetbeansSQLEntryPanel;
+import net.sourceforge.squirrel_sql.plugins.syntax.ReplaceAction;
+import net.sourceforge.squirrel_sql.plugins.syntax.oster.OsterSQLEntryPanel;
+import net.sourceforge.squirrel_sql.plugins.syntax.rsyntax.RSyntaxSQLEntryPanel;
+import net.sourceforge.squirrel_sql.plugins.syntax.UnmarkAction;
+
+import javax.swing.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * The Ostermiller plugin class. This plugin adds syntax highlighting to the
+ * SQL entry area.
+ *
+ * @author <A HREF="mailto:co...@us...">Colin Bell</A>
+ */
+public class SyntaxPlugin extends DefaultSessionPlugin
+{
+ private static final StringManager s_stringMgr =
+ StringManagerFactory.getStringManager(SyntaxPlugin.class);
+
+ static interface i18n
+ {
+ //i18n[SyntaxPlugin.touppercase=touppercase]
+ String TO_UPPER_CASE =
+ s_stringMgr.getString("SyntaxPlugin.touppercase");
+ //i18n[SyntaxPlugin.tolowercase=tolowercase]
+ String TO_LOWER_CASE =
+ s_stringMgr.getString("SyntaxPlugin.tolowercase");
+ //i18n[SyntaxPlugin.find=find]
+ String FIND = s_stringMgr.getString("SyntaxPlugin.find");
+ //i18n[SyntaxPlugin.findSelected=findselected]
+ String FIND_SELECTED = s_stringMgr.getString("SyntaxPlugin.findselected");
+ //i18n[SyntaxPlugin.repeatLastFind=findrepeatlast]
+ String REPEAT_LAST_FIND = s_stringMgr.getString("SyntaxPlugin.repeatLastFind");
+ //i18n[SyntaxPlugin.markSelected=markselected]
+ String MARK_SELECTED = s_stringMgr.getString("SyntaxPlugin.markSelected");
+ //i18n[SyntaxPlugin.replace=replace]
+ String REPLACE = s_stringMgr.getString("SyntaxPlugin.replace");
+ //i18n[SyntaxPlugin.unmark=unmark]
+ String UNMARK = s_stringMgr.getString("SyntaxPlugin.unmark");
+ //i18n[SyntaxPlugin.gotoline=gotoline]
+ String GO_TO_LINE = s_stringMgr.getString("SyntaxPlugin.gotoline");
+ //i18n[SyntaxPlugin.autocorr=autocorr]
+ String AUTO_CORR = s_stringMgr.getString("SyntaxPlugin.autocorr");
+ //i18n[SyntaxPlugin.duplicateline=duplicateline]
+ String DUP_LINE = s_stringMgr.getString("SyntaxPlugin.duplicateline");
+ //i18n[SyntaxPlugin.comment=comment]
+ String COMMENT = s_stringMgr.getString("SyntaxPlugin.comment");
+ //i18n[SyntaxPlugin.uncomment=uncomment]
+ String UNCOMMENT = s_stringMgr.getString("SyntaxPlugin.uncomment");
+
+ }
+
+ /** Logger for this class. */
+ private static final ILogger s_log = LoggerController.createLogger(SyntaxPlugin.class);
+
+ /** SyntaxPreferences for new sessions. */
+ private SyntaxPreferences _newSessionPrefs;
+
+ /** Folder to store user settings in. */
+ private File _userSettingsFolder;
+
+ /** Factory that creates text controls. */
+ private SQLEntryPanelFactoryProxy _sqlEntryFactoryProxy;
+
+ /** Listeners to the preferences object in each open session. */
+ private Map<IIdentifier, SessionPreferencesListener> _prefListeners =
+ new HashMap<IIdentifier, SessionPreferencesListener>();
+
+ /** Resources for this plugin. */
+ private SyntaxPluginResources _resources;
+ private AutoCorrectProviderImpl _autoCorrectProvider;
+
+ private interface IMenuResourceKeys
+ {
+ String MENU = "syntax";
+ }
+
+
+ /**
+ * Return the internal name of this plugin.
+ *
+ * @return the internal name of this plugin.
+ */
+ public String getInternalName()
+ {
+ return "syntax";
+ }
+
+ /**
+ * Return the descriptive name of this plugin.
+ *
+ * @return the descriptive name of this plugin.
+ */
+ public String getDescriptiveName()
+ {
+ return "Syntax Highlighting Plugin";
+ }
+
+ /**
+ * Returns the current version of this plugin.
+ *
+ * @return the current version of this plugin.
+ */
+ public String getVersion()
+ {
+ return "1.0";
+ }
+
+ /**
+ * Returns the authors name.
+ *
+ * @return the authors name.
+ */
+ public String getAuthor()
+ {
+ return "Gerd Wagner, Colin Bell";
+ }
+
+
+ /**
+ * Returns the name of the change log for the plugin. This should
+ * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
+ * directory.
+ *
+ * @return the changelog file name or <TT>null</TT> if plugin doesn't have
+ * a change log.
+ */
+ public String getChangeLogFileName()
+ {
+ return "changes.txt";
+ }
+
+ /**
+ * Returns the name of the Help file for the plugin. This should
+ * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
+ * directory.
+ *
+ * @return the Help file name or <TT>null</TT> if plugin doesn't have
+ * a help file.
+ */
+ public String getHelpFileName()
+ {
+ return "readme.html";
+ }
+
+ /**
+ * Returns the name of the Licence file for the plugin. This should
+ * be a text or HTML file residing in the <TT>getPluginAppSettingsFolder</TT>
+ * directory.
+ *
+ * @return the Licence file name or <TT>null</TT> if plugin doesn't have
+ * a licence file.
+ */
+ public String getLicenceFileName()
+ {
+ return "licence.txt";
+ }
+
+ /**
+ * Initialize this plugin.
+ */
+ public synchronized void initialize() throws PluginException
+ {
+ super.initialize();
+
+ _resources = new SyntaxPluginResources(this);
+
+ // Folder to store user settings.
+ try
+ {
+ _userSettingsFolder = getPluginUserSettingsFolder();
+ }
+ catch (IOException ex)
+ {
+ throw new PluginException(ex);
+ }
+
+ // Load plugin preferences.
+ loadPrefs();
+
+ // Install the factory for creating SQL entry text controls.
+ final IApplication app = getApplication();
+ final ISQLEntryPanelFactory originalFactory = app.getSQLEntryPanelFactory();
+ //_sqlEntryFactoryProxy = new OsterSQLEntryAreaFactory(this, originalFactory);
+
+ _sqlEntryFactoryProxy = new SQLEntryPanelFactoryProxy(this, originalFactory);
+
+ app.setSQLEntryPanelFactory(_sqlEntryFactoryProxy);
+
+ _autoCorrectProvider = new AutoCorrectProviderImpl(_userSettingsFolder);
+
+ createMenu();
+ }
+
+ private void createMenu()
+ {
+ IApplication app = getApplication();
+ ActionCollection coll = app.getActionCollection();
+
+ JMenu menu = _resources.createMenu(IMenuResourceKeys.MENU);
+ app.addToMenu(IApplication.IMenuIDs.SESSION_MENU, menu);
+
+ Action act = new ConfigureAutoCorrectAction(app, _resources, this);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new FindAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new FindSelectedAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new RepeatLastFindAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new MarkSelectedAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new ReplaceAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new UnmarkAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new GoToLineAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new DuplicateLineAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new CommentAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ act = new UncommentAction(getApplication(), _resources);
+ coll.add(act);
+ _resources.addToMenu(act, menu);
+
+ }
+
+
+ /**
+ * Application is shutting down so save preferences.
+ */
+ public void unload()
+ {
+ savePrefs();
+ super.unload();
+ }
+
+ /**
+ * Called when a session created but the UI hasn't been built for the
+ * session.
+ *
+ * @param session The session that is starting.
+ */
+ public void sessionCreated(ISession session)
+ {
+ SyntaxPreferences prefs = null;
+
+ try
+ {
+ prefs = (SyntaxPreferences)_newSessionPrefs.clone();
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ throw new InternalError("CloneNotSupportedException for SyntaxPreferences");
+ }
+
+ session.putPluginObject(this, IConstants.ISessionKeys.PREFS, prefs);
+
+ SessionPreferencesListener lis =
+ new SessionPreferencesListener(this, session);
+ prefs.addPropertyChangeListener(lis);
+ _prefListeners.put(session.getIdentifier(), lis);
+ }
+
+
+ public PluginSessionCallback sessionStarted(final ISession session)
+ {
+ PluginSessionCallback ret = new PluginSessionCallback()
+ {
+ public void sqlInternalFrameOpened(SQLInternalFrame sqlInternalFrame, ISession sess)
+ {
+ initSqlInternalFrame(sqlInternalFrame);
+ }
+
+ public void objectTreeInternalFrameOpened(ObjectTreeInternalFrame objectTreeInternalFrame, ISession sess)
+ {
+ }
+ };
+
+ initSessionSheet(session);
+
+ return ret;
+ }
+
+ private void initSessionSheet(ISession session)
+ {
+ ActionCollection coll = getApplication().getActionCollection();
+ session.addSeparatorToToolbar();
+ session.addToToolbar(coll.get(FindAction.class));
+ session.addToToolbar(coll.get(ReplaceAction.class));
+ session.addToToolbar(coll.get(ConfigureAutoCorrectAction.class));
+
+ SessionInternalFrame sif = session.getSessionInternalFrame();
+
+ ISQLPanelAPI sqlPanelAPI = sif.getSQLPanelAPI();
+
+ new ToolsPopupHandler(this).initToolsPopup(sif, coll);
+
+ JMenuItem mnuComment = sqlPanelAPI.addToSQLEntryAreaMenu(coll.get(CommentAction.class));
+ _resources.configureMenuItem(coll.get(CommentAction.class), mnuComment);
+ JMenuItem mnuUncomment = sqlPanelAPI.addToSQLEntryAreaMenu(coll.get(UncommentAction.class));
+ _resources.configureMenuItem(coll.get(UncommentAction.class), mnuUncomment);
+ }
+
+ private void initSqlInternalFrame(SQLInternalFrame sqlInternalFrame)
+ {
+ ActionCollection coll = getApplication().getActionCollection();
+ FindAction findAction = ((FindAction) coll.get(FindAction.class));
+ ReplaceAction replaceAction = (ReplaceAction) coll.get(ReplaceAction.class);
+
+ sqlInternalFrame.addSeparatorToToolbar();
+ sqlInternalFrame.addToToolbar(findAction);
+ sqlInternalFrame.addToToolbar(replaceAction);
+ sqlInternalFrame.addToToolbar(coll.get(ConfigureAutoCorrectAction.class));
+
+ new ToolsPopupHandler(this).initToolsPopup(sqlInternalFrame, coll);
+
+ ISQLPanelAPI sqlPanelAPI = sqlInternalFrame.getSQLPanelAPI();
+
+ JMenuItem mnuUnmark = sqlPanelAPI.addToSQLEntryAreaMenu(coll.get(UnmarkAction.class));
+ _resources.configureMenuItem(coll.get(UnmarkAction.class), mnuUnmark);
+ JMenuItem mnuComment = sqlPanelAPI.addToSQLEntryAreaMenu(coll.get(CommentAction.class));
+ _resources.configureMenuItem(coll.get(CommentAction.class), mnuComment);
+ JMenuItem mnuUncomment = sqlPanelAPI.addToSQLEntryAreaMenu(coll.get(UncommentAction.class));
+ _resources.configureMenuItem(coll.get(UncommentAction.class), mnuUncomment);
+
+ }
+
+
+
+ /**
+ * Called when a session shutdown.
+ *
+ * @param session The session that is ending.
+ */
+ public void sessionEnding(ISession session)
+ {
+ super.sessionEnding(session);
+
+ session.removePluginObject(this, IConstants.ISessionKeys.PREFS);
+ _prefListeners.remove(session.getIdentifier());
+ _sqlEntryFactoryProxy.sessionEnding(session);
+ }
+
+ /**
+ * Create preferences panel for the New Session Properties dialog.
+ *
+ * @return preferences panel.
+ */
+ public INewSessionPropertiesPanel[] getNewSessionPropertiesPanels()
+ {
+ return new INewSessionPropertiesPanel[]
+ {
+ new SyntaxPreferencesPanel(_newSessionPrefs, _resources)
+ };
+ }
+
+ /**
+ * Create panels for the Session Properties dialog.
+ *
+ * @return Array of panels for the properties dialog.
+ */
+ public ISessionPropertiesPanel[] getSessionPropertiesPanels(ISession session)
+ {
+ SyntaxPreferences sessionPrefs = (SyntaxPreferences)session.getPluginObject(this,
+ IConstants.ISessionKeys.PREFS);
+
+ return new ISessionPropertiesPanel[]
+ {
+ new SyntaxPreferencesPanel(sessionPrefs, _resources)
+ };
+ }
+
+ SyntaxPluginResources getResources()
+ {
+ return _resources;
+ }
+
+ ISQLEntryPanelFactory getSQLEntryAreaFactory()
+ {
+ return _sqlEntryFactoryProxy;
+ }
+
+ /**
+ * Load from preferences file.
+ */
+ private void loadPrefs()
+ {
+ try
+ {
+ final XMLBeanReader doc = new XMLBeanReader();
+ final File file = new File(_userSettingsFolder,
+ IConstants.USER_PREFS_FILE_NAME);
+ doc.load(file, getClass().getClassLoader());
+
+ Iterator<?> it = doc.iterator();
+
+ if (it.hasNext())
+ {
+ _newSessionPrefs = (SyntaxPreferences)it.next();
+ }
+ }
+ catch (FileNotFoundException ignore)
+ {
+ // property file not found for user - first time user ran pgm.
+ }
+ catch (Exception ex)
+ {
+ final String msg = "Error occured reading from preferences file: " +
+ IConstants.USER_PREFS_FILE_NAME;
+ s_log.error(msg, ex);
+ }
+
+ if (_newSessionPrefs == null)
+ {
+ _newSessionPrefs = new SyntaxPreferences();
+ }
+ }
+
+ /**
+ * Save preferences to disk.
+ */
+ private void savePrefs()
+ {
+ try
+ {
+ final XMLBeanWriter wtr = new XMLBeanWriter(_newSessionPrefs);
+ wtr.save(new File(_userSettingsFolder, IConstants.USER_PREFS_FILE_NAME));
+ }
+ catch (Exception ex)
+ {
+ final String msg = "Error occured writing to preferences file: " +
+ IConstants.USER_PREFS_FILE_NAME;
+ s_log.error(msg, ex);
+ }
+ }
+
+
+ public Object getExternalService()
+ {
+ return getAutoCorrectProviderImpl();
+ }
+
+
+ public AutoCorrectProviderImpl getAutoCorrectProviderImpl()
+ {
+ return _autoCorrectProvider;
+ }
+
+ private static final class SessionPreferencesListener
+ implements PropertyChangeListener
+ {
+ private SyntaxPlugin _plugin;
+ private ISession _session;
+
+ SessionPreferencesListener(SyntaxPlugin plugin, ISession session)
+ {
+ super();
+ _plugin = plugin;
+ _session = session;
+ }
+
+ public void propertyChange(PropertyChangeEvent evt)
+ {
+ String propName = evt.getPropertyName();
+
+ if( false == SyntaxPreferences.IPropertyNames.USE_NETBEANS_CONTROL.equals(propName)
+ && false == SyntaxPreferences.IPropertyNames.USE_OSTER_CONTROL.equals(propName)
+ && false == SyntaxPreferences.IPropertyNames.USE_RSYNTAX_CONTROL.equals(propName) )
+ {
+
+ // Not the Textcontrol itself changed but some other of the Syntax Preferences, for example...
[truncated message content] |