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
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface TableWidgetMessages extends Messages {
@DefaultMessage("Error in clone operation! ")
String errorInCloneFixed();
@DefaultMessage("Select a Table Type...")
String comboTableTypeEmptyText();
@DefaultMessage("Apply")
String btnApplyText();
@DefaultMessage("Apply Table Type")
String btnApplyToolTip();
@DefaultMessage("Table Type")
String comboTableTypeLabel();
@DefaultMessage("Invalid table type!")
String errorInvalidTableType();
@DefaultMessage("Select a table type!")
String attentionSelectATableType();
@DefaultMessage("Error in invocation of Change Table Type operation.")
String errorInChangeTableTypeOperationFixed();
@DefaultMessage("Select a column...")
String comboLatitudeEmptyText();
@DefaultMessage("Select a column...")
String comboLongitudeEmptyMessage();
@DefaultMessage("Points")
String columnFieldDefault();
@DefaultMessage("Column Label")
String columnFieldLabel();
@DefaultMessage("Create")
String btnCreatePointText();
@DefaultMessage("Create Point")
String btnCreatePointToolTip();
@DefaultMessage("Longitude")
String comboLongitudeLabel();
@DefaultMessage("Latitude")
String comboLatitudeLabel();
@DefaultMessage("Select a column label!")
String attentionSelectAColumnLabel();
@DefaultMessage("Select Latitude!")
String attentionSelectLatitude();
@DefaultMessage("Select Longitude!")
String attentionSelectLongitude();
@DefaultMessage("Error creating a point: ")
String errorCreatingAPointFixed();
@DefaultMessage("Error retrieving columns of tabular resource: ")
String errorRetrievingColumsOfTabularResourceFixed();
@DefaultMessage("No Integer or Numeric column is present!")
String attentionNoIntegerOrNumericColumnIsPresent();
@DefaultMessage("Select a column...")
String comboCSquareColumnEmptyText();
@DefaultMessage("Select a resolution...")
String comboDownscaleEmptyText();
@DefaultMessage("Downscale")
String btnDownscaleText();
@DefaultMessage("Downscale C-Square")
String btnDownscaleToolTip();
@DefaultMessage("Column")
String comboCSquareColumnLabel();
@DefaultMessage("Resolution")
String comboDownscaleLabel();
@DefaultMessage("Select Resolution!")
String attentionSelectResolution();
@DefaultMessage("Select C-Square column!")
String attentionSelectCSquareColumn();
@DefaultMessage("No text column is present in the tabular resource. C-Square is a text column data type!")
String attentionNoTextColumnIsPresentCSquareIsTextColumn();
@DefaultMessage("Select a type...")
String comboGsCoordinateTypeEmptyText();
@DefaultMessage("Select a resolution...")
String comboResolutionEmptyText();
@DefaultMessage("Resolution")
String comboResolutionLabel();
@DefaultMessage("True")
String hasQuadrantTrue();
@DefaultMessage("False")
String hasQuadrantFalse();
@DefaultMessage("No Integer column is present in the tabular resource!")
String attentionNoIntegerColumnIsPresent();
@DefaultMessage("Has Quadrant")
String hasQuadrantLabel();
@DefaultMessage("Select true if you want select quadrant column")
String hasQuadrantToolTip();
@DefaultMessage("Select a column...")
String comboQuadrantEmptyText();
@DefaultMessage("Quadrant")
String comboQuadrantLabel();
@DefaultMessage("Create")
String btnCreateCoordinatesText();
@DefaultMessage("Create Geospatial Coordinates")
String btnCreateCoordinatesToolTip();
@DefaultMessage("Type")
String comboGsCoordinatesTypeLabel();
@DefaultMessage("Select Quadrant column!")
String attentionSelectQuadrantColumn();
@DefaultMessage("Select valid geospatial coordinates type!")
String selectValidGeospatialCoordinatesType();
@DefaultMessage("Invalid Geospatial Coordinates Type!")
String attentionInvalidGeospatialCoordinateType();
@DefaultMessage("Error creating geospatial coordinates: ")
String errorCreatingGeospatialCoordinatesFixed();
@DefaultMessage("Error retrieving current tabular resource id!")
String errorRetrievingCurrentTabularResourceId();
@DefaultMessage("Undo not applicable")
String attentionUndoNotApplicable();
@DefaultMessage("Date:")
String dateFixed();
@DefaultMessage("Description:")
String descriptionFixed();
@DefaultMessage("Step")
String stepCol();
@DefaultMessage("Date")
String dateCol();
@DefaultMessage("Undo")
String rollBackCol();
@DefaultMessage("Undo")
String btnCellUndoTitle();
@DefaultMessage("Empty")
String gridHistoryEmptyText();
@DefaultMessage("Error retrieving history!")
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();
}

View File

@ -13,8 +13,8 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
*
* @author "Giancarlo Panichi"
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DenormalizeDialog extends Window {
@ -22,7 +22,7 @@ public class DenormalizeDialog extends Window {
private static final String HEIGHT = "530px";
private DenormalizePanel normalizationPanel;
private TableWidgetMessages msgs;
/**
*
* @param trId
@ -33,7 +33,7 @@ public class DenormalizeDialog extends Window {
Log.debug("AddColumnDialog");
initMessages();
initWindow();
normalizationPanel = new DenormalizePanel(this, trId,eventBus);
normalizationPanel = new DenormalizePanel(this, trId, eventBus);
add(normalizationPanel);
}
@ -41,7 +41,7 @@ public class DenormalizeDialog extends Window {
msgs = GWT.create(TableWidgetMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
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 ArrayList<ColumnData> columnsRetrieved;
private CommonMessages msgsCommon;
private TableWidgetMessages msgs;
public DenormalizePanel(DenormalizeDialog parent, TRId trId,
EventBus eventBus) {
this.parent = parent;
@ -173,8 +172,9 @@ public class DenormalizePanel extends FramedPanel implements
comboValueColumn.setEditable(false);
comboValueColumn.setTriggerAction(TriggerAction.ALL);
FieldLabel comboValueColumnLabel=new FieldLabel(comboValueColumn, msgs.comboValueColumnLabel());
FieldLabel comboValueColumnLabel = new FieldLabel(comboValueColumn,
msgs.comboValueColumnLabel());
// Combo Attribute Column
storeComboAttributeColumn = new ListStore<ColumnData>(
propsColumnData.id());
@ -216,8 +216,8 @@ public class DenormalizePanel extends FramedPanel implements
VerticalLayoutContainer v = new VerticalLayoutContainer();
// v.setScrollMode(ScrollMode.AUTO); Set in GXT 3.0.1
v.add(comboValueColumnLabel,
new VerticalLayoutData(1, -1, new Margins(1)));
v.add(comboValueColumnLabel, new VerticalLayoutData(1, -1, new Margins(
1)));
v.add(comboAttributeColumnLabel, new VerticalLayoutData(1, -1,
new Margins(1)));
@ -304,7 +304,8 @@ public class DenormalizePanel extends FramedPanel implements
} else {
Log.error("load combo failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert(msgsCommon.error(),
UtilsGXT3.alert(
msgsCommon.error(),
msgs.errorRetrievingColumsOfTabularResourceFixed()
+ trId.getId());
}
@ -326,9 +327,9 @@ public class DenormalizePanel extends FramedPanel implements
}
}
if (columnsIntegerNumeric.size() < 1) {
UtilsGXT3
.alert(msgsCommon.attention(),
msgs.attentionNoIntegerOrNumericColumnIsPresent());
UtilsGXT3.alert(
msgsCommon.attention(),
msgs.attentionNoIntegerOrNumericColumnIsPresent());
return;
}
@ -351,7 +352,8 @@ public class DenormalizePanel extends FramedPanel implements
ColumnData valueColumn = comboValueColumn.getCurrentValue();
if (valueColumn == null) {
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionNoValueColumnSelected());
UtilsGXT3.alert(msgsCommon.attention(),
msgs.attentionNoValueColumnSelected());
return;
}

View File

@ -13,8 +13,8 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
*
* @author "Giancarlo Panichi"
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class NormalizeDialog extends Window {
@ -22,22 +22,21 @@ public class NormalizeDialog extends Window {
private static final String HEIGHT = "530px";
private NormalizePanel normalizationPanel;
private TableWidgetMessages msgs;
public NormalizeDialog(TRId trId, EventBus eventBus) {
super();
Log.debug("AddColumnDialog");
initMessages();
initWindow();
normalizationPanel = new NormalizePanel(this, trId,eventBus);
normalizationPanel = new NormalizePanel(this, trId, eventBus);
add(normalizationPanel);
}
protected void initMessages() {
msgs = GWT.create(TableWidgetMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
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 EventBus eventBus;
private NormalizationSession normalizationSession;
private ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
@ -81,7 +81,7 @@ public class NormalizePanel extends FramedPanel implements
private TextField normalizedColumnName;
private TextField valueColumnName;
private NormalizeDialog parent;
private CommonMessages msgsCommon;
private TableWidgetMessages msgs;
@ -100,7 +100,7 @@ public class NormalizePanel extends FramedPanel implements
initMessages();
create();
}
protected void initMessages() {
msgsCommon = GWT.create(CommonMessages.class);
msgs = GWT.create(TableWidgetMessages.class);
@ -140,7 +140,8 @@ public class NormalizePanel extends FramedPanel implements
msgs.valueColumnNameLabel());
valueColumnNameLabel.setLabelWidth(110);
FieldLabel columnsToNormalizeLabel = new FieldLabel(null, msgs.columnsToNormalizeLabel());
FieldLabel columnsToNormalizeLabel = new FieldLabel(null,
msgs.columnsToNormalizeLabel());
columnsToNormalizeLabel.setLabelWidth(150);
columnsToNormalizeLabel.getElement().applyStyles("font-weight:bold");
@ -209,8 +210,8 @@ public class NormalizePanel extends FramedPanel implements
v.setAdjustForScroll(true);
v.add(normalizedColumnNameLabel, new VerticalLayoutData(1, -1));
v.add(valueColumnNameLabel, new VerticalLayoutData(1, -1));
v.add(columnsToNormalizeLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
1)));
v.add(columnsToNormalizeLabel, new VerticalLayoutData(-1, -1,
new Margins(2, 1, 5, 1)));
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
add(v, new VerticalLayoutData(1, -1, new Margins(0)));
@ -264,9 +265,9 @@ public class NormalizePanel extends FramedPanel implements
} else {
btnNormalize.disable();
Log.error("This tabular resource has not Integer or Numeric columns, normalize is not applicable!");
UtilsGXT3
.alert(msgsCommon.attention(),
msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable());
UtilsGXT3.alert(
msgsCommon.attention(),
msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable());
callback.onFailure(new Throwable(
msgs.attentionThisTabularResourceHasNotIntegerOrNumericColumnsNormalizeIsNotApplicable()));
}
@ -293,7 +294,8 @@ public class NormalizePanel extends FramedPanel implements
protected void onNormalize() {
ArrayList<ColumnData> col = getSelectedItems();
if (col == null || col.size() < 1) {
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionNoColumnSelected());
UtilsGXT3.alert(msgsCommon.attention(),
msgs.attentionNoColumnSelected());
return;
}