[Schmitzm-commits] r883 - in trunk/src/schmitzm: lang swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 3 11:00:24 CEST 2010


Author: alfonx
Date: 2010-06-03 11:00:24 +0200 (Thu, 03 Jun 2010)
New Revision: 883

Modified:
   trunk/src/schmitzm/lang/ResourceProvider.java
   trunk/src/schmitzm/swing/ResourceProviderManagerFrame.java
Log:
Some tiny fixes in ResourceProviderManagerFrame

Modified: trunk/src/schmitzm/lang/ResourceProvider.java
===================================================================
--- trunk/src/schmitzm/lang/ResourceProvider.java	2010-06-02 12:43:53 UTC (rev 882)
+++ trunk/src/schmitzm/lang/ResourceProvider.java	2010-06-03 09:00:24 UTC (rev 883)
@@ -288,7 +288,7 @@
 	 */
 	public SortedSet<String> getKeys() {
 		String prefix = (keyPrefix != null) ? keyPrefix.trim() : "";
-		if (!keyPrefix.equals(""))
+		if (!prefix.equals(""))
 			prefix += ".";
 
 		final SortedSet<String> keys = new TreeSet<String>();
@@ -646,10 +646,16 @@
 	public static File getPropertyFile(ResourceProvider provider, Locale l)
 			throws URISyntaxException {
 		String bundlePath = provider.getBundleName();
+		String bundlePackage= "";
+		String bundleName = bundlePath;
 		int lastDotIdx = bundlePath.lastIndexOf(".");
-		String bundleName = bundlePath.substring(lastDotIdx + 1);
-		String bundlePackage = bundlePath.substring(0, lastDotIdx).replace(".",
-				"/");
+		
+		if (lastDotIdx >= 0  ) {
+			bundleName = bundlePath.substring(lastDotIdx + 1);
+			bundlePackage = bundlePath.substring(0, lastDotIdx).replace(".",
+			"/");
+		}
+		
 		URL bundlePackageURL = ClassLoader.getSystemResource(bundlePackage);
 		String newBundleName = bundleName + "_" + l.toString() + ".properties";
 		File newBundleFile = new File(new File(bundlePackageURL.toURI()),

Modified: trunk/src/schmitzm/swing/ResourceProviderManagerFrame.java
===================================================================
--- trunk/src/schmitzm/swing/ResourceProviderManagerFrame.java	2010-06-02 12:43:53 UTC (rev 882)
+++ trunk/src/schmitzm/swing/ResourceProviderManagerFrame.java	2010-06-03 09:00:24 UTC (rev 883)
@@ -13,6 +13,7 @@
 
 import java.awt.AWTEvent;
 import java.awt.BorderLayout;
+import java.awt.Component;
 import java.awt.FlowLayout;
 import java.awt.Frame;
 import java.awt.event.ActionEvent;
@@ -64,7 +65,7 @@
    * @param parent   calling frame
    * @param modal    flag, whether the frame is modal
    */
-  public ResourceProviderManagerFrame(Frame parent, boolean modal) {
+  public ResourceProviderManagerFrame(Component parent, boolean modal) {
     this(parent,modal,null);
   }
 
@@ -75,8 +76,8 @@
    * @param infoText information message shown in the north path of
    *                 the window to explain the usage of resource bundles
    */
-  public ResourceProviderManagerFrame(Frame parent, boolean modal, String infoText) {
-    super(parent,modal);
+  public ResourceProviderManagerFrame(Component parent, boolean modal, String infoText) {
+    super(SwingUtil.getParentFrame(parent),modal);
     enableEvents(AWTEvent.WINDOW_EVENT_MASK);
     try {
       initGUI(infoText);



More information about the Schmitzm-commits mailing list