[Schmitzm-commits] r1617 - in trunk/schmitzm-core/src/main/java/de/schmitzm: lang swing swing/input swing/table

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jul 1 19:31:45 CEST 2011


Author: mojays
Date: 2011-07-01 19:31:44 +0200 (Fri, 01 Jul 2011)
New Revision: 1617

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/input/BrowseInputOption.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/DoubleRenderer.java
Log:
LangUtil: BugFix in trimToSize(.)
SwingUtil: Ber?\195?\188cksichtigung von InputOption in setEditable(.)
BrowseInputOption: Ber?\195?\188ckscihtigung des Buttons in setEnabled(.)

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java	2011-06-29 19:19:06 UTC (rev 1616)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java	2011-07-01 17:31:44 UTC (rev 1617)
@@ -316,11 +316,11 @@
 		if (str == null)
 			return null;
 		str = str.trim();
-		if (str.length() <= maxSize)
-			return str;
+		if (str.length() > maxSize)
+			str = str.substring(0, maxSize);
 		if ( trimToNull )
 		  return StringUtils.trimToNull(str);
-		return str.substring(0, maxSize);
+		return str;
 		
 	}
 

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2011-06-29 19:19:06 UTC (rev 1616)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2011-07-01 17:31:44 UTC (rev 1617)
@@ -834,6 +834,10 @@
         ((JList)component).setEnabled(editable);
       if ( component instanceof JDateChooser )
         ((JDateChooser)component).setEnabled(editable);
+      if ( component instanceof InputOption ) {
+        ((InputOption)component).setEnabled(editable);
+        return; // JPanel nicht nochmal rekursiv durchlaufen!
+      }
       
       // recursive components
       if ( component instanceof javax.swing.JPanel )

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/input/BrowseInputOption.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/input/BrowseInputOption.java	2011-06-29 19:19:06 UTC (rev 1616)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/input/BrowseInputOption.java	2011-07-01 17:31:44 UTC (rev 1617)
@@ -101,6 +101,15 @@
     remove(inpComp);
     add(inpCompCont,BorderLayout.SOUTH);
   }
+  
+  /**
+   * Deaktiviert neben der Eingabe-Option auch den Browse-Button.
+   */
+  @Override
+  public void setEnabled(boolean enabled) {
+    super.setEnabled(enabled);
+    browseButton.setEnabled(enabled);
+  }
 
   /**
    * Aktion des Browse-Button.

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/DoubleRenderer.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/DoubleRenderer.java	2011-06-29 19:19:06 UTC (rev 1616)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/DoubleRenderer.java	2011-07-01 17:31:44 UTC (rev 1617)
@@ -66,6 +66,7 @@
     super();
     setHorizontalAlignment(JLabel.RIGHT);
     setCellFormat(cellFormatter);
+    setTooltipFormat(tooltipFormatter);
   }
 
   /**



More information about the Schmitzm-commits mailing list