Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@120312 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-11-18 17:09:35 +00:00 committed by Giancarlo Panichi
parent 9618648d34
commit 51bcc8853a
5 changed files with 111 additions and 117 deletions

View File

@ -4,243 +4,238 @@ import com.google.gwt.i18n.client.Messages;
/** /**
* *
* @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 interface TableWidgetMessages extends Messages { public interface TableWidgetMessages extends Messages {
@DefaultMessage("Error in clone operation! ") @DefaultMessage("Error in clone operation! ")
String errorInCloneFixed(); String errorInCloneFixed();
@DefaultMessage("Select a Table Type...") @DefaultMessage("Select a Table Type...")
String comboTableTypeEmptyText(); String comboTableTypeEmptyText();
@DefaultMessage("Apply") @DefaultMessage("Apply")
String btnApplyText(); String btnApplyText();
@DefaultMessage("Apply Table Type") @DefaultMessage("Apply Table Type")
String btnApplyToolTip(); String btnApplyToolTip();
@DefaultMessage("Table Type") @DefaultMessage("Table Type")
String comboTableTypeLabel(); String comboTableTypeLabel();
@DefaultMessage("Invalid table type!") @DefaultMessage("Invalid table type!")
String errorInvalidTableType(); String errorInvalidTableType();
@DefaultMessage("Select a table type!") @DefaultMessage("Select a table type!")
String attentionSelectATableType(); String attentionSelectATableType();
@DefaultMessage("Error in invocation of Change Table Type operation.") @DefaultMessage("Error in invocation of Change Table Type operation.")
String errorInChangeTableTypeOperationFixed(); String errorInChangeTableTypeOperationFixed();
@DefaultMessage("Select a column...") @DefaultMessage("Select a column...")
String comboLatitudeEmptyText(); String comboLatitudeEmptyText();
@DefaultMessage("Select a column...") @DefaultMessage("Select a column...")
String comboLongitudeEmptyMessage(); String comboLongitudeEmptyMessage();
@DefaultMessage("Points") @DefaultMessage("Points")
String columnFieldDefault(); String columnFieldDefault();
@DefaultMessage("Column Label") @DefaultMessage("Column Label")
String columnFieldLabel(); String columnFieldLabel();
@DefaultMessage("Create") @DefaultMessage("Create")
String btnCreatePointText(); String btnCreatePointText();
@DefaultMessage("Create Point") @DefaultMessage("Create Point")
String btnCreatePointToolTip(); String btnCreatePointToolTip();
@DefaultMessage("Longitude") @DefaultMessage("Longitude")
String comboLongitudeLabel(); String comboLongitudeLabel();
@DefaultMessage("Latitude") @DefaultMessage("Latitude")
String comboLatitudeLabel(); String comboLatitudeLabel();
@DefaultMessage("Select a column label!") @DefaultMessage("Select a column label!")
String attentionSelectAColumnLabel(); String attentionSelectAColumnLabel();
@DefaultMessage("Select Latitude!") @DefaultMessage("Select Latitude!")
String attentionSelectLatitude(); String attentionSelectLatitude();
@DefaultMessage("Select Longitude!") @DefaultMessage("Select Longitude!")
String attentionSelectLongitude(); String attentionSelectLongitude();
@DefaultMessage("Error creating a point: ") @DefaultMessage("Error creating a point: ")
String errorCreatingAPointFixed(); String errorCreatingAPointFixed();
@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!") @DefaultMessage("No Integer or Numeric column is present!")
String attentionNoIntegerOrNumericColumnIsPresent(); String attentionNoIntegerOrNumericColumnIsPresent();
@DefaultMessage("Select a column...") @DefaultMessage("Select a column...")
String comboCSquareColumnEmptyText(); String comboCSquareColumnEmptyText();
@DefaultMessage("Select a resolution...") @DefaultMessage("Select a resolution...")
String comboDownscaleEmptyText(); String comboDownscaleEmptyText();
@DefaultMessage("Downscale") @DefaultMessage("Downscale")
String btnDownscaleText(); String btnDownscaleText();
@DefaultMessage("Downscale C-Square") @DefaultMessage("Downscale C-Square")
String btnDownscaleToolTip(); String btnDownscaleToolTip();
@DefaultMessage("Column") @DefaultMessage("Column")
String comboCSquareColumnLabel(); String comboCSquareColumnLabel();
@DefaultMessage("Resolution") @DefaultMessage("Resolution")
String comboDownscaleLabel(); String comboDownscaleLabel();
@DefaultMessage("Select Resolution!") @DefaultMessage("Select Resolution!")
String attentionSelectResolution(); String attentionSelectResolution();
@DefaultMessage("Select C-Square column!") @DefaultMessage("Select C-Square column!")
String attentionSelectCSquareColumn(); String attentionSelectCSquareColumn();
@DefaultMessage("No text column is present in the tabular resource. C-Square is a text column data type!") @DefaultMessage("No text column is present in the tabular resource. C-Square is a text column data type!")
String attentionNoTextColumnIsPresentCSquareIsTextColumn(); String attentionNoTextColumnIsPresentCSquareIsTextColumn();
@DefaultMessage("Select a type...") @DefaultMessage("Select a type...")
String comboGsCoordinateTypeEmptyText(); String comboGsCoordinateTypeEmptyText();
@DefaultMessage("Select a resolution...") @DefaultMessage("Select a resolution...")
String comboResolutionEmptyText(); String comboResolutionEmptyText();
@DefaultMessage("Resolution") @DefaultMessage("Resolution")
String comboResolutionLabel(); String comboResolutionLabel();
@DefaultMessage("True") @DefaultMessage("True")
String hasQuadrantTrue(); String hasQuadrantTrue();
@DefaultMessage("False") @DefaultMessage("False")
String hasQuadrantFalse(); String hasQuadrantFalse();
@DefaultMessage("No Integer column is present in the tabular resource!") @DefaultMessage("No Integer column is present in the tabular resource!")
String attentionNoIntegerColumnIsPresent(); String attentionNoIntegerColumnIsPresent();
@DefaultMessage("Has Quadrant") @DefaultMessage("Has Quadrant")
String hasQuadrantLabel(); String hasQuadrantLabel();
@DefaultMessage("Select true if you want select quadrant column") @DefaultMessage("Select true if you want select quadrant column")
String hasQuadrantToolTip(); String hasQuadrantToolTip();
@DefaultMessage("Select a column...") @DefaultMessage("Select a column...")
String comboQuadrantEmptyText(); String comboQuadrantEmptyText();
@DefaultMessage("Quadrant") @DefaultMessage("Quadrant")
String comboQuadrantLabel(); String comboQuadrantLabel();
@DefaultMessage("Create") @DefaultMessage("Create")
String btnCreateCoordinatesText(); String btnCreateCoordinatesText();
@DefaultMessage("Create Geospatial Coordinates") @DefaultMessage("Create Geospatial Coordinates")
String btnCreateCoordinatesToolTip(); String btnCreateCoordinatesToolTip();
@DefaultMessage("Type") @DefaultMessage("Type")
String comboGsCoordinatesTypeLabel(); String comboGsCoordinatesTypeLabel();
@DefaultMessage("Select Quadrant column!") @DefaultMessage("Select Quadrant column!")
String attentionSelectQuadrantColumn(); String attentionSelectQuadrantColumn();
@DefaultMessage("Select valid geospatial coordinates type!") @DefaultMessage("Select valid geospatial coordinates type!")
String selectValidGeospatialCoordinatesType(); String selectValidGeospatialCoordinatesType();
@DefaultMessage("Invalid Geospatial Coordinates Type!") @DefaultMessage("Invalid Geospatial Coordinates Type!")
String attentionInvalidGeospatialCoordinateType(); String attentionInvalidGeospatialCoordinateType();
@DefaultMessage("Error creating geospatial coordinates: ") @DefaultMessage("Error creating geospatial coordinates: ")
String errorCreatingGeospatialCoordinatesFixed(); String errorCreatingGeospatialCoordinatesFixed();
@DefaultMessage("Error retrieving current tabular resource id!") @DefaultMessage("Error retrieving current tabular resource id!")
String errorRetrievingCurrentTabularResourceId(); String errorRetrievingCurrentTabularResourceId();
@DefaultMessage("Undo not applicable") @DefaultMessage("Undo not applicable")
String attentionUndoNotApplicable(); String attentionUndoNotApplicable();
@DefaultMessage("Date:") @DefaultMessage("Date:")
String dateFixed(); String dateFixed();
@DefaultMessage("Description:") @DefaultMessage("Description:")
String descriptionFixed(); String descriptionFixed();
@DefaultMessage("Step") @DefaultMessage("Step")
String stepCol(); String stepCol();
@DefaultMessage("Date") @DefaultMessage("Date")
String dateCol(); String dateCol();
@DefaultMessage("Undo") @DefaultMessage("Undo")
String rollBackCol(); String rollBackCol();
@DefaultMessage("Undo") @DefaultMessage("Undo")
String btnCellUndoTitle(); String btnCellUndoTitle();
@DefaultMessage("Empty") @DefaultMessage("Empty")
String gridHistoryEmptyText(); String gridHistoryEmptyText();
@DefaultMessage("Error retrieving history!") @DefaultMessage("Error retrieving history!")
String errorRetrievingHistory(); String errorRetrievingHistory();
@DefaultMessage("Denormalization") @DefaultMessage("Denormalization")
String denormalizationDialogHead(); String denormalizationDialogHead();
@DefaultMessage("Select a column...") @DefaultMessage("Select a column...")
String comboValueColumnEmptyText(); String comboValueColumnEmptyText();
@DefaultMessage("Value Column") @DefaultMessage("Value Column")
String comboValueColumnLabel(); String comboValueColumnLabel();
@DefaultMessage("Select a column...") @DefaultMessage("Select a column...")
String comboAttributeColumnEmptyText(); String comboAttributeColumnEmptyText();
@DefaultMessage("Attribute Column") @DefaultMessage("Attribute Column")
String comboAttributeColumnLabel(); String comboAttributeColumnLabel();
@DefaultMessage("Denormalize") @DefaultMessage("Denormalize")
String btnDenormalizeText(); String btnDenormalizeText();
@DefaultMessage("Denormalize") @DefaultMessage("Denormalize")
String btnDenormalizeToolTip(); String btnDenormalizeToolTip();
@DefaultMessage("Attention no value column selected!") @DefaultMessage("Attention no value column selected!")
String attentionNoValueColumnSelected(); String attentionNoValueColumnSelected();
@DefaultMessage("Attention no attribute column selected!") @DefaultMessage("Attention no attribute column selected!")
String attentionNoAttributeColumnSelected(); String attentionNoAttributeColumnSelected();
@DefaultMessage("Normalization") @DefaultMessage("Normalization")
String normalizeDialogHead(); String normalizeDialogHead();
@DefaultMessage("Normalize") @DefaultMessage("Normalize")
String btnNormalizeText(); String btnNormalizeText();
@DefaultMessage("Normalize") @DefaultMessage("Normalize")
String btnNormalizeToolTip(); String btnNormalizeToolTip();
@DefaultMessage("Normalized column") @DefaultMessage("Normalized column")
String normalizedColumnNameLabel(); String normalizedColumnNameLabel();
@DefaultMessage("Value column") @DefaultMessage("Value column")
String valueColumnNameLabel(); String valueColumnNameLabel();
@DefaultMessage("Columns to Normalize") @DefaultMessage("Columns to Normalize")
String columnsToNormalizeLabel(); String columnsToNormalizeLabel();
@DefaultMessage("Error retrieving columns!") @DefaultMessage("Error retrieving columns!")
String errorRetrievingColumns(); String errorRetrievingColumns();
@DefaultMessage("This tabular resource has not Integer or Numeric columns, normalize is not applicable!") @DefaultMessage("This tabular resource has not Integer or Numeric columns, normalize is not applicable!")
String attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable(); String attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable();
@DefaultMessage("Attention no column selected!") @DefaultMessage("Attention no column selected!")
String attentionNoColumnSelected(); String attentionNoColumnSelected();
} }

View File

@ -13,8 +13,8 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/** /**
* *
* @author "Giancarlo Panichi" * @author "Giancarlo Panichi" 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 DenormalizeDialog extends Window { public class DenormalizeDialog extends Window {
@ -22,7 +22,7 @@ public class DenormalizeDialog extends Window {
private static final String HEIGHT = "530px"; private static final String HEIGHT = "530px";
private DenormalizePanel normalizationPanel; private DenormalizePanel normalizationPanel;
private TableWidgetMessages msgs; private TableWidgetMessages msgs;
/** /**
* *
* @param trId * @param trId
@ -33,7 +33,7 @@ public class DenormalizeDialog extends Window {
Log.debug("AddColumnDialog"); Log.debug("AddColumnDialog");
initMessages(); initMessages();
initWindow(); initWindow();
normalizationPanel = new DenormalizePanel(this, trId,eventBus); normalizationPanel = new DenormalizePanel(this, trId, eventBus);
add(normalizationPanel); add(normalizationPanel);
} }
@ -41,7 +41,7 @@ public class DenormalizeDialog extends Window {
msgs = GWT.create(TableWidgetMessages.class); msgs = GWT.create(TableWidgetMessages.class);
} }
protected void initWindow() { protected void initWindow() {
setWidth(WIDTH); setWidth(WIDTH);
setHeight(HEIGHT); setHeight(HEIGHT);
@ -76,6 +76,4 @@ public class DenormalizeDialog extends Window {
} }
} }

View File

@ -84,11 +84,10 @@ public class DenormalizePanel extends FramedPanel implements
private DenormalizeDialog parent; private DenormalizeDialog parent;
private ArrayList<ColumnData> columnsRetrieved; private ArrayList<ColumnData> columnsRetrieved;
private CommonMessages msgsCommon; private CommonMessages msgsCommon;
private TableWidgetMessages msgs; private TableWidgetMessages msgs;
public DenormalizePanel(DenormalizeDialog parent, TRId trId, public DenormalizePanel(DenormalizeDialog parent, TRId trId,
EventBus eventBus) { EventBus eventBus) {
this.parent = parent; this.parent = parent;
@ -173,8 +172,9 @@ public class DenormalizePanel extends FramedPanel implements
comboValueColumn.setEditable(false); comboValueColumn.setEditable(false);
comboValueColumn.setTriggerAction(TriggerAction.ALL); comboValueColumn.setTriggerAction(TriggerAction.ALL);
FieldLabel comboValueColumnLabel=new FieldLabel(comboValueColumn, msgs.comboValueColumnLabel()); 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());
@ -216,8 +216,8 @@ public class DenormalizePanel extends FramedPanel implements
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(comboValueColumnLabel, v.add(comboValueColumnLabel, new VerticalLayoutData(1, -1, new Margins(
new VerticalLayoutData(1, -1, new Margins(1))); 1)));
v.add(comboAttributeColumnLabel, new VerticalLayoutData(1, -1, v.add(comboAttributeColumnLabel, new VerticalLayoutData(1, -1,
new Margins(1))); new Margins(1)));
@ -304,7 +304,8 @@ public class DenormalizePanel extends FramedPanel implements
} else { } else {
Log.error("load combo failure:" Log.error("load combo failure:"
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
UtilsGXT3.alert(msgsCommon.error(), UtilsGXT3.alert(
msgsCommon.error(),
msgs.errorRetrievingColumsOfTabularResourceFixed() msgs.errorRetrievingColumsOfTabularResourceFixed()
+ trId.getId()); + trId.getId());
} }
@ -326,9 +327,9 @@ public class DenormalizePanel extends FramedPanel implements
} }
} }
if (columnsIntegerNumeric.size() < 1) { if (columnsIntegerNumeric.size() < 1) {
UtilsGXT3 UtilsGXT3.alert(
.alert(msgsCommon.attention(), msgsCommon.attention(),
msgs.attentionNoIntegerOrNumericColumnIsPresent()); msgs.attentionNoIntegerOrNumericColumnIsPresent());
return; return;
} }
@ -351,7 +352,8 @@ public class DenormalizePanel extends FramedPanel implements
ColumnData valueColumn = comboValueColumn.getCurrentValue(); ColumnData valueColumn = comboValueColumn.getCurrentValue();
if (valueColumn == null) { if (valueColumn == null) {
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionNoValueColumnSelected()); UtilsGXT3.alert(msgsCommon.attention(),
msgs.attentionNoValueColumnSelected());
return; return;
} }

View File

@ -13,8 +13,8 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/** /**
* *
* @author "Giancarlo Panichi" * @author "Giancarlo Panichi" 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 NormalizeDialog extends Window { public class NormalizeDialog extends Window {
@ -22,22 +22,21 @@ public class NormalizeDialog extends Window {
private static final String HEIGHT = "530px"; private static final String HEIGHT = "530px";
private NormalizePanel normalizationPanel; private NormalizePanel normalizationPanel;
private TableWidgetMessages msgs; private TableWidgetMessages msgs;
public NormalizeDialog(TRId trId, EventBus eventBus) { public NormalizeDialog(TRId trId, EventBus eventBus) {
super(); super();
Log.debug("AddColumnDialog"); Log.debug("AddColumnDialog");
initMessages(); initMessages();
initWindow(); initWindow();
normalizationPanel = new NormalizePanel(this, trId,eventBus); normalizationPanel = new NormalizePanel(this, trId, eventBus);
add(normalizationPanel); add(normalizationPanel);
} }
protected void initMessages() { protected void initMessages() {
msgs = GWT.create(TableWidgetMessages.class); msgs = GWT.create(TableWidgetMessages.class);
} }
protected void initWindow() { protected void initWindow() {
setWidth(WIDTH); setWidth(WIDTH);
setHeight(HEIGHT); setHeight(HEIGHT);
@ -72,6 +71,4 @@ public class NormalizeDialog extends Window {
} }
} }

View File

@ -71,7 +71,7 @@ public class NormalizePanel extends FramedPanel implements
private TRId trId; private TRId trId;
private EventBus eventBus; private EventBus eventBus;
private NormalizationSession normalizationSession; private NormalizationSession normalizationSession;
private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader; private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
@ -81,7 +81,7 @@ public class NormalizePanel extends FramedPanel implements
private TextField normalizedColumnName; private TextField normalizedColumnName;
private TextField valueColumnName; private TextField valueColumnName;
private NormalizeDialog parent; private NormalizeDialog parent;
private CommonMessages msgsCommon; private CommonMessages msgsCommon;
private TableWidgetMessages msgs; private TableWidgetMessages msgs;
@ -100,7 +100,7 @@ public class NormalizePanel extends FramedPanel implements
initMessages(); initMessages();
create(); create();
} }
protected void initMessages() { protected void initMessages() {
msgsCommon = GWT.create(CommonMessages.class); msgsCommon = GWT.create(CommonMessages.class);
msgs = GWT.create(TableWidgetMessages.class); msgs = GWT.create(TableWidgetMessages.class);
@ -140,7 +140,8 @@ public class NormalizePanel extends FramedPanel implements
msgs.valueColumnNameLabel()); msgs.valueColumnNameLabel());
valueColumnNameLabel.setLabelWidth(110); valueColumnNameLabel.setLabelWidth(110);
FieldLabel columnsToNormalizeLabel = new FieldLabel(null, msgs.columnsToNormalizeLabel()); FieldLabel columnsToNormalizeLabel = new FieldLabel(null,
msgs.columnsToNormalizeLabel());
columnsToNormalizeLabel.setLabelWidth(150); columnsToNormalizeLabel.setLabelWidth(150);
columnsToNormalizeLabel.getElement().applyStyles("font-weight:bold"); columnsToNormalizeLabel.getElement().applyStyles("font-weight:bold");
@ -209,8 +210,8 @@ 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(columnsToNormalizeLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5, v.add(columnsToNormalizeLabel, new VerticalLayoutData(-1, -1,
1))); new Margins(2, 1, 5, 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)));
add(v, new VerticalLayoutData(1, -1, new Margins(0))); add(v, new VerticalLayoutData(1, -1, new Margins(0)));
@ -264,9 +265,9 @@ public class NormalizePanel extends FramedPanel implements
} else { } else {
btnNormalize.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(
.alert(msgsCommon.attention(), msgsCommon.attention(),
msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable()); msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable());
callback.onFailure(new Throwable( callback.onFailure(new Throwable(
msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable())); msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable()));
} }
@ -293,7 +294,8 @@ 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(msgsCommon.attention(), msgs.attentionNoColumnSelected()); UtilsGXT3.alert(msgsCommon.attention(),
msgs.attentionNoColumnSelected());
return; return;
} }