syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1451160 - in /syncope/branches/1_0_X: console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ parent/
Date Thu, 28 Feb 2013 09:47:38 GMT
Author: ilgrosso
Date: Thu Feb 28 09:47:38 2013
New Revision: 1451160

URL: http://svn.apache.org/r1451160
Log:
Upgrading Wicket to 1.5.10 and removing unnecessary workarounds for SYNCOPE-310

Modified:
    syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/NonI18nPalette.java
    syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
    syncope/branches/1_0_X/parent/pom.xml

Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/NonI18nPalette.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/NonI18nPalette.java?rev=1451160&r1=1451159&r2=1451160&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/NonI18nPalette.java
(original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/NonI18nPalette.java
Thu Feb 28 09:47:38 2013
@@ -19,19 +19,10 @@
 package org.apache.syncope.console.wicket.markup.html.form;
 
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
-import org.apache.wicket.Component;
 import org.apache.wicket.extensions.markup.html.form.palette.Palette;
-import org.apache.wicket.extensions.markup.html.form.palette.component.Choices;
-import org.apache.wicket.extensions.markup.html.form.palette.component.Selection;
-import org.apache.wicket.markup.ComponentTag;
-import org.apache.wicket.markup.MarkupStream;
 import org.apache.wicket.markup.html.form.IChoiceRenderer;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.util.convert.IConverter;
-import org.apache.wicket.util.string.Strings;
 
 /**
  * Workaround for WICKET-5029 to be removed when upgrading Wicket to 1.5.10 / 6.6.0.
@@ -56,83 +47,7 @@ public class NonI18nPalette<T> extends P
     }
 
     @Override
-    protected Component newChoicesComponent() {
-        return new Choices<T>("choices", this) {
-
-            private static final long serialVersionUID = 5631133033579060143L;
-
-            @Override
-            protected Map<String, String> getAdditionalAttributes(final Object choice)
{
-                return NonI18nPalette.this.getAdditionalAttributesForChoices(choice);
-            }
-
-            @Override
-            public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag
openTag) {
-                NonI18nPalette.this.nonI18nOnComponentTagBody(markupStream, openTag, getOptionsIterator());
-            }
-        };
-    }
-
-    @Override
-    protected Component newSelectionComponent() {
-        return new Selection<T>("selection", this) {
-
-            private static final long serialVersionUID = 409955426639123592L;
-
-            @Override
-            protected Map<String, String> getAdditionalAttributes(final Object choice)
{
-                return NonI18nPalette.this.getAdditionalAttributesForSelection(choice);
-            }
-
-            @Override
-            public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag
openTag) {
-                NonI18nPalette.this.nonI18nOnComponentTagBody(markupStream, openTag, getOptionsIterator());
-            }
-        };
-    }
-
-    protected void nonI18nOnComponentTagBody(final MarkupStream markupStream, final ComponentTag
openTag,
-            final Iterator<T> options) {
-
-        StringBuilder buffer = new StringBuilder(128);
-        IChoiceRenderer<T> renderer = getChoiceRenderer();
-
-        while (options.hasNext()) {
-            final T choice = options.next();
-
-            final CharSequence id;
-            {
-                String value = renderer.getIdValue(choice, 0);
-
-                if (getEscapeModelStrings()) {
-                    id = Strings.escapeMarkup(value);
-                } else {
-                    id = value;
-                }
-            }
-
-            final CharSequence value;
-            {
-                Object displayValue = renderer.getDisplayValue(choice);
-                Class<?> displayClass = displayValue == null ? null : displayValue.getClass();
-
-                @SuppressWarnings("unchecked")
-                IConverter<Object> converter = (IConverter<Object>) getConverter(displayClass);
-                String displayString = converter.convertToString(displayValue, getLocale());
-
-                if (getEscapeModelStrings()) {
-                    value = Strings.escapeMarkup(displayString);
-                } else {
-                    value = displayString;
-                }
-            }
-
-            buffer.append("\n<option value=\"").append(id).append("\"");
-            buffer.append(">").append(value).append("</option>");
-        }
-
-        buffer.append("\n");
-
-        replaceComponentTagBody(markupStream, openTag, buffer);
+    protected boolean localizeDisplayValues() {
+        return false;
     }
 }

Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SingleColumnPalette.java?rev=1451160&r1=1451159&r2=1451160&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
(original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/SingleColumnPalette.java
Thu Feb 28 09:47:38 2013
@@ -27,7 +27,6 @@ import org.apache.wicket.behavior.Behavi
 import org.apache.wicket.extensions.markup.html.form.palette.component.Recorder;
 import org.apache.wicket.extensions.markup.html.form.palette.component.Selection;
 import org.apache.wicket.markup.ComponentTag;
-import org.apache.wicket.markup.MarkupStream;
 import org.apache.wicket.markup.html.form.IChoiceRenderer;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.util.ListModel;
@@ -177,15 +176,15 @@ public class SingleColumnPalette<T> exte
                 attrs.put("ondblclick", "");
                 attrs.remove("multiple");
             }
-
-            @Override
-            public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag
openTag) {
-                SingleColumnPalette.this.nonI18nOnComponentTagBody(markupStream, openTag,
getOptionsIterator());
-            }
         };
     }
 
     @Override
+    protected boolean localizeDisplayValues() {
+        return false;
+    }
+
+    @Override
     protected Component newAvailableHeader(final String componentId) {
         Component availableHeader = super.newAvailableHeader(componentId);
         availableHeader.setVisible(false);

Modified: syncope/branches/1_0_X/parent/pom.xml
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/parent/pom.xml?rev=1451160&r1=1451159&r2=1451160&view=diff
==============================================================================
--- syncope/branches/1_0_X/parent/pom.xml (original)
+++ syncope/branches/1_0_X/parent/pom.xml Thu Feb 28 09:47:38 2013
@@ -283,7 +283,7 @@ under the License.
         
     <cocoon.version>3.0.0-alpha-3</cocoon.version>
 
-    <wicket.version>1.5.9</wicket.version>
+    <wicket.version>1.5.10</wicket.version>
 
     <groovy.version>1.6.9</groovy.version>
 



Mime
View raw message