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@119640 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-12 16:39:48 +00:00
parent 44ef41f40c
commit 47be88eb77
10 changed files with 223 additions and 63 deletions

View File

@ -41,7 +41,6 @@ import com.sencha.gxt.widget.core.client.event.TriggerClickEvent;
import com.sencha.gxt.widget.core.client.event.TriggerClickEvent.TriggerClickHandler;
import com.sencha.gxt.widget.core.client.form.ComboBox;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
import com.sencha.gxt.widget.core.client.info.Info;
/**
*
@ -50,30 +49,37 @@ import com.sencha.gxt.widget.core.client.info.Info;
*/
public class ConnectCodelistDialog extends Window implements
CodelistSelectionListener {
protected String WIDTH = "500px";
protected String HEIGHT = "150px";
protected ArrayList<ConnectCodelistListener> listeners;
private static final String WIDTH = "500px";
private static final String HEIGHT = "150px";
private ArrayList<ConnectCodelistListener> listeners;
protected ComboBox<TabResource> comboDimensionType = null;
protected FieldLabel comboDimensionTypeLabel;
protected ListStore<TabResource> storeComboDimensionType;
private ComboBox<TabResource> comboDimensionType = null;
private FieldLabel comboDimensionTypeLabel;
private ListStore<TabResource> storeComboDimensionType;
protected ComboBox<ColumnData> comboColumnReferenceType = null;
protected FieldLabel comboColumnReferenceTypeLabel;
protected ListStore<ColumnData> storeComboColumnReferenceType;
private ComboBox<ColumnData> comboColumnReferenceType = null;
private FieldLabel comboColumnReferenceTypeLabel;
private ListStore<ColumnData> storeComboColumnReferenceType;
protected EventBus eventBus;
private EventBus eventBus;
private TextButton btnApply;
private TextButton btnConnect;
private TextButton btnClose;
private ConnectCodelistMessages msgs;
public ConnectCodelistDialog(EventBus eventBus) {
listeners = new ArrayList<ConnectCodelistListener>();
this.eventBus = eventBus;
initMessages();
initWindow();
create();
}
protected void initMessages(){
msgs = GWT.create(ConnectCodelistMessages.class);
}
protected void create() {
final FramedPanel panel = new FramedPanel();
@ -93,12 +99,12 @@ public class ConnectCodelistDialog extends Window implements
addHandlersForComboDimensionType(propsDimensionType.label());
comboDimensionType.setEmptyText("Select a Codelist...");
comboDimensionType.setEmptyText(msgs.comboDimensionTypeEmptyText());
comboDimensionType.setWidth(191);
comboDimensionType.setEditable(false);
comboDimensionType.setTriggerAction(TriggerAction.ALL);
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, "Codelist");
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, msgs.comboDimensionTypeLabel());
// ColumnReferenceType
ColumnDataPropertiesCombo propsColumnReferenceType = GWT
@ -112,20 +118,20 @@ public class ConnectCodelistDialog extends Window implements
addHandlersForComboColumnReferenceType(propsColumnReferenceType.label());
comboColumnReferenceType.setEmptyText("Select a Column Reference...");
comboColumnReferenceType.setEmptyText(msgs.comboColumnReferenceTypeEmptyText());
comboColumnReferenceType.setWidth(191);
comboColumnReferenceType.setEditable(false);
comboColumnReferenceType.setTriggerAction(TriggerAction.ALL);
comboColumnReferenceTypeLabel = new FieldLabel(
comboColumnReferenceType, "Column");
comboColumnReferenceType, msgs.comboColumnReferenceTypeLabel());
// Buttons
btnApply = new TextButton("Connect");
btnApply.setIcon(ResourceBundle.INSTANCE.codelistLink());
btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Connect");
btnApply.addSelectHandler(new SelectHandler() {
btnConnect = new TextButton(msgs.btnConnectText());
btnConnect.setIcon(ResourceBundle.INSTANCE.codelistLink());
btnConnect.setIconAlign(IconAlign.RIGHT);
btnConnect.setToolTip(msgs.btnConnectToolTip());
btnConnect.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Connect");
@ -135,10 +141,10 @@ public class ConnectCodelistDialog extends Window implements
});
btnClose = new TextButton("Close");
btnClose = new TextButton(msgs.btnCloseText());
btnClose.setIcon(ResourceBundle.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setToolTip("Close");
btnClose.setToolTip(msgs.btnCloseToolTip());
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -153,7 +159,7 @@ public class ConnectCodelistDialog extends Window implements
flowButton.setPack(BoxLayoutPack.CENTER);
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
flowButton.add(btnApply, boxLayoutData);
flowButton.add(btnConnect, boxLayoutData);
flowButton.add(btnClose, boxLayoutData);
VerticalLayoutContainer v = new VerticalLayoutContainer();
@ -193,13 +199,6 @@ public class ConnectCodelistDialog extends Window implements
comboColumnReferenceType
.addSelectionHandler(new SelectionHandler<ColumnData>() {
public void onSelection(SelectionEvent<ColumnData> event) {
Info.display(
"Column Reference Selected",
"You selected "
+ (event.getSelectedItem() == null ? "nothing"
: labelProvider.getLabel(event
.getSelectedItem())
+ "!"));
Log.debug("ComboColumnReferenceType selected: "
+ event.getSelectedItem());
@ -213,12 +212,12 @@ public class ConnectCodelistDialog extends Window implements
TabResource codelist = comboDimensionType.getCurrentValue();
if (codelist == null) {
Log.debug("No codelist selected");
UtilsGXT3.alert("Attention", "Select a valid codelist");
UtilsGXT3.alert("Attention", msgs.selectAValidCodelist());
} else {
ColumnData connection = comboColumnReferenceType.getCurrentValue();
if (connection == null) {
Log.debug("No connection selected");
UtilsGXT3.alert("Attention", "Select a valid column");
UtilsGXT3.alert("Attention", msgs.selectAValidColumn());
} else {
fireCompleted(connection);
}
@ -279,8 +278,8 @@ public class ConnectCodelistDialog extends Window implements
Log.debug("Error retrieving columns: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error retrieving columns",
"Error retrieving columns on server!");
.alert(msgs.errorRetrievingColumnsHead(),
msgs.errorRetrievingColumns());
}
}
}
@ -306,7 +305,7 @@ public class ConnectCodelistDialog extends Window implements
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Connect");
setHeadingText(msgs.dialogHead());
setModal(true);
setClosable(true);
getHeader().setIcon(ResourceBundle.INSTANCE.codelistLink());

View File

@ -0,0 +1,53 @@
package org.gcube.portlets.user.td.columnwidget.client.dimension;
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 ConnectCodelistMessages extends Messages {
@DefaultMessage("Connect")
String dialogHead();
@DefaultMessage("Select a Codelist...")
String comboDimensionTypeEmptyText();
@DefaultMessage("Codelist")
String comboDimensionTypeLabel();
@DefaultMessage("Select a Column Reference...")
String comboColumnReferenceTypeEmptyText();
@DefaultMessage("Column")
String comboColumnReferenceTypeLabel();
@DefaultMessage("Connect")
String btnConnectText();
@DefaultMessage("Connect")
String btnConnectToolTip();
@DefaultMessage("Close")
String btnCloseText();
@DefaultMessage("Close")
String btnCloseToolTip();
@DefaultMessage("Select a valid codelist")
String selectAValidCodelist();
@DefaultMessage("Select a valid column")
String selectAValidColumn();
@DefaultMessage("Error retrieving columns")
String errorRetrievingColumnsHead();
@DefaultMessage("Error retrieving columns on server!")
String errorRetrievingColumns();
}

View File

@ -15,6 +15,7 @@ import org.gcube.portlets.user.tdwx.shared.StaticFilterInformation;
import org.gcube.portlets.user.tdwx.shared.model.TableId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.core.client.Style.SelectionMode;
import com.sencha.gxt.widget.core.client.FramedPanel;
@ -30,29 +31,31 @@ import com.sencha.gxt.widget.core.client.info.Info;
/**
*
* @author "Giancarlo Panichi"
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DimensionRowSelectionDialog extends Window {
protected static final int WIDTH = 550;
protected static final int HEIGHT = 520;
private static final int WIDTH = 550;
private static final int HEIGHT = 520;
protected ColumnData column;
protected EventBus eventBus;
protected DimensionRow dimRow;
protected CellData cellData;
protected boolean workOnTable;
protected boolean showValue;
protected boolean errorNotColored;
protected boolean staticFilterBool;
protected boolean visibleOnlyColumn;
private ColumnData column;
private DimensionRow dimRow;
private CellData cellData;
private boolean workOnTable;
private boolean showValue;
private boolean errorNotColored;
private boolean staticFilterBool;
private boolean visibleOnlyColumn;
protected ArrayList<DimensionRowSelectionListener> listeners;
private ArrayList<DimensionRowSelectionListener> listeners;
private static TabularDataX tabularData;
private TabularDataXGridPanel gridPanel;
private TextField value;
private TextButton select;
private TextButton btnSelect;
private DimensionRowSelectionMessages msgs;
public DimensionRowSelectionDialog(ColumnData column, CellData cellData,
EventBus eventBus) {
@ -103,14 +106,20 @@ public class DimensionRowSelectionDialog extends Window {
EventBus eventBus) {
Log.debug("DimensionRowSelectionDialog: " + column + ", " + cellData);
this.column = column;
this.eventBus = eventBus;
this.cellData = cellData;
listeners = new ArrayList<DimensionRowSelectionListener>();
initMessages();
initWindow();
create();
open();
}
protected void initMessages(){
msgs = GWT.create(DimensionRowSelectionMessages.class);
}
protected void create() {
final FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
@ -171,7 +180,7 @@ public class DimensionRowSelectionDialog extends Window {
UtilsGXT3
.alert("Attention",
"No valid view column associated with this column!");
msgs.noValidViewColumnAssociatedWithThisColumn());
hide();
return;
@ -181,14 +190,15 @@ public class DimensionRowSelectionDialog extends Window {
}
if (showValue) {
v.add(new FieldLabel(value, "Value"), new VerticalLayoutData(1, -1));
v.add(new FieldLabel(value, msgs.valueLabel()), new VerticalLayoutData(1, -1));
}
v.add(gridPanel, new VerticalLayoutData(1, 1));
panel.add(v);
select = new TextButton("Select");
select.addSelectHandler(new SelectHandler() {
btnSelect = new TextButton(msgs.btnSelectText());
btnSelect.setToolTip(msgs.btnSelectToolTip());
btnSelect.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
@ -196,7 +206,7 @@ public class DimensionRowSelectionDialog extends Window {
}
});
panel.addButton(select);
panel.addButton(btnSelect);
add(panel);
forceLayout();
@ -206,7 +216,7 @@ public class DimensionRowSelectionDialog extends Window {
ArrayList<String> rowsId = gridPanel.getSelectedRowsId();
if (rowsId == null || rowsId.size() == 0) {
Log.debug("No row selected");
UtilsGXT3.alert("Attention", "Select a row");
UtilsGXT3.alert("Attention", msgs.selectARow());
} else {
String rowId = rowsId.get(0);
Log.debug("Row selected: " + rowId);
@ -224,7 +234,7 @@ public class DimensionRowSelectionDialog extends Window {
} else {
UtilsGXT3
.alert("Attention",
"No valid view column associated with this column!");
msgs.noValidViewColumnAssociatedWithThisColumn());
hide();
return;
}
@ -233,7 +243,7 @@ public class DimensionRowSelectionDialog extends Window {
if (cellValues == null || cellValues.size() == 0) {
Log.debug("No value retrieved");
UtilsGXT3.alert("Attention", "Select a row");
UtilsGXT3.alert("Attention", msgs.selectARow());
} else {
String cellValue = cellValues.get(0);
Log.debug("Retrived: " + rowId + " " + cellValue);
@ -259,7 +269,7 @@ public class DimensionRowSelectionDialog extends Window {
} else {
UtilsGXT3
.alert("Attention",
"No valid relationship associated with this column!");
msgs.noValidRelationshipAssociatedWithThisColumn());
hide();
return;
}
@ -279,7 +289,7 @@ public class DimensionRowSelectionDialog extends Window {
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Dimension");
setHeadingText(msgs.dialogHead());
setClosable(true);
// getHeader().setIcon(ResourceBundle.INSTANCE.replace());

View File

@ -0,0 +1,36 @@
package org.gcube.portlets.user.td.columnwidget.client.dimension;
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 DimensionRowSelectionMessages extends Messages {
@DefaultMessage("Dimension")
String dialogHead();
@DefaultMessage("No valid View Column associated with this column!")
String noValidViewColumnAssociatedWithThisColumn();
@DefaultMessage("Value")
String valueLabel();
@DefaultMessage("Select")
String btnSelectText();
@DefaultMessage("Select")
String btnSelectToolTip();
@DefaultMessage("Select a row!")
String selectARow();
@DefaultMessage("No valid Relationship associated with this column!")
String noValidRelationshipAssociatedWithThisColumn();
}

View File

@ -0,0 +1,14 @@
dialogHead = Connect
comboDimensionTypeEmptyText = Select a Codelist...
comboDimensionTypeLabel = Codelist
comboColumnReferenceTypeEmptyText = Select a Column Reference...
comboColumnReferenceTypeLabel = Column
btnConnectText = Connect
btnConnectToolTip = Connect
btnCloseText = Close
btnCloseToolTip = Close
selectAValidCodelist = Select a valid codelist
selectAValidColumn = Select a valid column
errorRetrievingColumnsHead = Error retrieving columns
errorRetrievingColumns = Error retrieving columns on server!

View File

@ -0,0 +1,13 @@
dialogHead = Conexión
comboDimensionTypeEmptyText = Seleccionar Codelist...
comboDimensionTypeLabel = Codelist
comboColumnReferenceTypeEmptyText = Seleccionar referencia...
comboColumnReferenceTypeLabel = Columna
btnConnectText = Conectar
btnConnectToolTip = Conectar
btnCloseText = Cerrar
btnCloseToolTip = Cerrar
selectAValidCodelist = Seleccionar una Codelist válida!
selectAValidColumn = Seleccionar una columna válida!
errorRetrievingColumnsHead = Error al recuperar las columnas
errorRetrievingColumns = Error al recuperar las columnas en el servidor!

View File

@ -0,0 +1,13 @@
dialogHead = Connessione
comboDimensionTypeEmptyText = Seleziona una Codelist...
comboDimensionTypeLabel = Codelist
comboColumnReferenceTypeEmptyText = Seleziona riferimento...
comboColumnReferenceTypeLabel = Colonna
btnConnectText = Connetti
btnConnectToolTip = Connetti
btnCloseText = Chiudi
btnCloseToolTip = Chiudi
selectAValidCodelist = Seleziona una codelist valida!
selectAValidColumn = Seleziona una colonna valida!
errorRetrievingColumnsHead = Errore recuperando le colonne
errorRetrievingColumns = Errore recuperando le colonne sul server!

View File

@ -0,0 +1,8 @@
dialogHead = Dimension
noValidViewColumnAssociatedWithThisColumn = No valid View Column associated with this column!
valueLabel = Value
btnSelectText = Select
btnSelectToolTip = Select
selectARow = Select a row!
noValidRelationshipAssociatedWithThisColumn = No valid Relationship associated with this column!

View File

@ -0,0 +1,7 @@
dialogHead = Dimension
noValidViewColumnAssociatedWithThisColumn = Ninguna View Column asociada a esta columna!
valueLabel = Valor
btnSelectText = Seleccionar
btnSelectToolTip = Seleccionar
selectARow = Seleccione una línea!
noValidRelationshipAssociatedWithThisColumn = Ninguna Relationship asociada a esta columna!

View File

@ -0,0 +1,7 @@
dialogHead = Dimension
noValidViewColumnAssociatedWithThisColumn = Nessuna View Column associata a questa colonna!
valueLabel = Valore
btnSelectText = Seleziona
btnSelectToolTip = Seleziona
selectARow = Seleziona una riga!
noValidRelationshipAssociatedWithThisColumn = Nessuna Relationship associata a questa colonna!