diff --git a/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java b/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java index 25a8e35..8436def 100644 --- a/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java +++ b/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourceProperties.java @@ -66,7 +66,7 @@ public class TabularResourceProperties extends FramedPanel { private static final String DESCRIPTION_FIELD_HEIGHT = "70px"; private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd"); - + private TabularResourcePropertiesMessages msgs; private EventBus eventBus; private TRId trId; @@ -100,10 +100,13 @@ public class TabularResourceProperties extends FramedPanel { private ArrayList licencesList; + + public TabularResourceProperties(String name, EventBus eventBus) { super(); setId(name); this.eventBus = eventBus; + this.msgs = GWT.create(TabularResourcePropertiesMessages.class); forceLayoutOnResize = true; retrieveLicencesList(); @@ -117,51 +120,72 @@ public class TabularResourceProperties extends FramedPanel { nameField = new TextField(); nameField.setValue(""); - layoutTabularResource.add(new FieldLabel(nameField, "Name"), + FieldLabel nameLabel=new FieldLabel(nameField, msgs.nameLabel()); + nameLabel.setToolTip(msgs.nameLabelToolTip()); + layoutTabularResource.add(nameLabel, new VerticalLayoutData(1, -1)); descriptionField = new TextArea(); descriptionField.setHeight(DESCRIPTION_FIELD_HEIGHT); descriptionField.setValue(""); - layoutTabularResource.add(new FieldLabel(descriptionField, - "Description"), new VerticalLayoutData(1, -1)); + FieldLabel descriptionLabel=new FieldLabel(descriptionField, + msgs.descriptionLabel()); + descriptionLabel.setToolTip(msgs.descriptionLabelToolTip()); + layoutTabularResource.add(descriptionLabel, new VerticalLayoutData(1, -1)); typeField = new TextField(); typeField.setReadOnly(true); typeField.setValue(""); - layoutTabularResource.add(new FieldLabel(typeField, "Type"), + FieldLabel typeLabel= new FieldLabel(typeField, msgs.typeLabel()); + typeLabel.setToolTip(msgs.typeLabelToolTip()); + + layoutTabularResource.add(typeLabel, new VerticalLayoutData(1, -1)); agencyField = new TextField(); agencyField.setValue(""); - layoutTabularResource.add(new FieldLabel(agencyField, "Agency"), + FieldLabel agencyLabel=new FieldLabel(agencyField, msgs.agencyLabel()); + agencyLabel.setToolTip(msgs.agencyLabelToolTip()); + layoutTabularResource.add(agencyLabel, new VerticalLayoutData(1, -1)); dateField = new TextField(); dateField.setReadOnly(true); dateField.setValue(""); - layoutTabularResource.add(new FieldLabel(dateField, "Creation Date"), + FieldLabel dateLabel= new FieldLabel(dateField, msgs.dateLabel()); + dateLabel.setToolTip(msgs.dateLabelToolTip()); + layoutTabularResource.add(dateLabel, new VerticalLayoutData(1, -1)); + tableTypeNameField = new TextField(); tableTypeNameField.setReadOnly(true); tableTypeNameField.setValue(""); - layoutTabularResource.add(new FieldLabel(tableTypeNameField, "Table Type"), + FieldLabel tableTypeNameLabel=new FieldLabel(tableTypeNameField, msgs.tableTypeNameLabel()); + tableTypeNameLabel.setToolTip(msgs.tableTypeNameLabelToolTip()); + layoutTabularResource.add(tableTypeNameLabel, new VerticalLayoutData(1, -1)); rightField = new TextArea(); rightField.setValue(""); - layoutTabularResource.add(new FieldLabel(rightField, "Rights"), + FieldLabel rightLabel=new FieldLabel(rightField, msgs.rightLabel()); + rightLabel.setToolTip(msgs.rightLabelToolTip()); + + layoutTabularResource.add(rightLabel, new VerticalLayoutData(1, -1)); validFromField = new DateField(); - layoutTabularResource.add(new FieldLabel(validFromField, "Valid From"), + FieldLabel validFromLabel=new FieldLabel(validFromField, msgs.validFromLabel()); + validFromLabel.setToolTip(msgs.validFromLabelToolTip()); + layoutTabularResource.add(validFromLabel, new VerticalLayoutData(1, -1)); validUntilToField = new DateField(); - layoutTabularResource.add(new FieldLabel(validUntilToField, - "Valid Until To"), new VerticalLayoutData(1, -1)); + FieldLabel validUntilToLabel= new FieldLabel(validUntilToField, + msgs.validUntilToLabel()); + validUntilToLabel.setToolTip(msgs.validUntilToLabelToolTip()); + layoutTabularResource.add(validUntilToLabel, new VerticalLayoutData(1, -1)); // Combo Licences LicenceDataPropertiesCombo propsLicenceData = GWT @@ -177,14 +201,18 @@ public class TabularResourceProperties extends FramedPanel { comboLicences.setTriggerAction(TriggerAction.ALL); Log.trace("Combo Licence created"); - - layoutTabularResource.add(new FieldLabel(comboLicences, "Licence"), + + FieldLabel licencesLabel=new FieldLabel(comboLicences, msgs.licencesLabel()); + licencesLabel.setToolTip(msgs.licencesLabelToolTip()); + layoutTabularResource.add(licencesLabel, new VerticalLayoutData(1, -1)); // / ownerField = new TextField(); ownerField.setReadOnly(true); ownerField.setValue(""); - layoutTabularResource.add(new FieldLabel(ownerField, "Owner"), + FieldLabel ownerLabel=new FieldLabel(ownerField, msgs.ownerLabel()); + ownerLabel.setToolTip(msgs.ownerLabelToolTip()); + layoutTabularResource.add(ownerLabel, new VerticalLayoutData(1, -1)); btnShare = new IconButton(); @@ -197,7 +225,8 @@ public class TabularResourceProperties extends FramedPanel { } }); - shareLabel = new FieldLabel(btnShare, "Share"); + shareLabel = new FieldLabel(btnShare, msgs.shareLabel()); + shareLabel.setToolTip(msgs.shareLabelToolTip()); shareLabel.setVisible(false); layoutTabularResource.add(shareLabel, new VerticalLayoutData(1, -1)); @@ -206,7 +235,9 @@ public class TabularResourceProperties extends FramedPanel { validField.setValue(false); validField.setReadOnly(true); validField.setEnabled(false); - layoutTabularResource.add(new FieldLabel(validField, "Valid"), + FieldLabel validLabel=new FieldLabel(validField, msgs.validLabel()); + validLabel.setToolTip(msgs.validLabelToolTip()); + layoutTabularResource.add(validLabel, new VerticalLayoutData(1, -1, new Margins(0))); finalizedField = new CheckBox(); @@ -222,14 +253,17 @@ public class TabularResourceProperties extends FramedPanel { } } }); - layoutTabularResource.add(new FieldLabel(finalizedField, "Final"), + + FieldLabel finalizedLabel=new FieldLabel(finalizedField, msgs.finalizedLabel()); + finalizedLabel.setToolTip(msgs.finalizedLabelToolTip()); + layoutTabularResource.add(finalizedLabel, new VerticalLayoutData(1, -1, new Margins(0))); // Save Button - saveButton = new TextButton("Save"); + saveButton = new TextButton(msgs.saveButton()); saveButton.setIcon(ResourceBundle.INSTANCE.save()); saveButton.setIconAlign(IconAlign.RIGHT); - saveButton.setTitle("Save"); + saveButton.setToolTip(msgs.saveButtonToolTip()); SelectHandler saveHandler = new SelectHandler() { public void onSelect(SelectEvent event) { @@ -240,10 +274,10 @@ public class TabularResourceProperties extends FramedPanel { saveButton.addSelectHandler(saveHandler); // Validation Button - validationsButton = new TextButton("Validations"); + validationsButton = new TextButton(msgs.validationsButton()); validationsButton.setIcon(ResourceBundle.INSTANCE.tableValidation()); validationsButton.setIconAlign(IconAlign.RIGHT); - validationsButton.setTitle("Validations"); + validationsButton.setToolTip(msgs.validationsButtonToolTip()); SelectHandler validationsHandler = new SelectHandler() { @@ -255,10 +289,10 @@ public class TabularResourceProperties extends FramedPanel { validationsButton.addSelectHandler(validationsHandler); // Resources Button - resourcesButton = new TextButton("Resources"); + resourcesButton = new TextButton(msgs.resourcesButton()); resourcesButton.setIcon(ResourceBundle.INSTANCE.resources()); resourcesButton.setIconAlign(IconAlign.RIGHT); - resourcesButton.setTitle("Resources"); + resourcesButton.setToolTip(msgs.resourcesButtonToolTip()); SelectHandler resourcesHandler = new SelectHandler() { diff --git a/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages.java b/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages.java new file mode 100644 index 0000000..655d7d9 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages.java @@ -0,0 +1,117 @@ +package org.gcube.portlets.user.td.informationwidget.client; + +import com.google.gwt.i18n.client.Messages; + +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ +public interface TabularResourcePropertiesMessages extends Messages { + + // + @DefaultMessage("Name") + String nameLabel(); + + @DefaultMessage("Name of tabular resource") + String nameLabelToolTip(); + + @DefaultMessage("Description") + String descriptionLabel(); + + @DefaultMessage("Description of tabular resource") + String descriptionLabelToolTip(); + + @DefaultMessage("Type") + String typeLabel(); + + @DefaultMessage("Type of tabular resource") + String typeLabelToolTip(); + + @DefaultMessage("Agency") + String agencyLabel(); + + @DefaultMessage("Agency") + String agencyLabelToolTip(); + + @DefaultMessage("Creation Date") + String dateLabel(); + + @DefaultMessage("Creation Date") + String dateLabelToolTip(); + + @DefaultMessage("Table Type") + String tableTypeNameLabel(); + + @DefaultMessage("Table Type") + String tableTypeNameLabelToolTip(); + + @DefaultMessage("Rights") + String rightLabel(); + + @DefaultMessage("Rights") + String rightLabelToolTip(); + + @DefaultMessage("Valid From") + String validFromLabel(); + + @DefaultMessage("Valid From") + String validFromLabelToolTip(); + + @DefaultMessage("Valid Until To") + String validUntilToLabel(); + + @DefaultMessage("Valid Until To") + String validUntilToLabelToolTip(); + + @DefaultMessage("Licence") + String licencesLabel(); + + @DefaultMessage("Licence") + String licencesLabelToolTip(); + + @DefaultMessage("Owner") + String ownerLabel(); + + @DefaultMessage("Owner") + String ownerLabelToolTip(); + + @DefaultMessage("Share") + String shareLabel(); + + @DefaultMessage("Share") + String shareLabelToolTip(); + + @DefaultMessage("Valid") + String validLabel(); + + @DefaultMessage("Valid") + String validLabelToolTip(); + + @DefaultMessage("Final") + String finalizedLabel(); + + @DefaultMessage("Final") + String finalizedLabelToolTip(); + + @DefaultMessage("Save") + String saveButton(); + + @DefaultMessage("Save") + String saveButtonToolTip(); + + @DefaultMessage("Validations") + String validationsButton(); + + @DefaultMessage("Validations") + String validationsButtonToolTip(); + + @DefaultMessage("Resources") + String resourcesButton(); + + @DefaultMessage("Resources") + String resourcesButtonToolTip(); + + +} \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/informationwidget/Information.gwt.xml b/src/main/resources/org/gcube/portlets/user/td/informationwidget/Information.gwt.xml index 58b9942..d3850f7 100644 --- a/src/main/resources/org/gcube/portlets/user/td/informationwidget/Information.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/td/informationwidget/Information.gwt.xml @@ -2,18 +2,13 @@ + - - - - - - - + @@ -22,6 +17,25 @@ + + + + + + + + + + + + + + diff --git a/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/Messages.properties b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/Messages.properties deleted file mode 100644 index c222555..0000000 --- a/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/Messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -sendButton = Send -nameField = Enter your name \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/Messages_fr.properties b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/Messages_fr.properties deleted file mode 100644 index b4a7627..0000000 --- a/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/Messages_fr.properties +++ /dev/null @@ -1,2 +0,0 @@ -sendButton = Envoyer -nameField = Entrez votre nom \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages.properties b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages.properties new file mode 100644 index 0000000..cec1fba --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages.properties @@ -0,0 +1,34 @@ +nameLabel = Name +nameLabelToolTip = Name of tabular resource +descriptionLabel = Description +descriptionLabelToolTip = Description of tabular resource +typeLabel = Type +typeLabelToolTip = Type of tabular resource +agencyLabel = Agency +agencyLabelToolTip = Agency +dateLabel = Creation Date +dateLabelToolTip = Creation Date +tableTypeNameLabel = Table Type +tableTypeNameLabelToolTip = Table Type +rightLabel = Rights +rightLabelToolTip = Rights +validFromLabel = Valid From +validFromLabelToolTip = Valid From +validUntilToLabel = Valid Until To +validUntilToLabelToolTip = Valid Until To +licencesLabel = Licence +licencesLabelToolTip = Licence +ownerLabel = Owner +ownerLabelToolTip = Owner +shareLabel = Share +shareLabelToolTip = Share +validLabel = Valid +validLabelToolTip = Valid +finalizedLabel = Final +finalizedLabelToolTip = Final +saveButton = Save +saveButtonToolTip = Save +validationsButton = Validations +validationsButtonToolTip = Validations +resourcesButton = Resources +resourcesButtonToolTip = Resources \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages_es.properties new file mode 100644 index 0000000..60d3fd6 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages_es.properties @@ -0,0 +1,34 @@ +nameLabel = Nombre +nameLabelToolTip = Nombre de la tabular resource +descriptionLabel = Descripción +descriptionLabelToolTip = Descripción de la tabular resource +typeLabel = Tipo +typeLabelToolTip = Tipo de tabular resource +agencyLabel = Agencia +agencyLabelToolTip = Agencia +dateLabel = Fecha Creacion +dateLabelToolTip = Fecha Creacion +tableTypeNameLabel = Tipo Tabla +tableTypeNameLabelToolTip = Tipo Tabla +rightLabel = Derechos +rightLabelToolTip = Derechos +validFromLabel = Válida Desde +validFromLabelToolTip = Válida Desde +validUntilToLabel = Válido Hasta +validUntilToLabelToolTip = Válido Hasta +licencesLabel = Licencia +licencesLabelToolTip = Licencia +ownerLabel = Propietario +ownerLabelToolTip = Propietario +shareLabel = Cuota +shareLabelToolTip = Cuota +validLabel = Válido +validLabelToolTip = Válido +finalizedLabel = Final +finalizedLabelToolTip = Final +saveButton = Guardar +saveButtonToolTip = Guardar +validationsButton = Validaciones +validationsButtonToolTip = Validaciones +resourcesButton = Recursos +resourcesButtonToolTip = Recursos \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages_it.properties new file mode 100644 index 0000000..b4de1be --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/informationwidget/client/TabularResourcePropertiesMessages_it.properties @@ -0,0 +1,34 @@ +nameLabel = Nome +nameLabelToolTip = Nome della tabular resource +descriptionLabel = Descrizione +descriptionLabelToolTip = Descrizione della tabular resource +typeLabel = Tipo +typeLabelToolTip = Tipo di tabular resource +agencyLabel = Agenzia +agencyLabelToolTip = Agenzia +dateLabel = Data Creazione +dateLabelToolTip = Data Creazione +tableTypeNameLabel = Tipo Tabella +tableTypeNameLabelToolTip = Tipo Tabella +rightLabel = Diritti +rightLabelToolTip = Diritti +validFromLabel = Valida Da +validFromLabelToolTip = Valida Da +validUntilToLabel = Valida Fino Al +validUntilToLabelToolTip = Valida Fino Al +licencesLabel = Licenza +licencesLabelToolTip = Licenza +ownerLabel = Proprietario +ownerLabelToolTip = Proprietario +shareLabel = Condivisione +shareLabelToolTip = Condivisione +validLabel = Valida +validLabelToolTip = Valida +finalizedLabel = Finale +finalizedLabelToolTip = Finale +saveButton = Salva +saveButtonToolTip = Salva +validationsButton = Validazioni +validationsButtonToolTip = Validazioni +resourcesButton = Risorse +resourcesButtonToolTip = Risorse \ No newline at end of file