You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2013/12/13 15:03:46 UTC

[2/4] git commit: ISIS-632: further minor tweaks.

ISIS-632: further minor tweaks.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/dca5c3e8
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/dca5c3e8
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/dca5c3e8

Branch: refs/heads/master
Commit: dca5c3e8c9f71bbcfbacd0fea623a0247fe47466
Parents: cdfccdc
Author: Dan Haywood <da...@apache.org>
Authored: Fri Dec 13 00:52:51 2013 +0100
Committer: Dan Haywood <da...@apache.org>
Committed: Fri Dec 13 00:52:51 2013 +0100

----------------------------------------------------------------------
 .../wicket/ui/components/widgets/Select2ChoiceUtil.java       | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/dca5c3e8/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/Select2ChoiceUtil.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/Select2ChoiceUtil.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/Select2ChoiceUtil.java
index 221b527..8738a80 100644
--- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/Select2ChoiceUtil.java
+++ b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/Select2ChoiceUtil.java
@@ -25,12 +25,15 @@ import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento;
 import org.apache.isis.viewer.wicket.model.models.ScalarModel;
 
 public final class Select2ChoiceUtil  {
-    
+
     private Select2ChoiceUtil(){}
 
     // a guesstimate to convert a single character into 'em' units
     private static final double CHAR_TO_EM_MULTIPLIER = 0.8;
     
+    // a further fudge, add some additional characters prior to multiplication.
+    private static final int ADDITIONAL_CHARS = 3;
+    
     public static Select2Choice<ObjectAdapterMemento> newSelect2Choice(String id, final IModel<ObjectAdapterMemento> modelObject, ScalarModel scalarModel) {
         Select2Choice<ObjectAdapterMemento> select2Choice = new Select2Choice<ObjectAdapterMemento>(id, modelObject);
         int typicalLength = scalarModel.getTypicalLength(); 
@@ -39,7 +42,7 @@ public final class Select2ChoiceUtil  {
     }
 
     private static String asCssStyleWidth(int numChars) {
-        return "width: " + ((numChars+2) * CHAR_TO_EM_MULTIPLIER) + "em;";
+        return "width: " + ((numChars+ADDITIONAL_CHARS) * CHAR_TO_EM_MULTIPLIER) + "em;";
     }
 
 }