diff --git a/src/main/java/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml b/src/main/java/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml index 68e6fb1..3ee1ab4 100644 --- a/src/main/java/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml +++ b/src/main/java/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml @@ -2,6 +2,7 @@ + @@ -11,18 +12,39 @@ + + + + + + + + + + + + + + + - + - + - + - + + diff --git a/src/main/java/org/gcube/portlets/user/tdwx/client/filter/text/TextMenu.java b/src/main/java/org/gcube/portlets/user/tdwx/client/filter/text/TextMenu.java index e257fd5..4999a08 100644 --- a/src/main/java/org/gcube/portlets/user/tdwx/client/filter/text/TextMenu.java +++ b/src/main/java/org/gcube/portlets/user/tdwx/client/filter/text/TextMenu.java @@ -6,6 +6,7 @@ import java.util.List; import org.gcube.portlets.user.tdwx.client.resources.ResourceBundle; +import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Style.Cursor; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.resources.client.ImageResource; @@ -51,7 +52,9 @@ public class TextMenu extends Menu { } protected TextField ct, bg, en, sd; - + private TextMenuMessages msgs; + + private TextFilter filter; private List textItems = new ArrayList(); private DelayedTask updateTask = new DelayedTask() { @@ -62,6 +65,8 @@ public class TextMenu extends Menu { } }; + + /** * Creates text menu for use with the specified text filter. * @@ -70,7 +75,8 @@ public class TextMenu extends Menu { */ public TextMenu(TextFilter filter) { this.filter = filter; - + this.msgs = GWT.create(TextMenuMessages.class); + addBeforeHideHandler(new BeforeHideHandler() { @Override @@ -181,27 +187,28 @@ public class TextMenu extends Menu { String toolTip = null; for (TextItem item : textItems) { TextField field = createTextField(); - field.setEmptyText(filter.getMessages().emptyText()); - + field.setEmptyText(msgs.enterFilterText()); + switch (item) { case CONTAINS: + icon = ResourceBundle.INSTANCE.textContains(); - toolTip = new String("Text Contains"); + toolTip = new String(msgs.textContains()); ct = field; break; case BEGINS: icon = ResourceBundle.INSTANCE.textBegins(); - toolTip = new String("Text Begins"); + toolTip = new String(msgs.textBegins()); bg = field; break; case ENDS: icon = ResourceBundle.INSTANCE.textEnds(); - toolTip = new String("Text Ends"); + toolTip = new String(msgs.textEnds()); en = field; break; case SOUNDEX: icon = ResourceBundle.INSTANCE.textSoundex(); - toolTip = new String("Soundex Algorithm"); + toolTip = new String(msgs.soundexAlgorithm()); sd = field; break; diff --git a/src/main/java/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages.java b/src/main/java/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages.java new file mode 100644 index 0000000..9611ad2 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages.java @@ -0,0 +1,30 @@ +package org.gcube.portlets.user.tdwx.client.filter.text; + +import com.google.gwt.i18n.client.Messages; + +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ +public interface TextMenuMessages extends Messages { + + // + @DefaultMessage("Enter filter text...") + String enterFilterText(); + + @DefaultMessage("Text Contains") + String textContains(); + + @DefaultMessage("Text Begins") + String textBegins(); + + @DefaultMessage("Text Ends") + String textEnds(); + + @DefaultMessage("Soundex Algorithm") + String soundexAlgorithm(); + + +} \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml b/src/main/resources/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml index 32a145b..2d0a80d 100644 --- a/src/main/resources/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/tdwx/TabularDataWidgetX.gwt.xml @@ -2,6 +2,7 @@ + @@ -10,18 +11,38 @@ + + + + + + + + + + + + + + - + - + - + - + + diff --git a/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages.properties b/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages.properties new file mode 100644 index 0000000..a1769e7 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages.properties @@ -0,0 +1,5 @@ +enterFilterText = Enter filter text... +textContains = Text Contains +textBegins = Text Begins +textEnds = Text Ends +soundexAlgorithm = Soundex Algorithm \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages_es.properties b/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages_es.properties new file mode 100644 index 0000000..cfb9e46 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages_es.properties @@ -0,0 +1,5 @@ +enterFilterText = Inserte un filtro... +textContains = Contiene +textBegins = Comienza +textEnds = Termina +soundexAlgorithm = Algoritmo Soundex \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages_it.properties b/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages_it.properties new file mode 100644 index 0000000..aaa60a8 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/tdwx/client/filter/text/TextMenuMessages_it.properties @@ -0,0 +1,5 @@ +enterFilterText = Inserire del testo come filtro... +textContains = Contiene +textBegins = Inizia +textEnds = Finisce +soundexAlgorithm = Algoritmo Soundex \ No newline at end of file