915: TDM - Support the Spanish language

Task-Url: https://support.d4science.org/issues/915

Updated Spanish Support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-resources-widget@120079 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-28 17:45:18 +00:00
parent ee70c75a57
commit 45bd3fd972
22 changed files with 399 additions and 123 deletions

View File

@ -147,22 +147,23 @@ public class ResourcesListViewPanel extends FramedPanel {
}
}
enum ResourcesSortInfo {
public enum ResourcesSortInfo {
Name("Name"), CreationDate("Creation Date");
private static ResourcesMessages msgs=GWT.create(ResourcesMessages.class);
private String id;
private static List<String> resourcesSortInfoStringList;
private static List<String> resourcesSortInfoI18NList;
static {
resourcesSortInfoStringList = new ArrayList<String>();
resourcesSortInfoI18NList = new ArrayList<String>();
for (ResourcesSortInfo r : values()) {
resourcesSortInfoStringList.add(r.getId());
resourcesSortInfoI18NList.add(msgs.resourceSortInfo(r));
}
}
private ResourcesSortInfo(String id) {
this.id = id;
this.id = id;
}
public String getId() {
@ -172,17 +173,22 @@ public class ResourcesListViewPanel extends FramedPanel {
public String toString() {
return id;
}
public String getIdI18N(){
return msgs.resourceSortInfo(this);
}
public static List<ResourcesSortInfo> asList() {
List<ResourcesSortInfo> list = Arrays.asList(values());
return list;
}
public static List<String> asStringList() {
return resourcesSortInfoStringList;
public static List<String> asI18NList() {
return resourcesSortInfoI18NList;
}
}
private ResourcesListViewDetailPanel details;
@ -268,10 +274,10 @@ public class ResourcesListViewPanel extends FramedPanel {
ResourceTDDescriptor o2) {
String v = comboSort.getCurrentValue();
if (v.equals("Name")) {
if (v.equals(ResourcesSortInfo.Name.getIdI18N())) {
return o1.getName().compareToIgnoreCase(
o2.getName());
} else if (v.equals("Creation Date")) {
} else if (v.equals(ResourcesSortInfo.CreationDate.getIdI18N())) {
return o1.getCreationDate().compareTo(
o2.getCreationDate());
@ -320,8 +326,8 @@ public class ResourcesListViewPanel extends FramedPanel {
comboSort.setEditable(false);
comboSort.setForceSelection(true);
comboSort.setWidth(120);
comboSort.add(ResourcesSortInfo.asStringList());
comboSort.setValue(ResourcesSortInfo.CreationDate.getId());
comboSort.add(ResourcesSortInfo.asI18NList());
comboSort.setValue(ResourcesSortInfo.CreationDate.getIdI18N());
comboSort.addSelectionHandler(new SelectionHandler<String>() {
@Override

View File

@ -9,16 +9,16 @@ import com.google.gwt.i18n.client.Messages;
*
*/
public interface ResourcesMessages extends Messages {
@DefaultMessage("Resources List View")
String resourcesListViewDialogHead();
@DefaultMessage("Filter:")
String toolBarFilterLabel();
@DefaultMessage("Sort By:")
String toolBarSortBy();
@DefaultMessage("Error retrieving resources")
String errorRetrievingResourcesHead();
@ -27,96 +27,99 @@ public interface ResourcesMessages extends Messages {
@DefaultMessage("No Resource")
String statusBarNoResource();
@DefaultMessage("Open")
String itemOpenText();
@DefaultMessage("Save")
String itemSaveText();
@DefaultMessage("Delete")
String itemDeleteText();
@DefaultMessage("Save Resource")
String saveResourceWizardHead();
@DefaultMessage("Error removing the resource: ")
String errorRemovingTheResource();
@DefaultMessage("Error retrieving uri from resolver!")
String errorRetrievingURIFromResolver();
@DefaultMessage("Error no valid InternalUri!")
String errorNoValidInternalUri();
@DefaultMessage("Name")
String nameLabel();
@DefaultMessage("Description")
String descriptionLabel();
@DefaultMessage("Creation Date")
String creationDateLabel();
@DefaultMessage("Open")
String btnOpenText();
@DefaultMessage("Open")
String btnOpenToolTip();
@DefaultMessage("Delete")
String btnDeleteText();
@DefaultMessage("Delete")
String btnDeleteToolTip();
@DefaultMessage("Resources")
String resourcesDialogHead();
@DefaultMessage("Error retrieving User Info")
String errorRetrievingUserInfo();
@DefaultMessage("Name: ")
String nameLabelFixed();
@DefaultMessage("Description: ")
String descriptionLabelFixed();
@DefaultMessage("Creation Date: ")
String creationDateLabelFixed();
@DefaultMessage("Creator Id: ")
String creatorIdLabelFixed();
@DefaultMessage("Type: ")
String typeLabelFixed();
@DefaultMessage("Value: ")
String valueLabelFixed();
@DefaultMessage("Table Id: ")
String tableIdLabelFixed();
@DefaultMessage("Name")
String nameCol();
@DefaultMessage("Type")
String typeCol();
@DefaultMessage("Empty")
String gridEmptyText();
@DefaultMessage("Error removing the resource: ")
String errorRetrievingResourcesFixed();
@DefaultMessage("Error retrieving current tabular resource id!")
String errorRetrievingCurrentTabularResourceId();
@DefaultMessage("Error get TR information!")
String errorGetTRInformation();
@DefaultMessage("Error setting Active TR!")
String errorSettingActiveTR();
@DefaultMessage("")
@AlternateMessage({ "Name", "Name", "CreationDate", "Creation Date" })
String resourceSortInfo(@Select ResourcesListViewPanel.ResourcesSortInfo sortItem);
}

View File

@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.resourceswidget.client.charts;
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDDescriptor;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
@ -18,6 +19,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
public class ChartViewerDialog extends Window {
private static final String WIDTH = "822px";
private static final String HEIGHT = "460px";
private ChartViewerMessages msgs;
/**
*
@ -37,18 +39,24 @@ public class ChartViewerDialog extends Window {
* @param test
*/
public ChartViewerDialog(ResourceTDDescriptor resourceTDDescriptor, TRId trId, EventBus eventBus, boolean test) {
initMessages();
initWindow();
ChartViewerPanel chartPanel= new ChartViewerPanel(this, resourceTDDescriptor, trId, eventBus,test);
add(chartPanel);
}
protected void initMessages(){
msgs = GWT.create(ChartViewerMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Chart");
setHeadingText(msgs.dialogHead());
//getHeader().setIcon(Resources.IMAGES.side_list());
}

View File

@ -0,0 +1,44 @@
package org.gcube.portlets.user.td.resourceswidget.client.charts;
import org.gcube.portlets.user.td.resourceswidget.client.store.ZoomLevelType;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ChartViewerMessages extends Messages {
@DefaultMessage("Chart")
String dialogHead();
@DefaultMessage("This resource does not have valid internal URI!")
String errorInvalidInternalURI();
@DefaultMessage("Error retrieving uri from resolver: ")
String errorRetrievingUriFromResolverFixed();
@DefaultMessage("Zoom In")
String btnZoomInToolTip();
@DefaultMessage("Zoom Out")
String btnZoomOutToolTip();
@DefaultMessage("Move")
String btnMoveToolTip();
@DefaultMessage("Zoom Level")
String comboZoomLevelEmptyText();
@DefaultMessage("Open in new window")
String btnOpenInWindowToolTip();
@DefaultMessage("")
@AlternateMessage({ "Fit", "Fit", "P50", "50%", "P75", "75%", "P100",
"100%", "P200", "200%", "MaxZoom", "Max" })
String zoomLevelType(@Select ZoomLevelType zoomLevelType);
}

View File

@ -13,6 +13,7 @@ import org.gcube.portlets.user.td.resourceswidget.client.store.ZoomLevelElement;
import org.gcube.portlets.user.td.resourceswidget.client.store.ZoomLevelStore;
import org.gcube.portlets.user.td.resourceswidget.client.store.ZoomLevelType;
import org.gcube.portlets.user.td.resourceswidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
@ -134,6 +135,8 @@ public class ChartViewerPanel extends FramedPanel {
private Vector2D chartTranslation;
private ComboBox<ZoomLevelElement> comboZoomLevel;
private TextButton btnOpenInWindow;
private ChartViewerMessages msgs;
private CommonMessages msgsCommon;
public ChartViewerPanel(ChartViewerDialog parent,
ResourceTDDescriptor resourceTDDescriptor, TRId trId,
@ -145,6 +148,7 @@ public class ChartViewerPanel extends FramedPanel {
ResourceTDDescriptor resourceTDDescriptor, TRId trId,
EventBus eventBus, boolean test) {
super();
initMessages();
ResourceBundle.INSTANCE.resourceCSS().ensureInjected();
this.eventBus = eventBus;
this.parent = parent;
@ -161,6 +165,11 @@ public class ChartViewerPanel extends FramedPanel {
}
protected void initMessages(){
msgs = GWT.create(ChartViewerMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
public static String encodeUrlDelimiters(String s) {
if (s == null) {
return null;
@ -184,8 +193,8 @@ public class ChartViewerPanel extends FramedPanel {
if (resource instanceof InternalURITD) {
internalURITD = (InternalURITD) resource;
} else {
UtilsGXT3.alert("Attention",
"This resource does not have valid internal URI!");
UtilsGXT3.alert(msgsCommon.attention(),
msgs.errorInvalidInternalURI());
Log.debug("Attention, this resource does not have valid Internal URI!");
close();
return;
@ -217,8 +226,8 @@ public class ChartViewerPanel extends FramedPanel {
} else {
Log.error("Error with uri resolver: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving uri from resolver: "
UtilsGXT3.alert(msgsCommon.error(),
msgs.errorRetrievingUriFromResolverFixed()
+ caught.getLocalizedMessage());
}
}
@ -316,7 +325,7 @@ public class ChartViewerPanel extends FramedPanel {
btnZoomIn = new ToggleButton();
btnZoomIn.setValue(false);
btnZoomIn.setIcon(ResourceBundle.INSTANCE.magnifierZoomIn());
btnZoomIn.setToolTip("Zoom In");
btnZoomIn.setToolTip(msgs.btnZoomInToolTip());
btnZoomIn.addSelectHandler(new SelectHandler() {
@Override
@ -331,7 +340,7 @@ public class ChartViewerPanel extends FramedPanel {
btnZoomOut = new ToggleButton();
btnZoomOut.setValue(false);
btnZoomOut.setIcon(ResourceBundle.INSTANCE.magnifierZoomOut());
btnZoomOut.setToolTip("Zoom Out");
btnZoomOut.setToolTip(msgs.btnZoomOutToolTip());
btnZoomOut.addSelectHandler(new SelectHandler() {
@Override
@ -346,7 +355,7 @@ public class ChartViewerPanel extends FramedPanel {
btnMove = new ToggleButton();
btnMove.setValue(false);
btnMove.setIcon(ResourceBundle.INSTANCE.move());
btnMove.setToolTip("Move");
btnMove.setToolTip(msgs.btnMoveToolTip());
btnMove.addSelectHandler(new SelectHandler() {
@Override
@ -402,7 +411,7 @@ public class ChartViewerPanel extends FramedPanel {
addHandlersForComboZoomLevel(props.label());
comboZoomLevel.setEmptyText("Zoom Level");
comboZoomLevel.setEmptyText(msgs.comboZoomLevelEmptyText());
comboZoomLevel.setItemId("ComboZoomLevel");
comboZoomLevel.setWidth(COMBO_ZOOM_LEVEL_WIDTH);
comboZoomLevel.setEditable(false);
@ -412,7 +421,7 @@ public class ChartViewerPanel extends FramedPanel {
//
btnOpenInWindow = new TextButton();
btnOpenInWindow.setIcon(ResourceBundle.INSTANCE.application());
btnOpenInWindow.setToolTip("Open in new window");
btnOpenInWindow.setToolTip(msgs.btnOpenInWindowToolTip());
btnOpenInWindow.addSelectHandler(new SelectHandler() {
@Override

View File

@ -9,9 +9,11 @@ package org.gcube.portlets.user.td.resourceswidget.client.save;
import org.gcube.portlets.user.td.gwtservice.shared.destination.FileDestination;
import org.gcube.portlets.user.td.gwtservice.shared.destination.WorkspaceDestination;
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.SaveResourceSession;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.Command;
@ -27,15 +29,17 @@ import com.sencha.gxt.widget.core.client.form.Radio;
*
*/
public class DestinationSelectionCard extends WizardCard {
protected final SaveResourceSession saveResourceSession;
protected DestinationSelectionCard thisCard;
private static SaveResourceMessages msgs=GWT.create(SaveResourceMessages.class);
private final SaveResourceSession saveResourceSession;
private DestinationSelectionCard thisCard;
final FileDestination fileDestination = FileDestination.INSTANCE;
final WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE;
private final FileDestination fileDestination = FileDestination.INSTANCE;
private final WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE;
private CommonMessages msgsCommon;
public DestinationSelectionCard(final SaveResourceSession saveResourceSession) {
super("Destination selection", "");
super(msgs.destinationSelectionCardHead(), "");
initMessages();
thisCard=this;
this.saveResourceSession = saveResourceSession;
// Default
@ -47,8 +51,8 @@ public class DestinationSelectionCard extends WizardCard {
Radio radioWorkspaceDestination = new Radio();
radioWorkspaceDestination.setBoxLabel("<p style='display:inline-table;'><b>"
+ workspaceDestination.getName() + "</b><br>"
+ workspaceDestination.getDescription() + "</p>");
+ msgsCommon.workspaceDestinationName() + "</b><br>"
+ msgsCommon.workspaceDestinationDescription() + "</p>");
radioWorkspaceDestination.setName(workspaceDestination.getName());
radioWorkspaceDestination.setStylePrimaryName(res.wizardCSS()
.getImportSelectionSource());
@ -57,8 +61,8 @@ public class DestinationSelectionCard extends WizardCard {
Radio radioFileDestination = new Radio();
radioFileDestination.setBoxLabel("<p style='display:inline-table;'><b>"
+ fileDestination.getName() + "</b><br>"
+ fileDestination.getDescription() + "</p>");
+ msgsCommon.fileDestinationName() + "</b><br>"
+ msgsCommon.fileDestinationDescription() + "</p>");
radioFileDestination.setName(fileDestination.getName());
radioFileDestination.setStylePrimaryName(res.wizardCSS()
.getImportSelectionSource());
@ -103,6 +107,11 @@ public class DestinationSelectionCard extends WizardCard {
setContent(destinationSelectionPanel);
}
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
@Override
public void setup() {
@ -156,7 +165,8 @@ public class DestinationSelectionCard extends WizardCard {
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
setEnableBackButton(false);
setEnableNextButton(true);
setBackButtonVisible(false);
setEnableNextButton(true);
}

View File

@ -8,6 +8,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.SaveResourceSes
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Command;
/**
@ -17,13 +18,14 @@ import com.google.gwt.user.client.Command;
*
*/
public class DownloadFileCard extends WizardCard {
protected SaveResourceSession saveResourceSession;
protected DownloadFileCard thisCard;
//private SaveResourceSession saveResourceSession;
private DownloadFileCard thisCard;
private static SaveResourceMessages msgs=GWT.create(SaveResourceMessages.class);
public DownloadFileCard(final SaveResourceSession saveResourceSession) {
super("Download File", "");
super(msgs.downloadFileCardHead(), "");
this.thisCard = this;
this.saveResourceSession = saveResourceSession;
//this.saveResourceSession = saveResourceSession;
@ -56,6 +58,9 @@ public class DownloadFileCard extends WizardCard {
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setEnableNextButton(false);
setBackButtonVisible(true);
setEnableBackButton(true);
}
}

View File

@ -7,11 +7,13 @@ import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.SaveResourceSession;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -31,17 +33,17 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
*
*/
public class OperationInProgressCard extends WizardCard {
protected OperationInProgressCard thisCard;
protected SaveResourceSession saveResourceSession;
protected HtmlLayoutContainer resultField;
private static SaveResourceMessages msgs=GWT.create(SaveResourceMessages.class);
private SaveResourceSession saveResourceSession;
private HtmlLayoutContainer resultField;
private CommonMessages msgsCommon;
public OperationInProgressCard(final SaveResourceSession saveResourceSession) {
super("Save", "");
super(msgs.operationInProgressCardHead(), "");
this.saveResourceSession = saveResourceSession;
thisCard = this;
initMessages();
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
@ -53,19 +55,19 @@ public class OperationInProgressCard extends WizardCard {
// display:block;vertical-align:text-top;
description.setHTML(0, 0,
"<span style=\"font-weight:bold;\";>Destination: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.destinationFixed()+"</span>");
description.setText(0, 1, saveResourceSession.getDestination()
.getName());
description.setHTML(1, 0,
"<span style=\"font-weight:bold;\";>File Name: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.fileNameFixed()+"</span>");
description.setText(1, 1, saveResourceSession.getFileName());
description.setHTML(2, 0,
"<span style=\"font-weight:bold;\";>File Description: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.fileDescriptionFixed()+"</span>");
description.setText(2, 1, saveResourceSession.getFileDescription());
FramedPanel summary = new FramedPanel();
summary.setHeadingText("Save Summary");
summary.setHeadingText(msgs.summarySave());
summary.setWidth(400);
summary.add(description);
operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20,
@ -80,6 +82,10 @@ public class OperationInProgressCard extends WizardCard {
resultField.setVisible(false);
}
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
public void saveResource() {
TDGWTServiceAsync.INSTANCE.saveResource(saveResourceSession,
@ -94,15 +100,15 @@ public class OperationInProgressCard extends WizardCard {
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Locked",
showErrorAndHide(msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "",
caught);
} else {
Log.error("Error saving the resource: "
+ caught.getLocalizedMessage());
showErrorAndHide("Error",
"Error saving the resource.",
showErrorAndHide(msgsCommon.error(),
msgs.errorSavingTheResource(),
caught.getLocalizedMessage(), caught);
}
@ -132,7 +138,7 @@ public class OperationInProgressCard extends WizardCard {
public void operationComplete() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</div>");
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold; color:#009900;'>"+msgsCommon.operationCompleted()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@ -161,7 +167,7 @@ public class OperationInProgressCard extends WizardCard {
public void operationFailed(Throwable caught, String reason, String details) {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold;color:red;'>Operation Failed</div>");
.appendHtmlConstant("<div style='display:block;margin:auto;text-align:center;font-size:large;font-weight:bold;color:red;'>"+msgsCommon.operationFailed()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@ -171,7 +177,7 @@ public class OperationInProgressCard extends WizardCard {
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
showErrorAndHide("Error in Save", reason, details, caught);
showErrorAndHide(msgsCommon.error(), reason, details, caught);
}
forceLayout();

View File

@ -0,0 +1,62 @@
package org.gcube.portlets.user.td.resourceswidget.client.save;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface SaveResourceMessages extends Messages {
@DefaultMessage("Destination selection")
String destinationSelectionCardHead();
@DefaultMessage("Download File")
String downloadFileCardHead();
@DefaultMessage("Save in Workspace")
String workspaceSelectionCardHead();
@DefaultMessage("Name")
String nameLabel();
@DefaultMessage("Description")
String descriptionLabel();
@DefaultMessage("Workspace")
String workspaceExplorerSelectionPanelHead();
@DefaultMessage("Folder")
String workspaceExplorerSelectionPanelLabel();
@DefaultMessage("No folder selected")
String attentionNoFolderSelected();
@DefaultMessage("No valid description")
String attentionNoValidFileDescription();
@DefaultMessage("No valid name")
String attentionNoValidFileName();
@DefaultMessage("Save")
String operationInProgressCardHead();
@DefaultMessage("Destination: ")
String destinationFixed();
@DefaultMessage("Name: ")
String fileNameFixed();
@DefaultMessage("Description: ")
String fileDescriptionFixed();
@DefaultMessage("Summary")
String summarySave();
@DefaultMessage("Error saving the resource.")
String errorSavingTheResource();
}

View File

@ -7,24 +7,24 @@ import com.google.web.bindery.event.shared.EventBus;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class SaveResourceWizard extends WizardWindow {
protected SaveResourceSession saveResourceSession;
protected String WIZARDWIDTH = "844px";
/**
* The id of the {@link CSVTarget} to use.
*
* @param targetId
*/
private String WIZARDWIDTH = "844px";
/**
*
* @param saveResourceSession
* @param title
* @param eventBus
*/
public SaveResourceWizard(SaveResourceSession saveResourceSession,
String title, EventBus eventBus) {
super(title, eventBus);
setWidth(WIZARDWIDTH);
this.saveResourceSession = saveResourceSession;
DestinationSelectionCard destinationSelectionCard = new DestinationSelectionCard(
saveResourceSession);

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.SaveResourceSession;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectPanel;
@ -14,6 +15,7 @@ import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.Command;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
@ -32,7 +34,7 @@ import com.sencha.gxt.widget.core.client.form.validator.EmptyValidator;
*
*/
public class WorkSpaceSelectionCard extends WizardCard {
private static SaveResourceMessages msgs=GWT.create(SaveResourceMessages.class);
private SaveResourceSession saveResourceSession;
private WorkSpaceSelectionCard thisCard;
private TextField fileName;
@ -40,10 +42,11 @@ public class WorkSpaceSelectionCard extends WizardCard {
private VerticalLayoutContainer p;
private WorkspaceExplorerSelectPanel wpanel;
private CommonMessages msgsCommon;
public WorkSpaceSelectionCard(final SaveResourceSession saveResourceSession) {
super("Save in Workspace", "");
super(msgs.workspaceSelectionCardHead(), "");
initMessages();
this.saveResourceSession = saveResourceSession;
thisCard = this;
@ -58,8 +61,8 @@ public class WorkSpaceSelectionCard extends WizardCard {
fileName.setWidth("410px");
fileName.setValue(saveResourceSession.getFileName());
p.add(new FieldLabel(fileName, "Name"), new VerticalLayoutData(1,
p.add(new FieldLabel(fileName, msgs.nameLabel()), new VerticalLayoutData(1,
-1));
fileDescription = new TextField();
@ -67,7 +70,7 @@ public class WorkSpaceSelectionCard extends WizardCard {
fileDescription.addValidator(new EmptyValidator<String>());
fileDescription.setWidth("410px");
fileDescription.setValue(saveResourceSession.getFileDescription());
p.add(new FieldLabel(fileDescription, "Description"),
p.add(new FieldLabel(fileDescription, msgs.descriptionLabel()),
new VerticalLayoutData(1, -1));
///
@ -77,8 +80,8 @@ public class WorkSpaceSelectionCard extends WizardCard {
List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.add(ItemType.FOLDER);
wpanel = new WorkspaceExplorerSelectPanel(new String(
"Workspace Selection"),selectableTypes, showableTypes);
wpanel = new WorkspaceExplorerSelectPanel(
msgs.workspaceExplorerSelectionPanelHead(),selectableTypes, showableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@ -118,11 +121,15 @@ public class WorkSpaceSelectionCard extends WizardCard {
///
p.add(new FieldLabel(wpanel, "Folder"), new VerticalLayoutData(1, 1));
p.add(new FieldLabel(wpanel, msgs.workspaceExplorerSelectionPanelLabel()), new VerticalLayoutData(1, 1));
setContent(formPanel);
}
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
protected void checkExportData() {
Log.debug("File Name:" + fileName.getCurrentValue() + " Item id: "
@ -151,22 +158,22 @@ public class WorkSpaceSelectionCard extends WizardCard {
.getCurrentValue());
goNext();
} else {
d = new AlertMessageBox("Attention", "No folder selected");
d = new AlertMessageBox(msgsCommon.attention(), msgs.attentionNoFolderSelected());
d.addHideHandler(hideHandler);
d.setModal(false);
d.show();
}
} else {
d = new AlertMessageBox("Attention",
"No valid file description");
d = new AlertMessageBox(msgsCommon.attention(),
msgs.attentionNoValidFileDescription());
d.addHideHandler(hideHandler);
d.setModal(false);
d.show();
}
} else {
d = new AlertMessageBox("Attention", "No valid file name");
d = new AlertMessageBox(msgsCommon.attention(), msgs.attentionNoValidFileName());
d.addHideHandler(hideHandler);
d.setModal(false);
d.show();
@ -201,9 +208,10 @@ public class WorkSpaceSelectionCard extends WizardCard {
};
getWizardWindow().setPreviousButtonCommand(sayPreviousCard);
getWizardWindow().setEnableNextButton(true);
getWizardWindow().setEnableBackButton(true);
setBackButtonVisible(true);
setEnableBackButton(true);
setEnableNextButton(true);
}
protected void goNext() {

View File

@ -38,7 +38,7 @@ public class ZoomLevelElement {
}
public String getLabel() {
return type.toString();
return type.getIdI18N();
}
@Override

View File

@ -1,5 +1,9 @@
package org.gcube.portlets.user.td.resourceswidget.client.store;
import org.gcube.portlets.user.td.resourceswidget.client.charts.ChartViewerMessages;
import com.google.gwt.core.client.GWT;
/**
*
* @author giancarlo
@ -13,7 +17,11 @@ public enum ZoomLevelType {
P100("100%"),
P200("200%"),
MaxZoom("Max");
private static ChartViewerMessages msgs=GWT.create(ChartViewerMessages.class);
private final String id;
/**
* @param text
*/
@ -21,8 +29,11 @@ public enum ZoomLevelType {
this.id = id;
}
private final String id;
public String getIdI18N(){
return msgs.zoomLevelType(this);
}
@Override
public String toString() {
return id;

View File

@ -34,3 +34,6 @@ errorRetrievingResourcesFixed = Error removing the resource:
errorRetrievingCurrentTabularResourceId = Error retrieving current tabular resource id!
errorGetTRInformation = Error get TR information!
errorSettingActiveTR = Error setting Active TR!
resourceSortInfo =
resourceSortInfo[Name] = Name
resourceSortInfo[CreationDate] = Creation Date

View File

@ -34,3 +34,7 @@ errorRetrievingResourcesFixed = Error borrando el recurso:
errorRetrievingCurrentTabularResourceId = Error al recuperar el Id de la Tabular Resource corriente!
errorGetTRInformation = Error al recuperar la información de la Tabular Resource!
errorSettingActiveTR = Error al poner Tabular Resource Activa!
resourceSortInfo=
resourceSortInfo[Name]= Nombre
resourceSortInfo[CreationDate]= Fecha Creacion

View File

@ -34,3 +34,7 @@ errorRetrievingResourcesFixed = Errore eliminando la risorsa:
errorRetrievingCurrentTabularResourceId = Errore recuperando l''id della tabular resource corrente!
errorGetTRInformation = Errore recuperando le infomazioni della Tabular Resource!
errorSettingActiveTR = Errore settando la Tabular Resource Attiva!
resourceSortInfo =
resourceSortInfo[Name] = Nome
resourceSortInfo[CreationDate] = Data Creazione

View File

@ -0,0 +1,15 @@
dialogHead = Chart
errorInvalidInternalURI = This resource does not have valid internal URI!
errorRetrievingUriFromResolverFixed = Error retrieving uri from resolver:
btnZoomInToolTip = Zoom In
btnZoomOutToolTip = Zoom Out
btnMoveToolTip = Move
comboZoomLevelEmptyText = Zoom Level
btnOpenInWindowToolTip = Open in new window
zoomLevelType =
zoomLevelType[Fit] = Fit
zoomLevelType[P50] = 50%
zoomLevelType[P75] = 75%
zoomLevelType[P100] = 100%
zoomLevelType[P200] = 200%
zoomLevelType[MaxZoom] = Max

View File

@ -0,0 +1,15 @@
dialogHead = Grafico
errorInvalidInternalURI = Error InternalUri inválida!
errorRetrievingUriFromResolverFixed = Error al recuperar la uri usando el resolutor:
btnZoomInToolTip = Agrandar
btnZoomOutToolTip = Achicar
btnMoveToolTip = Mueves
comboZoomLevelEmptyText = Nivel de Zoom
btnOpenInWindowToolTip = Abrir en una nueva ventana
zoomLevelType =
zoomLevelType[Fit] = Ajuste
zoomLevelType[P50] = 50%
zoomLevelType[P75] = 75%
zoomLevelType[P100] = 100%
zoomLevelType[P200] = 200%
zoomLevelType[MaxZoom] = Máximo

View File

@ -0,0 +1,15 @@
dialogHead = Grafico
errorInvalidInternalURI = Questa risorsa non ha una valida URI interna!
errorRetrievingUriFromResolverFixed = Errore recuperando l''uri dal resolver:
btnZoomInToolTip = Zoom In
btnZoomOutToolTip = Zoom Out
btnMoveToolTip = Sposta
comboZoomLevelEmptyText = Livello Zoom
btnOpenInWindowToolTip = Apri in una nuova finestra
zoomLevelType =
zoomLevelType[Fit] = Adatta
zoomLevelType[P50] = 50%
zoomLevelType[P75] = 75%
zoomLevelType[P100] = 100%
zoomLevelType[P200] = 200%
zoomLevelType[MaxZoom] = Massimo

View File

@ -0,0 +1,16 @@
destinationSelectionCardHead = Destination selection
downloadFileCardHead = Download File
workspaceSelectionCardHead = Save in Workspace
nameLabel = Name
descriptionLabel = Description
workspaceExplorerSelectionPanelHead = Workspace
workspaceExplorerSelectionPanelLabel = Folder
attentionNoFolderSelected = No folder selected
attentionNoValidFileDescription = No valid description
attentionNoValidFileName = No valid name
operationInProgressCardHead = Save
destinationFixed = Destination:
fileNameFixed = Name:
fileDescriptionFixed = Description:
summarySave = Summary
errorSavingTheResource = Error saving the resource.

View File

@ -0,0 +1,16 @@
destinationSelectionCardHead = Seleccionar el Destino
downloadFileCardHead = Descargar Archivo
workspaceSelectionCardHead = Guarda en Workspace
nameLabel = Nombre
descriptionLabel = Descripción
workspaceExplorerSelectionPanelHead = Workspace
workspaceExplorerSelectionPanelLabel = Folder
attentionNoFolderSelected = No hay folder seleccionado!
attentionNoValidFileDescription = Descripción inválido!
attentionNoValidFileName = Nombre inválido!
operationInProgressCardHead = Guardar
destinationFixed = Destino:
fileNameFixed = Nombre:
fileDescriptionFixed = Descripción:
summarySave = Resumen
errorSavingTheResource = Error guardando el recurso.

View File

@ -0,0 +1,16 @@
destinationSelectionCardHead = Seleziona destinazione
downloadFileCardHead = Scarica File
workspaceSelectionCardHead = Salva nel Workspace
nameLabel = Nome
descriptionLabel = Descrizione
workspaceExplorerSelectionPanelHead = Workspace
workspaceExplorerSelectionPanelLabel = Folder
attentionNoFolderSelected = Nessun folder selezionato!
attentionNoValidFileDescription = Descrizione non valida!
attentionNoValidFileName = Nome non valido!
operationInProgressCardHead = Salva
destinationFixed = Destinazione:
fileNameFixed = Nome:
fileDescriptionFixed = Descrizione:
summarySave = Sommario
errorSavingTheResource = Errore salvando la risorsa.