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-table-widget@120311 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
93e46eaf41
commit
9618648d34
|
@ -73,7 +73,7 @@ public interface TableWidgetMessages extends Messages {
|
||||||
@DefaultMessage("Error retrieving columns of tabular resource: ")
|
@DefaultMessage("Error retrieving columns of tabular resource: ")
|
||||||
String errorRetrievingColumsOfTabularResourceFixed();
|
String errorRetrievingColumsOfTabularResourceFixed();
|
||||||
|
|
||||||
@DefaultMessage("No Integer or Numeric column is present in the tabular resource!")
|
@DefaultMessage("No Integer or Numeric column is present!")
|
||||||
String attentionNoIntegerOrNumericColumnIsPresent();
|
String attentionNoIntegerOrNumericColumnIsPresent();
|
||||||
|
|
||||||
@DefaultMessage("Select a column...")
|
@DefaultMessage("Select a column...")
|
||||||
|
@ -184,6 +184,61 @@ public interface TableWidgetMessages extends Messages {
|
||||||
@DefaultMessage("Error retrieving history!")
|
@DefaultMessage("Error retrieving history!")
|
||||||
String errorRetrievingHistory();
|
String errorRetrievingHistory();
|
||||||
|
|
||||||
|
@DefaultMessage("Denormalization")
|
||||||
|
String denormalizationDialogHead();
|
||||||
|
|
||||||
|
@DefaultMessage("Select a column...")
|
||||||
|
String comboValueColumnEmptyText();
|
||||||
|
|
||||||
|
@DefaultMessage("Value Column")
|
||||||
|
String comboValueColumnLabel();
|
||||||
|
|
||||||
|
@DefaultMessage("Select a column...")
|
||||||
|
String comboAttributeColumnEmptyText();
|
||||||
|
|
||||||
|
@DefaultMessage("Attribute Column")
|
||||||
|
String comboAttributeColumnLabel();
|
||||||
|
|
||||||
|
@DefaultMessage("Denormalize")
|
||||||
|
String btnDenormalizeText();
|
||||||
|
|
||||||
|
@DefaultMessage("Denormalize")
|
||||||
|
String btnDenormalizeToolTip();
|
||||||
|
|
||||||
|
@DefaultMessage("Attention no value column selected!")
|
||||||
|
String attentionNoValueColumnSelected();
|
||||||
|
|
||||||
|
@DefaultMessage("Attention no attribute column selected!")
|
||||||
|
String attentionNoAttributeColumnSelected();
|
||||||
|
|
||||||
|
@DefaultMessage("Normalization")
|
||||||
|
String normalizeDialogHead();
|
||||||
|
|
||||||
|
@DefaultMessage("Normalize")
|
||||||
|
String btnNormalizeText();
|
||||||
|
|
||||||
|
@DefaultMessage("Normalize")
|
||||||
|
String btnNormalizeToolTip();
|
||||||
|
|
||||||
|
@DefaultMessage("Normalized column")
|
||||||
|
String normalizedColumnNameLabel();
|
||||||
|
|
||||||
|
@DefaultMessage("Value column")
|
||||||
|
String valueColumnNameLabel();
|
||||||
|
|
||||||
|
@DefaultMessage("Columns to Normalize")
|
||||||
|
String columnsToNormalizeLabel();
|
||||||
|
|
||||||
|
@DefaultMessage("Error retrieving columns!")
|
||||||
|
String errorRetrievingColumns();
|
||||||
|
|
||||||
|
@DefaultMessage("This tabular resource has not Integer or Numeric columns, normalize is not applicable!")
|
||||||
|
String attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable();
|
||||||
|
|
||||||
|
@DefaultMessage("Attention no column selected!")
|
||||||
|
String attentionNoColumnSelected();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client.normalize;
|
package org.gcube.portlets.user.td.tablewidget.client.normalize;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||||
|
import org.gcube.portlets.user.td.tablewidget.client.TableWidgetMessages;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
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.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;
|
||||||
|
@ -16,22 +18,30 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DenormalizeDialog extends Window {
|
public class DenormalizeDialog extends Window {
|
||||||
protected String WIDTH = "650px";
|
private static final String WIDTH = "650px";
|
||||||
protected String HEIGHT = "530px";
|
private static final String HEIGHT = "530px";
|
||||||
protected EventBus eventBus;
|
private DenormalizePanel normalizationPanel;
|
||||||
protected DenormalizePanel normalizationPanel;
|
private TableWidgetMessages msgs;
|
||||||
protected TRId trId;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param trId
|
||||||
|
* @param eventBus
|
||||||
|
*/
|
||||||
public DenormalizeDialog(TRId trId, EventBus eventBus) {
|
public DenormalizeDialog(TRId trId, EventBus eventBus) {
|
||||||
super();
|
super();
|
||||||
Log.debug("AddColumnDialog");
|
Log.debug("AddColumnDialog");
|
||||||
this.eventBus = eventBus;
|
initMessages();
|
||||||
this.trId=trId;
|
|
||||||
initWindow();
|
initWindow();
|
||||||
normalizationPanel = new DenormalizePanel(this, trId,eventBus);
|
normalizationPanel = new DenormalizePanel(this, trId,eventBus);
|
||||||
add(normalizationPanel);
|
add(normalizationPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void initMessages() {
|
||||||
|
msgs = GWT.create(TableWidgetMessages.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected void initWindow() {
|
protected void initWindow() {
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
|
@ -42,7 +52,7 @@ public class DenormalizeDialog extends Window {
|
||||||
setModal(true);
|
setModal(true);
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
||||||
getHeader().setIcon(ResourceBundle.INSTANCE.columnValue());
|
getHeader().setIcon(ResourceBundle.INSTANCE.columnValue());
|
||||||
setHeadingText("Denormalization");
|
setHeadingText(msgs.denormalizationDialogHead());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,8 +10,10 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.DenormalizationSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.DenormalizationSession;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
||||||
|
import org.gcube.portlets.user.td.tablewidget.client.TableWidgetMessages;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
||||||
|
@ -52,44 +54,47 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
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.form.FieldLabel;
|
||||||
import com.sencha.gxt.widget.core.client.info.Info;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author giancarlo
|
* @author giancarlo email: <a
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class DenormalizePanel extends FramedPanel implements
|
public class DenormalizePanel extends FramedPanel implements
|
||||||
MonitorDialogListener {
|
MonitorDialogListener {
|
||||||
protected String WIDTH = "640px";
|
private static final String WIDTH = "640px";
|
||||||
protected String HEIGHT = "520px";
|
private static final String HEIGHT = "520px";
|
||||||
|
|
||||||
protected TRId trId;
|
private TRId trId;
|
||||||
protected EventBus eventBus;
|
private EventBus eventBus;
|
||||||
protected ArrayList<String> rows;
|
|
||||||
|
|
||||||
protected DenormalizationSession denormalizationSession;
|
private DenormalizationSession denormalizationSession;
|
||||||
|
|
||||||
protected ComboBox<ColumnData> comboValueColumn = null;
|
private ComboBox<ColumnData> comboValueColumn = null;
|
||||||
protected ComboBox<ColumnData> comboAttributeColumn = null;
|
private ComboBox<ColumnData> comboAttributeColumn = null;
|
||||||
protected ListStore<ColumnData> storeComboAttributeColumn;
|
private ListStore<ColumnData> storeComboAttributeColumn;
|
||||||
|
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
||||||
|
|
||||||
protected FieldLabel comboAttributeColumnLabel;
|
private FieldLabel comboAttributeColumnLabel;
|
||||||
|
|
||||||
protected TextButton denormalizeButton;
|
private TextButton btnDenormalize;
|
||||||
|
|
||||||
protected DenormalizeDialog parent;
|
private DenormalizeDialog parent;
|
||||||
|
|
||||||
|
private ArrayList<ColumnData> columnsRetrieved;
|
||||||
|
|
||||||
|
private CommonMessages msgsCommon;
|
||||||
|
private TableWidgetMessages msgs;
|
||||||
|
|
||||||
protected ArrayList<ColumnData> columnsRetrieved;
|
|
||||||
|
|
||||||
public DenormalizePanel(DenormalizeDialog parent, TRId trId,
|
public DenormalizePanel(DenormalizeDialog parent, TRId trId,
|
||||||
EventBus eventBus) {
|
EventBus eventBus) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
|
initMessages();
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,9 +102,16 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.parent = null;
|
this.parent = null;
|
||||||
|
initMessages();
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void initMessages() {
|
||||||
|
msgsCommon = GWT.create(CommonMessages.class);
|
||||||
|
msgs = GWT.create(TableWidgetMessages.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected void create() {
|
protected void create() {
|
||||||
|
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
|
@ -155,12 +167,14 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
addHandlersForComboColumn(propsColumnData.label());
|
addHandlersForComboColumn(propsColumnData.label());
|
||||||
|
|
||||||
comboValueColumn.setLoader(loader);
|
comboValueColumn.setLoader(loader);
|
||||||
comboValueColumn.setEmptyText("Select a column...");
|
comboValueColumn.setEmptyText(msgs.comboValueColumnEmptyText());
|
||||||
comboValueColumn.setWidth(191);
|
comboValueColumn.setWidth(191);
|
||||||
comboValueColumn.setTypeAhead(false);
|
comboValueColumn.setTypeAhead(false);
|
||||||
comboValueColumn.setEditable(false);
|
comboValueColumn.setEditable(false);
|
||||||
comboValueColumn.setTriggerAction(TriggerAction.ALL);
|
comboValueColumn.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
|
FieldLabel comboValueColumnLabel=new FieldLabel(comboValueColumn, msgs.comboValueColumnLabel());
|
||||||
|
|
||||||
// Combo Attribute Column
|
// Combo Attribute Column
|
||||||
storeComboAttributeColumn = new ListStore<ColumnData>(
|
storeComboAttributeColumn = new ListStore<ColumnData>(
|
||||||
propsColumnData.id());
|
propsColumnData.id());
|
||||||
|
@ -174,19 +188,19 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
|
|
||||||
addHandlersForComboAttributeColumn(propsColumnData.label());
|
addHandlersForComboAttributeColumn(propsColumnData.label());
|
||||||
|
|
||||||
comboAttributeColumn.setEmptyText("Select a column...");
|
comboAttributeColumn.setEmptyText(msgs.comboAttributeColumnEmptyText());
|
||||||
comboAttributeColumn.setWidth(191);
|
comboAttributeColumn.setWidth(191);
|
||||||
comboAttributeColumn.setTypeAhead(true);
|
comboAttributeColumn.setTypeAhead(true);
|
||||||
comboAttributeColumn.setTriggerAction(TriggerAction.ALL);
|
comboAttributeColumn.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
comboAttributeColumnLabel = new FieldLabel(comboAttributeColumn,
|
comboAttributeColumnLabel = new FieldLabel(comboAttributeColumn,
|
||||||
"Attribute Column");
|
msgs.comboAttributeColumnLabel());
|
||||||
|
|
||||||
// Normalize Button
|
// Normalize Button
|
||||||
denormalizeButton = new TextButton("Denormalize");
|
btnDenormalize = new TextButton(msgs.btnDenormalizeText());
|
||||||
denormalizeButton.setIcon(ResourceBundle.INSTANCE.tableDenormalize());
|
btnDenormalize.setIcon(ResourceBundle.INSTANCE.tableDenormalize());
|
||||||
denormalizeButton.setIconAlign(IconAlign.RIGHT);
|
btnDenormalize.setIconAlign(IconAlign.RIGHT);
|
||||||
denormalizeButton.setTitle("Denormalize");
|
btnDenormalize.setToolTip(msgs.btnDenormalizeToolTip());
|
||||||
|
|
||||||
SelectHandler deleteHandler = new SelectHandler() {
|
SelectHandler deleteHandler = new SelectHandler() {
|
||||||
|
|
||||||
|
@ -195,14 +209,14 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
denormalizeButton.addSelectHandler(deleteHandler);
|
btnDenormalize.addSelectHandler(deleteHandler);
|
||||||
|
|
||||||
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
||||||
hBox.add(denormalizeButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
hBox.add(btnDenormalize, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
//v.setScrollMode(ScrollMode.AUTO); Set in GXT 3.0.1
|
// v.setScrollMode(ScrollMode.AUTO); Set in GXT 3.0.1
|
||||||
v.add(new FieldLabel(comboValueColumn, "Value Column"),
|
v.add(comboValueColumnLabel,
|
||||||
new VerticalLayoutData(1, -1, new Margins(1)));
|
new VerticalLayoutData(1, -1, new Margins(1)));
|
||||||
|
|
||||||
v.add(comboAttributeColumnLabel, new VerticalLayoutData(1, -1,
|
v.add(comboAttributeColumnLabel, new VerticalLayoutData(1, -1,
|
||||||
|
@ -212,7 +226,7 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
add(v, new VerticalLayoutData(-1, -1, new Margins(0)));
|
add(v, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||||
|
|
||||||
comboAttributeColumnLabel.setVisible(false);
|
comboAttributeColumnLabel.setVisible(false);
|
||||||
denormalizeButton.disable();
|
btnDenormalize.disable();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,13 +235,6 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
comboValueColumn
|
comboValueColumn
|
||||||
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||||
public void onSelection(SelectionEvent<ColumnData> event) {
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
||||||
Info.display(
|
|
||||||
"Value Column Selected",
|
|
||||||
"You selected "
|
|
||||||
+ (event.getSelectedItem() == null ? "nothing"
|
|
||||||
: labelProvider.getLabel(event
|
|
||||||
.getSelectedItem())
|
|
||||||
+ "!"));
|
|
||||||
Log.debug("ComboValueColumn selected: "
|
Log.debug("ComboValueColumn selected: "
|
||||||
+ event.getSelectedItem());
|
+ event.getSelectedItem());
|
||||||
ColumnData valueColumn = event.getSelectedItem();
|
ColumnData valueColumn = event.getSelectedItem();
|
||||||
|
@ -242,13 +249,6 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
comboAttributeColumn
|
comboAttributeColumn
|
||||||
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||||
public void onSelection(SelectionEvent<ColumnData> event) {
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
||||||
Info.display(
|
|
||||||
"Attribute Column Selected",
|
|
||||||
"You selected "
|
|
||||||
+ (event.getSelectedItem() == null ? "nothing"
|
|
||||||
: labelProvider.getLabel(event
|
|
||||||
.getSelectedItem())
|
|
||||||
+ "!"));
|
|
||||||
Log.debug("ComboAttributeColumn selected: "
|
Log.debug("ComboAttributeColumn selected: "
|
||||||
+ event.getSelectedItem());
|
+ event.getSelectedItem());
|
||||||
ColumnData attributeColumn = event.getSelectedItem();
|
ColumnData attributeColumn = event.getSelectedItem();
|
||||||
|
@ -268,13 +268,13 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
}
|
}
|
||||||
storeComboAttributeColumn.commitChanges();
|
storeComboAttributeColumn.commitChanges();
|
||||||
comboAttributeColumnLabel.setVisible(true);
|
comboAttributeColumnLabel.setVisible(true);
|
||||||
denormalizeButton.disable();
|
btnDenormalize.disable();
|
||||||
forceLayout();
|
forceLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateComboAttributeColumn(ColumnData columnData) {
|
protected void updateComboAttributeColumn(ColumnData columnData) {
|
||||||
denormalizeButton.enable();
|
btnDenormalize.enable();
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
storeComboAttributeColumn.clear();
|
storeComboAttributeColumn.clear();
|
||||||
storeComboAttributeColumn.commitChanges();
|
storeComboAttributeColumn.commitChanges();
|
||||||
comboAttributeColumnLabel.setVisible(false);
|
comboAttributeColumnLabel.setVisible(false);
|
||||||
denormalizeButton.disable();
|
btnDenormalize.disable();
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,13 +299,13 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsLockedException) {
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
Log.error(caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Locked",
|
UtilsGXT3.alert(msgsCommon.errorLocked(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
Log.error("load combo failure:"
|
Log.error("load combo failure:"
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error",
|
UtilsGXT3.alert(msgsCommon.error(),
|
||||||
"Error retrieving columns of tabular resource:"
|
msgs.errorRetrievingColumsOfTabularResourceFixed()
|
||||||
+ trId.getId());
|
+ trId.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -327,8 +327,8 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
}
|
}
|
||||||
if (columnsIntegerNumeric.size() < 1) {
|
if (columnsIntegerNumeric.size() < 1) {
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Attention",
|
.alert(msgsCommon.attention(),
|
||||||
"No Column with data type Integer or Numeric");
|
msgs.attentionNoIntegerOrNumericColumnIsPresent());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,14 +351,14 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
|
|
||||||
ColumnData valueColumn = comboValueColumn.getCurrentValue();
|
ColumnData valueColumn = comboValueColumn.getCurrentValue();
|
||||||
if (valueColumn == null) {
|
if (valueColumn == null) {
|
||||||
UtilsGXT3.alert("Attention", "Attention no value column selected!");
|
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionNoValueColumnSelected());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnData attributeColumn = comboAttributeColumn.getCurrentValue();
|
ColumnData attributeColumn = comboAttributeColumn.getCurrentValue();
|
||||||
if (attributeColumn == null) {
|
if (attributeColumn == null) {
|
||||||
UtilsGXT3.alert("Attention",
|
UtilsGXT3.alert(msgsCommon.attention(),
|
||||||
"Attention no attribute column selected!");
|
msgs.attentionNoAttributeColumnSelected());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,17 +375,17 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsLockedException) {
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
Log.error(caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Locked",
|
UtilsGXT3.alert(msgsCommon.errorLocked(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsFinalException) {
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
Log.error(caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Final",
|
UtilsGXT3.alert(msgsCommon.errorFinal(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Denormalize Error: "
|
Log.debug("Denormalize Error: "
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error on Denormalize",
|
UtilsGXT3.alert(msgsCommon.error(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -417,7 +417,8 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
public void operationComplete(OperationResult operationResult) {
|
public void operationComplete(OperationResult operationResult) {
|
||||||
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
||||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||||
ChangeTableRequestType.DENORMALIZE, operationResult.getTrId(), why);
|
ChangeTableRequestType.DENORMALIZE, operationResult.getTrId(),
|
||||||
|
why);
|
||||||
eventBus.fireEvent(changeTableRequestEvent);
|
eventBus.fireEvent(changeTableRequestEvent);
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
@ -430,10 +431,12 @@ public class DenormalizePanel extends FramedPanel implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationStopped(OperationResult operationResult, String reason, String details) {
|
public void operationStopped(OperationResult operationResult,
|
||||||
|
String reason, String details) {
|
||||||
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
||||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||||
ChangeTableRequestType.DENORMALIZE, operationResult.getTrId(), why);
|
ChangeTableRequestType.DENORMALIZE, operationResult.getTrId(),
|
||||||
|
why);
|
||||||
eventBus.fireEvent(changeTableRequestEvent);
|
eventBus.fireEvent(changeTableRequestEvent);
|
||||||
close();
|
close();
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package org.gcube.portlets.user.td.tablewidget.client.normalize;
|
package org.gcube.portlets.user.td.tablewidget.client.normalize;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||||
|
import org.gcube.portlets.user.td.tablewidget.client.TableWidgetMessages;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
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.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;
|
||||||
|
@ -16,22 +18,26 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class NormalizeDialog extends Window {
|
public class NormalizeDialog extends Window {
|
||||||
protected String WIDTH = "650px";
|
private static final String WIDTH = "650px";
|
||||||
protected String HEIGHT = "530px";
|
private static final String HEIGHT = "530px";
|
||||||
protected EventBus eventBus;
|
private NormalizePanel normalizationPanel;
|
||||||
protected NormalizePanel normalizationPanel;
|
private TableWidgetMessages msgs;
|
||||||
protected TRId trId;
|
|
||||||
|
|
||||||
public NormalizeDialog(TRId trId, EventBus eventBus) {
|
public NormalizeDialog(TRId trId, EventBus eventBus) {
|
||||||
super();
|
super();
|
||||||
Log.debug("AddColumnDialog");
|
Log.debug("AddColumnDialog");
|
||||||
this.eventBus = eventBus;
|
initMessages();
|
||||||
this.trId=trId;
|
|
||||||
initWindow();
|
initWindow();
|
||||||
normalizationPanel = new NormalizePanel(this, trId,eventBus);
|
normalizationPanel = new NormalizePanel(this, trId,eventBus);
|
||||||
add(normalizationPanel);
|
add(normalizationPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void initMessages() {
|
||||||
|
msgs = GWT.create(TableWidgetMessages.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void initWindow() {
|
protected void initWindow() {
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
|
@ -42,7 +48,7 @@ public class NormalizeDialog extends Window {
|
||||||
setModal(true);
|
setModal(true);
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
||||||
getHeader().setIcon(ResourceBundle.INSTANCE.columnValue());
|
getHeader().setIcon(ResourceBundle.INSTANCE.columnValue());
|
||||||
setHeadingText("Normalization");
|
setHeadingText(msgs.normalizeDialogHead());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,9 +10,11 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.NormalizationSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.normalization.NormalizationSession;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
|
||||||
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
|
||||||
|
import org.gcube.portlets.user.td.tablewidget.client.TableWidgetMessages;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.properties.ColumnDataProperties;
|
import org.gcube.portlets.user.td.tablewidget.client.properties.ColumnDataProperties;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
|
||||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
|
||||||
|
@ -64,28 +66,30 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||||
*/
|
*/
|
||||||
public class NormalizePanel extends FramedPanel implements
|
public class NormalizePanel extends FramedPanel implements
|
||||||
MonitorDialogListener {
|
MonitorDialogListener {
|
||||||
protected String WIDTH = "640px";
|
private static final String WIDTH = "640px";
|
||||||
protected String HEIGHT = "520px";
|
private static final String HEIGHT = "520px";
|
||||||
|
|
||||||
protected TRId trId;
|
private TRId trId;
|
||||||
protected EventBus eventBus;
|
private EventBus eventBus;
|
||||||
protected ArrayList<String> rows;
|
|
||||||
|
|
||||||
protected NormalizationSession normalizationSession;
|
private NormalizationSession normalizationSession;
|
||||||
|
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
||||||
protected Grid<ColumnData> grid;
|
private Grid<ColumnData> grid;
|
||||||
protected CheckBoxSelectionModel<ColumnData> sm;
|
private CheckBoxSelectionModel<ColumnData> sm;
|
||||||
protected FieldLabel columnsSelectLabel;
|
private TextButton btnNormalize;
|
||||||
protected TextButton normalizeButton;
|
private TextField normalizedColumnName;
|
||||||
protected TextField normalizedColumnName;
|
private TextField valueColumnName;
|
||||||
protected TextField valueColumnName;
|
private NormalizeDialog parent;
|
||||||
protected NormalizeDialog parent;
|
|
||||||
|
private CommonMessages msgsCommon;
|
||||||
|
private TableWidgetMessages msgs;
|
||||||
|
|
||||||
public NormalizePanel(NormalizeDialog parent, TRId trId, EventBus eventBus) {
|
public NormalizePanel(NormalizeDialog parent, TRId trId, EventBus eventBus) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
|
initMessages();
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,9 +97,16 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
this.parent = null;
|
this.parent = null;
|
||||||
|
initMessages();
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void initMessages() {
|
||||||
|
msgsCommon = GWT.create(CommonMessages.class);
|
||||||
|
msgs = GWT.create(TableWidgetMessages.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected void create() {
|
protected void create() {
|
||||||
Log.debug("Create NormalizationPanel(): [" + trId.toString() + "]");
|
Log.debug("Create NormalizationPanel(): [" + trId.toString() + "]");
|
||||||
|
|
||||||
|
@ -105,10 +116,10 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
|
|
||||||
// Normalize Button
|
// Normalize Button
|
||||||
normalizeButton = new TextButton("Normalize");
|
btnNormalize = new TextButton(msgs.btnNormalizeText());
|
||||||
normalizeButton.setIcon(ResourceBundle.INSTANCE.tableNormalize());
|
btnNormalize.setIcon(ResourceBundle.INSTANCE.tableNormalize());
|
||||||
normalizeButton.setIconAlign(IconAlign.RIGHT);
|
btnNormalize.setIconAlign(IconAlign.RIGHT);
|
||||||
normalizeButton.setTitle("Normalize");
|
btnNormalize.setToolTip(msgs.btnNormalizeToolTip());
|
||||||
|
|
||||||
SelectHandler normalizeHandler = new SelectHandler() {
|
SelectHandler normalizeHandler = new SelectHandler() {
|
||||||
|
|
||||||
|
@ -117,24 +128,24 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
normalizeButton.addSelectHandler(normalizeHandler);
|
btnNormalize.addSelectHandler(normalizeHandler);
|
||||||
|
|
||||||
normalizedColumnName = new TextField();
|
normalizedColumnName = new TextField();
|
||||||
FieldLabel normalizedColumnNameLabel = new FieldLabel(
|
FieldLabel normalizedColumnNameLabel = new FieldLabel(
|
||||||
normalizedColumnName, "Normalized column");
|
normalizedColumnName, msgs.normalizedColumnNameLabel());
|
||||||
normalizedColumnNameLabel.setLabelWidth(110);
|
normalizedColumnNameLabel.setLabelWidth(110);
|
||||||
|
|
||||||
valueColumnName = new TextField();
|
valueColumnName = new TextField();
|
||||||
FieldLabel valueColumnNameLabel = new FieldLabel(valueColumnName,
|
FieldLabel valueColumnNameLabel = new FieldLabel(valueColumnName,
|
||||||
"Value column");
|
msgs.valueColumnNameLabel());
|
||||||
valueColumnNameLabel.setLabelWidth(110);
|
valueColumnNameLabel.setLabelWidth(110);
|
||||||
|
|
||||||
FieldLabel columnsLabel = new FieldLabel(null, "Columns to Normalize");
|
FieldLabel columnsToNormalizeLabel = new FieldLabel(null, msgs.columnsToNormalizeLabel());
|
||||||
columnsLabel.setLabelWidth(150);
|
columnsToNormalizeLabel.setLabelWidth(150);
|
||||||
columnsLabel.getElement().applyStyles("font-weight:bold");
|
columnsToNormalizeLabel.getElement().applyStyles("font-weight:bold");
|
||||||
|
|
||||||
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
|
||||||
hBox.add(normalizeButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
hBox.add(btnNormalize, new BoxLayoutData(new Margins(2, 5, 2, 5)));
|
||||||
|
|
||||||
// Grid ColumnData
|
// Grid ColumnData
|
||||||
ColumnDataProperties props = GWT.create(ColumnDataProperties.class);
|
ColumnDataProperties props = GWT.create(ColumnDataProperties.class);
|
||||||
|
@ -198,7 +209,7 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
v.setAdjustForScroll(true);
|
v.setAdjustForScroll(true);
|
||||||
v.add(normalizedColumnNameLabel, new VerticalLayoutData(1, -1));
|
v.add(normalizedColumnNameLabel, new VerticalLayoutData(1, -1));
|
||||||
v.add(valueColumnNameLabel, new VerticalLayoutData(1, -1));
|
v.add(valueColumnNameLabel, new VerticalLayoutData(1, -1));
|
||||||
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
|
v.add(columnsToNormalizeLabel, 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)));
|
||||||
|
@ -229,17 +240,17 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsLockedException) {
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
Log.error(caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Locked",
|
UtilsGXT3.alert(msgsCommon.errorLocked(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
Log.error("load columns failure:"
|
Log.error("load columns failure:"
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving columns",
|
UtilsGXT3.alert(msgsCommon.error(),
|
||||||
"Error retrieving columns");
|
msgs.errorRetrievingColumns());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
normalizeButton.disable();
|
btnNormalize.disable();
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,13 +262,13 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
result));
|
result));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
normalizeButton.disable();
|
btnNormalize.disable();
|
||||||
Log.error("This tabular resource has not Integer or Numeric columns, normalize is not applicable!");
|
Log.error("This tabular resource has not Integer or Numeric columns, normalize is not applicable!");
|
||||||
UtilsGXT3
|
UtilsGXT3
|
||||||
.alert("Attention",
|
.alert(msgsCommon.attention(),
|
||||||
"This tabular resource has not Integer or Numeric columns, normalize is not applicable!");
|
msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable());
|
||||||
callback.onFailure(new Throwable(
|
callback.onFailure(new Throwable(
|
||||||
"This tabular resource has not Integer or Numeric columns, normalize is not applicable!"));
|
msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -282,7 +293,7 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
protected void onNormalize() {
|
protected void onNormalize() {
|
||||||
ArrayList<ColumnData> col = getSelectedItems();
|
ArrayList<ColumnData> col = getSelectedItems();
|
||||||
if (col == null || col.size() < 1) {
|
if (col == null || col.size() < 1) {
|
||||||
UtilsGXT3.alert("Attention", "Attention no column selected!");
|
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionNoColumnSelected());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,17 +312,17 @@ public class NormalizePanel extends FramedPanel implements
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsLockedException) {
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
Log.error(caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Locked",
|
UtilsGXT3.alert(msgsCommon.errorLocked(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsFinalException) {
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
Log.error(caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Final",
|
UtilsGXT3.alert(msgsCommon.errorFinal(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Normalization Error: "
|
Log.debug("Normalization Error: "
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error on Normalization",
|
UtilsGXT3.alert(msgsCommon.error(),
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue