diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.java index 7f60b32..914aed0 100644 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.java +++ b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.java @@ -16,12 +16,6 @@ public interface TDOpenMessages extends Messages { @DefaultMessage("Select a Tabular Resource") String tabResourcesSelectionCardSelectLabel(); - - @DefaultMessage("Search") - String buttonSearchLabel(); - - @DefaultMessage("Reload") - String buttonReloadLabel(); @DefaultMessage("Name") String tabResourcesSelectionPanelColumnNameLabel(); @@ -50,5 +44,14 @@ public interface TDOpenMessages extends Messages { @DefaultMessage("Info") String tabResourcesSelectionPanelContextMenuInfo(); + @DefaultMessage("Tabular Resource is locked no info available!") + String attentionTabularResourceIsLockedNoInfoAvailable(); + + @DefaultMessage("Delete") + String deleteHead(); + + @DefaultMessage("Would you like to delete this tabular resource?") + String questionWouldYouLikeToDeleteThisTabularResource(); + } diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java index fe7e6cf..edbf6a6 100644 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/openwidget/client/TabResourcesSelectionPanel.java @@ -12,6 +12,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedExcep import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; import org.gcube.portlets.user.td.openwidget.client.resources.ResourceBundleTDOpen; +import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages; import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent; import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType; @@ -88,8 +89,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements } + private CommonMessages msgsCommon; + private TDOpenMessages msgs; - private Grid grid; private ResourceBundle res; private Menu contextMenu; @@ -97,16 +99,18 @@ public class TabResourcesSelectionPanel extends ContentPanel implements private TabResource removableTR; private TabResourcesSelectionCard parent; - private TDOpenMessages msgsTDOpen; + + public TabResourcesSelectionPanel(TabResourcesSelectionCard parent, ResourceBundle res) { this.res = res; this.parent = parent; - this.msgsTDOpen = GWT.create(TDOpenMessages.class); - Log.debug("TabResourcesSelectionPanel"); - init(); + + initMessages(); + initWindow(); + try { createContextMenu(); } catch (Throwable e) { @@ -121,22 +125,27 @@ public class TabResourcesSelectionPanel extends ContentPanel implements e.printStackTrace(); } } + + protected void initMessages(){ + msgs = GWT.create(TDOpenMessages.class); + msgsCommon = GWT.create(CommonMessages.class); + } - protected void init() { + protected void initWindow() { setHeaderVisible(false); } protected void buildPanel() { ToolBar toolBar = new ToolBar(); - toolBar.add(new LabelToolItem(msgsTDOpen.buttonSearchLabel()+": ")); + toolBar.add(new LabelToolItem(msgsCommon.toolItemSearchLabel())); final TextField searchField = new TextField(); toolBar.add(searchField); TextButton btnReload = new TextButton(); // btnReload.setText("Reload"); btnReload.setIcon(res.refresh16()); - btnReload.setToolTip(msgsTDOpen.buttonReloadLabel()); + btnReload.setToolTip(msgsCommon.toolItemReloadLabel()); toolBar.add(btnReload); IdentityValueProvider identity = new IdentityValueProvider(); @@ -171,19 +180,19 @@ public class TabResourcesSelectionPanel extends ContentPanel implements store.setEnableFilters(true); ColumnConfig nameColumn = new ColumnConfig( - properties.name(), 90, msgsTDOpen.tabResourcesSelectionPanelColumnNameLabel()); + properties.name(), 90, msgs.tabResourcesSelectionPanelColumnNameLabel()); ColumnConfig typeColumn = new ColumnConfig( - properties.tabResourceType(), 30, msgsTDOpen.tabResourcesSelectionPanelColumnTypeLabel()); + properties.tabResourceType(), 30, msgs.tabResourcesSelectionPanelColumnTypeLabel()); ColumnConfig tableTypeNameColumn = new ColumnConfig( - properties.tableTypeName(), 30, msgsTDOpen.tabResourcesSelectionPanelColumnTableTypeLabel()); + properties.tableTypeName(), 30, msgs.tabResourcesSelectionPanelColumnTableTypeLabel()); ColumnConfig lockedColumn = new ColumnConfig( - properties.locked(), 20, msgsTDOpen.tabResourcesSelectionPanelColumnLockLabel()); + properties.locked(), 20, msgs.tabResourcesSelectionPanelColumnLockLabel()); ColumnConfig agencyColumn = new ColumnConfig( - properties.agency(), 60, msgsTDOpen.tabResourcesSelectionPanelColumnAgencyLabel()); + properties.agency(), 60, msgs.tabResourcesSelectionPanelColumnAgencyLabel()); ColumnConfig ownerColumn = new ColumnConfig( - properties.ownerLogin(), 70, msgsTDOpen.tabResourcesSelectionPanelColumnOwnerLabel()); + properties.ownerLogin(), 70, msgs.tabResourcesSelectionPanelColumnOwnerLabel()); ColumnConfig dateColumn = new ColumnConfig( - properties.date(), 50, msgsTDOpen.tabResourcesSelectionPanelColumnCreationDateLabel()); + properties.date(), 50, msgs.tabResourcesSelectionPanelColumnCreationDateLabel()); dateColumn.setCell(new DateCell(sdf)); @@ -299,7 +308,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements protected void createContextMenu() { contextMenu = new Menu(); - MenuItem deleteTRItem = new MenuItem(msgsTDOpen.tabResourcesSelectionPanelContextMenuDelete()); + MenuItem deleteTRItem = new MenuItem(msgs.tabResourcesSelectionPanelContextMenuDelete()); deleteTRItem.setId("DeleteTR"); deleteTRItem.setIcon(ResourceBundleTDOpen.INSTANCE.delete()); deleteTRItem.addSelectionHandler(new SelectionHandler() { @@ -316,7 +325,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements contextMenu.add(deleteTRItem); MenuItem infoItem = new MenuItem(); - infoItem.setText(msgsTDOpen.tabResourcesSelectionPanelContextMenuInfo()); + infoItem.setText(msgs.tabResourcesSelectionPanelContextMenuInfo()); infoItem.setIcon(ResourceBundleTDOpen.INSTANCE.information()); infoItem.addSelectionHandler(new SelectionHandler() { @@ -342,8 +351,8 @@ public class TabResourcesSelectionPanel extends ContentPanel implements protected void requestInfo(TabResource tabResource) { if (tabResource.isLocked()) { - UtilsGXT3.alert("Attention", - "Tabular Resource is locked no info available!"); + UtilsGXT3.alert(msgsCommon.attention(), + msgs.attentionTabularResourceIsLockedNoInfoAvailable()); return; } @@ -365,14 +374,14 @@ public class TabResourcesSelectionPanel extends ContentPanel implements if (caught instanceof TDGWTIsLockedException) { Log.error("Tabular Resource is Locked: " + caught.getLocalizedMessage()); - parent.showErrorAndHide("Error", + parent.showErrorAndHide(msgsCommon.errorLocked(), caught.getLocalizedMessage(), "", caught); } else { Log.error("Error: " + caught.getLocalizedMessage()); - parent.showErrorAndHide("Error", + parent.showErrorAndHide(msgsCommon.error(), caught.getLocalizedMessage(), "", caught); @@ -418,7 +427,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements } else { Log.error("Error retrieving tabular resource: " + caught.getLocalizedMessage()); - parent.showErrorAndHide("Error", + parent.showErrorAndHide(msgsCommon.error(), caught.getLocalizedMessage(), "", caught); } callback.onFailure(caught); @@ -471,8 +480,8 @@ public class TabResourcesSelectionPanel extends ContentPanel implements protected void deleteTR(TabResource tabResource) { removableTR = tabResource; - final ConfirmMessageBox mb = new ConfirmMessageBox("Delete", - "Would you like to delete this tabular resource?"); + final ConfirmMessageBox mb = new ConfirmMessageBox(msgs.deleteHead(), + msgs.questionWouldYouLikeToDeleteThisTabularResource()); // Next in GXT 3.1.1 mb.addDialogHideHandler(new DialogHideHandler() { @@ -519,13 +528,13 @@ public class TabResourcesSelectionPanel extends ContentPanel implements } else { if (caught instanceof TDGWTIsLockedException) { Log.error(caught.getLocalizedMessage()); - UtilsGXT3.alert("Error Locked", + UtilsGXT3.alert(msgsCommon.errorLocked(), caught.getLocalizedMessage()); } else { Log.error("Error on delete TabResource: " + caught.getLocalizedMessage()); - UtilsGXT3.alert("Error", + UtilsGXT3.alert(msgsCommon.error(), caught.getLocalizedMessage()); } } diff --git a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.properties b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.properties index 309ded6..c9a6591 100644 --- a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.properties +++ b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages.properties @@ -8,5 +8,9 @@ tabResourcesSelectionPanelColumnTableTypeLabel = Table Type tabResourcesSelectionPanelColumnLockLabel = Lock tabResourcesSelectionPanelColumnAgencyLabel = Agency tabResourcesSelectionPanelColumnOwnerLabel = Owner +tabResourcesSelectionPanelColumnCreationDateLabel = Creation Date tabResourcesSelectionPanelContextMenuDelete = Delete tabResourcesSelectionPanelContextMenuInfo = Info +attentionTabularResourceIsLockedNoInfoAvailable = Tabular Resource is locked no info available! +deleteHead = Delete +questionWouldYouLikeToDeleteThisTabularResource = Would you like to delete this tabular resource? diff --git a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_es.properties index eb64594..3e8f045 100644 --- a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_es.properties +++ b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_es.properties @@ -8,5 +8,9 @@ tabResourcesSelectionPanelColumnTableTypeLabel = Tipo Tabla tabResourcesSelectionPanelColumnLockLabel = Lock tabResourcesSelectionPanelColumnAgencyLabel = Agencia tabResourcesSelectionPanelColumnOwnerLabel = Propietario +tabResourcesSelectionPanelColumnCreationDateLabel = Fecha Creacion tabResourcesSelectionPanelContextMenuDelete = Borrar tabResourcesSelectionPanelContextMenuInfo = Información +attentionTabularResourceIsLockedNoInfoAvailable = La Tabular Resource es locked no hay información disponible! +deleteHead = Borrar +questionWouldYouLikeToDeleteThisTabularResource = Seguro que quieres eliminar esta Tabular Resource? diff --git a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_it.properties index 225038d..08f3413 100644 --- a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_it.properties +++ b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TDOpenMessages_it.properties @@ -7,6 +7,10 @@ tabResourcesSelectionPanelColumnTypeLabel = Tipo tabResourcesSelectionPanelColumnTableTypeLabel = Tipo Tabella tabResourcesSelectionPanelColumnLockLabel = Lock tabResourcesSelectionPanelColumnAgencyLabel = Agenzia -tabResourcesSelectionPanelColumnOwnerLabel = Propietario +tabResourcesSelectionPanelColumnOwnerLabel = Proprietario +tabResourcesSelectionPanelColumnCreationDateLabel = Data Creazione tabResourcesSelectionPanelContextMenuDelete = Elimina tabResourcesSelectionPanelContextMenuInfo = Informazioni +attentionTabularResourceIsLockedNoInfoAvailable = La Tabular Resource è locked nessuna informazione disponibile! +deleteHead = Elimina +questionWouldYouLikeToDeleteThisTabularResource = Sei sicuro di voler eliminare questa Tabular Resource? diff --git a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages.properties b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages.properties index a79440d..bf715c9 100644 --- a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages.properties +++ b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages.properties @@ -17,7 +17,7 @@ rightLabel = Rights rightLabelToolTip = Rights validFromLabel = Valid From validFromLabelToolTip = Valid From -validUntilToLabel = valid Until To +validUntilToLabel = Valid Until To validUntilToLabelToolTip = Valid Until To licencesLabel = Licence licencesLabelToolTip = Licence diff --git a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages_es.properties index 1be6902..714dbac 100644 --- a/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages_es.properties +++ b/src/main/resources/org/gcube/portlets/user/td/openwidget/client/TabResourcesInfoDialogMessages_es.properties @@ -17,8 +17,8 @@ rightLabel = Derechos rightLabelToolTip = Derechos validFromLabel = Válida Desde validFromLabelToolTip = Válida Desde -validUntilToLabel = Válido Hasta -validUntilToLabelToolTip = Válido Hasta +validUntilToLabel = Válida Hasta +validUntilToLabelToolTip = Válida Hasta licencesLabel = Licencia licencesLabelToolTip = Licencia ownerLabel = Propietario