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-column-widget@119546 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cc8a0f6e96
commit
e715c6313b
|
@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
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.google.web.bindery.event.shared.EventBus;
|
||||||
import com.sencha.gxt.widget.core.client.Window;
|
import com.sencha.gxt.widget.core.client.Window;
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
|
@ -17,8 +18,10 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
public class PositionColumnDialog extends Window {
|
public class PositionColumnDialog extends Window {
|
||||||
private static final int WIDTH=400;
|
private static final int WIDTH=400;
|
||||||
private static final int HEIGHT=120;
|
private static final int HEIGHT=120;
|
||||||
|
private PositionColumnMessages msgs;
|
||||||
|
|
||||||
public PositionColumnDialog(TRId trId, EventBus eventBus) {
|
public PositionColumnDialog(TRId trId, EventBus eventBus) {
|
||||||
|
msgs = GWT.create(PositionColumnMessages.class);
|
||||||
initWindow();
|
initWindow();
|
||||||
|
|
||||||
PositionColumnPanel changeColumnsPositionPanel= new PositionColumnPanel(trId, eventBus);
|
PositionColumnPanel changeColumnsPositionPanel= new PositionColumnPanel(trId, eventBus);
|
||||||
|
@ -30,7 +33,7 @@ public class PositionColumnDialog extends Window {
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
setResizable(false);
|
setResizable(false);
|
||||||
setHeadingText("Change Columns Position");
|
setHeadingText(msgs.dialogHeadingText());
|
||||||
//getHeader().setIcon(Resources.IMAGES.side_list());
|
//getHeader().setIcon(Resources.IMAGES.side_list());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package org.gcube.portlets.user.td.columnwidget.client;
|
||||||
|
|
||||||
|
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 PositionColumnMessages extends Messages {
|
||||||
|
|
||||||
|
@DefaultMessage("Change Columns Position")
|
||||||
|
String dialogHeadingText();
|
||||||
|
|
||||||
|
//
|
||||||
|
@DefaultMessage("Columns")
|
||||||
|
String labelColHeader();
|
||||||
|
|
||||||
|
// Apply Button
|
||||||
|
@DefaultMessage("Apply")
|
||||||
|
String applyBtnText();
|
||||||
|
|
||||||
|
@DefaultMessage("Apply Position Columns")
|
||||||
|
String applyBtnToolTip();
|
||||||
|
|
||||||
|
@DefaultMessage("Use drag and drop in order to change the position of the columns:")
|
||||||
|
String tipForReorganization();
|
||||||
|
|
||||||
|
// Error
|
||||||
|
@DefaultMessage("Error retrieving columns")
|
||||||
|
String errorRetrievingColumnsHead();
|
||||||
|
|
||||||
|
@DefaultMessage("Error retrieving columns!")
|
||||||
|
String errorRetrievingColumns();
|
||||||
|
|
||||||
|
@DefaultMessage("Attention no column change!")
|
||||||
|
String attentionNoColumnChange();
|
||||||
|
|
||||||
|
@DefaultMessage("Error changing the position of the columns! ")
|
||||||
|
String errorChangingPositionOfColumns();
|
||||||
|
|
||||||
|
@DefaultMessage("Positions Updated!")
|
||||||
|
String positionUpdated();
|
||||||
|
|
||||||
|
}
|
|
@ -73,7 +73,7 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
private PositionColumnDialog parent;
|
private PositionColumnDialog parent;
|
||||||
private TRId trId;
|
private TRId trId;
|
||||||
|
|
||||||
private TextButton reorder;
|
private TextButton applyBtn;
|
||||||
|
|
||||||
private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
||||||
private Grid<ColumnData> grid;
|
private Grid<ColumnData> grid;
|
||||||
|
@ -83,7 +83,10 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
|
|
||||||
private ListStore<ColumnData> store;
|
private ListStore<ColumnData> store;
|
||||||
|
|
||||||
|
private PositionColumnMessages msgs;
|
||||||
|
|
||||||
public PositionColumnPanel(TRId trId, EventBus eventBus) {
|
public PositionColumnPanel(TRId trId, EventBus eventBus) {
|
||||||
|
msgs = GWT.create(PositionColumnMessages.class);
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
Log.debug("ReorderColumnsPanel(): [" + trId.toString() + "]");
|
Log.debug("ReorderColumnsPanel(): [" + trId.toString() + "]");
|
||||||
|
@ -103,7 +106,7 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
|
|
||||||
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
|
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
|
||||||
props.label());
|
props.label());
|
||||||
labelCol.setHeader("Columns");
|
labelCol.setHeader(msgs.labelColHeader());
|
||||||
|
|
||||||
//IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
|
//IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
|
||||||
sm = new GridSelectionModel<ColumnData>();
|
sm = new GridSelectionModel<ColumnData>();
|
||||||
|
@ -190,11 +193,11 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
dt.setAllowSelfAsSource(true);
|
dt.setAllowSelfAsSource(true);
|
||||||
|
|
||||||
|
|
||||||
// Delete Button
|
// Apply Button
|
||||||
reorder = new TextButton("Apply");
|
applyBtn = new TextButton(msgs.applyBtnText());
|
||||||
reorder.setIcon(ResourceBundle.INSTANCE.columnReorder());
|
applyBtn.setIcon(ResourceBundle.INSTANCE.columnReorder());
|
||||||
reorder.setIconAlign(IconAlign.RIGHT);
|
applyBtn.setIconAlign(IconAlign.RIGHT);
|
||||||
reorder.setToolTip("Apply Position Columns");
|
applyBtn.setToolTip(msgs.applyBtnToolTip());
|
||||||
|
|
||||||
SelectHandler deleteHandler = new SelectHandler() {
|
SelectHandler deleteHandler = new SelectHandler() {
|
||||||
|
|
||||||
|
@ -203,16 +206,16 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
reorder.addSelectHandler(deleteHandler);
|
applyBtn.addSelectHandler(deleteHandler);
|
||||||
|
|
||||||
HTML columnsLabel = new HTML("<p>Use drag and drop in order to change the position of the columns:</p>");
|
HTML tipForReorganization = new HTML("<p>"+msgs.tipForReorganization()+"</p>");
|
||||||
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
||||||
hBox.add(reorder, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
hBox.add(applyBtn, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.setScrollMode(ScrollMode.AUTOY);
|
v.setScrollMode(ScrollMode.AUTOY);
|
||||||
v.setAdjustForScroll(true);
|
v.setAdjustForScroll(true);
|
||||||
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
|
v.add(tipForReorganization, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
|
||||||
1)));
|
1)));
|
||||||
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
||||||
|
@ -252,8 +255,8 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
} else {
|
} else {
|
||||||
Log.error("load columns failure:"
|
Log.error("load columns failure:"
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving columns",
|
UtilsGXT3.alert(msgs.errorRetrievingColumnsHead(),
|
||||||
"Error retrieving columns");
|
msgs.errorRetrievingColumns());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,7 +268,7 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
try {
|
try {
|
||||||
Log.debug("loaded " + result.size() + " ColumnData");
|
Log.debug("loaded " + result.size() + " ColumnData");
|
||||||
if(result.size()<=1){
|
if(result.size()<=1){
|
||||||
reorder.disable();
|
applyBtn.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
||||||
|
@ -288,7 +291,7 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
protected void onReorderColumns() {
|
protected void onReorderColumns() {
|
||||||
ArrayList<ColumnData> columns = getReorderedColumns();
|
ArrayList<ColumnData> columns = getReorderedColumns();
|
||||||
if (columns == null || columns.size() < 1) {
|
if (columns == null || columns.size() < 1) {
|
||||||
UtilsGXT3.alert("Attention", "Attention no column change!");
|
UtilsGXT3.alert("Attention", msgs.attentionNoColumnChange());
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
callReorderColumn(columns);
|
callReorderColumn(columns);
|
||||||
|
@ -323,7 +326,7 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Error",
|
.alert("Error",
|
||||||
"Error changing the position of the columns! "+caught.getLocalizedMessage());
|
msgs.errorChangingPositionOfColumns()+caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,7 +334,7 @@ public class PositionColumnPanel extends FramedPanel {
|
||||||
|
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.info("Success", "Positions Updated");
|
.info("Success", msgs.positionUpdated());
|
||||||
syncOpComplete();
|
syncOpComplete();
|
||||||
|
|
||||||
//openMonitorDialog(taskId);
|
//openMonitorDialog(taskId);
|
||||||
|
|
Loading…
Reference in New Issue