diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java index 84d59ef..9891eb4 100644 --- a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java @@ -1,31 +1,45 @@ package org.gcube.portlets.user.td.toolboxwidget.client.help; + + +import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3; +import org.gcube.portlets.user.td.toolboxwidget.client.resources.ResourceBundle; + +import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ResourceCallback; +import com.google.gwt.resources.client.ResourceException; +import com.google.gwt.resources.client.TextResource; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.HTML; import com.google.web.bindery.event.shared.EventBus; +import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign; import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.widget.core.client.FramedPanel; +import com.sencha.gxt.widget.core.client.button.TextButton; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; +import com.sencha.gxt.widget.core.client.event.SelectEvent; +import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler; import com.sencha.gxt.widget.core.client.form.FieldSet; /** * - * @author giancarlo - * email: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ public class HelpPanel extends FramedPanel { private HelpPanelMessages msgs; - //private String headingTitle; - //private HashMap tabularResourcePropertiesMap; + // private String headingTitle; + // private HashMap tabularResourcePropertiesMap; private VerticalLayoutContainer vl; - //private EventBus eventBus; + // private EventBus eventBus; private FieldSet contents; private VerticalLayoutContainer layoutCaptions; - + private TextButton wikiButton; public HelpPanel(String name, EventBus eventBus) { super(); @@ -40,11 +54,9 @@ public class HelpPanel extends FramedPanel { this.add(vl); } - - - + public void addContents() { - HTML title = new HTML("

"+msgs.helpPanelTitle()+"

"); + HTML title = new HTML("

" + msgs.helpPanelTitle() + "

"); vl.add(title, new VerticalLayoutData(-1, -1, new Margins(1, 1, 10, 1))); contents = new FieldSet(); @@ -56,44 +68,60 @@ public class HelpPanel extends FramedPanel { contents.add(layoutCaptions); HTML info = new HTML(msgs.info()); - layoutCaptions - .add(info, new VerticalLayoutData(1, -1, new Margins(1))); + wikiButton = new TextButton(msgs.wikiButton()); + wikiButton.setIcon(ResourceBundle.INSTANCE.wiki()); + wikiButton.setIconAlign(IconAlign.RIGHT); + wikiButton.setToolTip(msgs.wikiButtonToolTip()); + SelectHandler wikiHandler = new SelectHandler() { - + public void onSelect(SelectEvent event) { + onWiki(); + } + }; + wikiButton.addSelectHandler(wikiHandler); + + layoutCaptions.add(info, new VerticalLayoutData(1, -1, new Margins(1))); + layoutCaptions.add(wikiButton, new VerticalLayoutData(-1, -1, + new Margins(1))); vl.add(contents, new VerticalLayoutData(1, -1, new Margins(1))); } - /* - * protected void getLastTable(TRId trId) { TDGWTServiceAsync.INSTANCE - * .getLastTable(trId,new AsyncCallback() { - * - * public void onSuccess(TableData result) { updateTable(result); - * Log.info("Retrived LastTable:" + result.getName()); - * - * } - * - * public void onFailure(Throwable caught) { AlertMessageBox d = new - * AlertMessageBox("Error", "Error retrienving Last Table: " + - * caught.getLocalizedMessage()); d.addHideHandler(new HideHandler() { - * - * public void onHide(HideEvent event) { // - * - * } - * - * }); d.show(); - * - * } - * - * }); } - */ + private void onWiki() { + try { + ResourceBundle.INSTANCE.linksProperties().getText( + new ResourceCallback() { + public void onError(ResourceException e) { + Log.error("Error retrieving wiki link!: " + + e.getLocalizedMessage()); + UtilsGXT3.alert("Error", + "Error retrieving wiki link!"); + } + + public void onSuccess(TextResource r) { + openWiki(r); + } + }); + } catch (ResourceException e) { + Log.error("Error retrieving wiki link!: " + e.getLocalizedMessage()); + UtilsGXT3.alert("Error", "Error retrieving wiki link!"); + e.printStackTrace(); + + } + + } + + private void openWiki(TextResource r) { + String s = r.getText(); + Window.open(s, + "Tabular Data Manager Wiki", ""); + + } public void initInformation() { addContents(); } - - } diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java index a554363..1e10df8 100644 --- a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java +++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java @@ -21,4 +21,11 @@ public interface HelpPanelMessages extends Messages { String info(); + @DefaultMessage("Wiki") + String wikiButton(); + + @DefaultMessage("Tabular Data Manager Wiki") + String wikiButtonToolTip(); + + } \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/ResourceBundle.java b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/ResourceBundle.java new file mode 100644 index 0000000..cd09686 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/ResourceBundle.java @@ -0,0 +1,32 @@ +package org.gcube.portlets.user.td.toolboxwidget.client.resources; + + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.ExternalTextResource; +import com.google.gwt.resources.client.ImageResource; + + +/** + * Resource Bundle + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface ResourceBundle extends ClientBundle { + + public static final ResourceBundle INSTANCE=GWT.create(ResourceBundle.class); + + + @Source("wiki_link.txt") + ExternalTextResource linksProperties(); + + @Source("tabular-data-wiki.png") + ImageResource wiki(); + + @Source("tabular-data-wiki_32.png") + ImageResource wiki32(); + + +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png new file mode 100644 index 0000000..a5f514e Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png differ diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png new file mode 100644 index 0000000..450b5c3 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png differ diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt new file mode 100644 index 0000000..b3b826d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt @@ -0,0 +1 @@ +http://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties index 760d333..c727c37 100644 --- a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties +++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties @@ -8,4 +8,6 @@ Tabular Resource are used in many domains ranging from statistics to signal proc and econometrics. Tabular Data Manager offers a rich set of facilities ranging \ from those supporting the assessment of data correctness to those supporting \ the verification of the compliance of data with given code lists, \ -the aggregation and filtering of data.

\ No newline at end of file +the aggregation and filtering of data.

+wikiButton=Wiki +wikiButtonToolTip=Tabular Data Manager Wiki \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties index 50cd162..1fa5165 100644 --- a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties +++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties @@ -8,4 +8,6 @@ de un determinado evento o fenómeno en diferentes intervalos de tiempo. \ y econometría. Tabular Data Manager ofrece un amplio conjunto de servicios que van \ por quienes soliciten la evaluación de la corrección de datos a los que apoyan \ la verificación del cumplimiento de los datos con listas de códigos dados, \ -la agregación y filtrado de datos.

\ No newline at end of file +la agregación y filtrado de datos.

+wikiButton=Wiki +wikiButtonToolTip=Tabular Data Manager Wiki \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties index 7991bd7..3630f3a 100644 --- a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties +++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties @@ -9,4 +9,6 @@ Le Tabular Resources sono usate in molti domini, nella statistica, nel e nell''econometria. Tabular Data Manager offre un ricco insieme di strumenti sia \ quelli di sostegno alla valutazione della correttezza dei dati, sia quelli di supporto \ alla verifica della conformità dei dati con determinate codelist e sia quelli per \ -l''aggregazione ed il filtro dei dati.

\ No newline at end of file +l''aggregazione ed il filtro dei dati.

+wikiButton=Wiki +wikiButtonToolTip=Tabular Data Manager Wiki \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png new file mode 100644 index 0000000..a5f514e Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png new file mode 100644 index 0000000..450b5c3 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt new file mode 100644 index 0000000..b3b826d --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt @@ -0,0 +1 @@ +http://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager \ No newline at end of file