Added Position Column

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@112340 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-03-03 17:18:15 +00:00
parent 0cf68d06eb
commit 66c3f34d0c
8 changed files with 190 additions and 139 deletions

View File

@ -88,7 +88,6 @@ import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderL
import com.sencha.gxt.widget.core.client.event.DialogHideEvent;
import com.sencha.gxt.widget.core.client.event.DialogHideEvent.DialogHideHandler;
/**
*
* @author "Giancarlo Panichi" <a
@ -146,8 +145,6 @@ public class TabularDataController {
return eventBus;
}
public ContentPanel getToolBoxPanel() {
return toolBoxPanel;
}
@ -193,32 +190,32 @@ public class TabularDataController {
});
}
private void pendingTasksRetrieve() {
TDGWTServiceAsync.INSTANCE.pendingTasksRetrieve(new AsyncCallback<Integer>() {
TDGWTServiceAsync.INSTANCE
.pendingTasksRetrieve(new AsyncCallback<Integer>() {
@Override
public void onFailure(Throwable caught) {
Log.info("No valid user found: " + caught.getMessage());
if (caught instanceof TDGWTSessionExpiredException) {
UtilsGXT3.alert("Error", "Expired Session");
sessionExpiredShowDelayed();
} else {
UtilsGXT3.alert("Error", caught.getLocalizedMessage());
}
}
@Override
public void onFailure(Throwable caught) {
Log.info("No valid user found: " + caught.getMessage());
if (caught instanceof TDGWTSessionExpiredException) {
UtilsGXT3.alert("Error", "Expired Session");
sessionExpiredShowDelayed();
} else {
UtilsGXT3.alert("Error",
caught.getLocalizedMessage());
}
}
@Override
public void onSuccess(Integer pending) {
Log.info("Pending Tasks Retrieved: "+pending);
@Override
public void onSuccess(Integer pending) {
Log.info("Pending Tasks Retrieved: " + pending);
}
}
});
});
}
private void sessionExpiredShowDelayed() {
Timer timeoutTimer = new Timer() {
@ -671,7 +668,6 @@ public class TabularDataController {
final ConfirmMessageBox mb = new ConfirmMessageBox("Confirm",
"Are you sure you want to delete the tabular resource?");
mb.addDialogHideHandler(new DialogHideHandler() {
@ -707,7 +703,6 @@ public class TabularDataController {
}
});
mb.setWidth(300);
mb.show();
@ -796,6 +791,9 @@ public class TabularDataController {
case TABLE_TYPE:
openTableType();
break;
case COLUMN_POSITION:
openPositionColumn();
break;
case COLUMN_LABEL:
openColumnLabel();
break;
@ -861,7 +859,7 @@ public class TabularDataController {
break;
case GEOMETRY_POINT:
openGeometryCreatePoint();
break;
break;
case ANNOTATION_ADD:
break;
case COLUMN_FILTER:
@ -939,7 +937,7 @@ public class TabularDataController {
break;
case DUPLICATESROWSPANEL:
break;
case LABELCOLUNPANEL:
case LABELCOLUMNPANEL:
break;
case VALIDATIONSTASKSPANEL:
break;
@ -975,8 +973,7 @@ public class TabularDataController {
tdmLogs.show();
}
private void openBatchReplace(TRId trId,
RequestProperties requestProperties) {
private void openBatchReplace(TRId trId, RequestProperties requestProperties) {
Log.debug("Request Open Batch Replace Dialog: " + trId + " "
+ requestProperties);
if (trId != null) {
@ -1635,12 +1632,12 @@ public class TabularDataController {
HistoryDiscard historyDiscard = new HistoryDiscard(eventBus);
historyDiscard.discard();
}
private void openRStudio() {
Log.debug("Request Open RStudio");
if (trId != null) {
@SuppressWarnings("unused")
RStudio rStudio=new RStudio(trId, eventBus);
RStudio rStudio = new RStudio(trId, eventBus);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No current tabular resource present");
@ -1648,8 +1645,6 @@ public class TabularDataController {
}
private void openStatistical() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
@ -1767,8 +1762,7 @@ public class TabularDataController {
openColumnBatchReplace(null, null);
}
private void openColumnBatchReplace(String columnLocalId,
String columnName) {
private void openColumnBatchReplace(String columnLocalId, String columnName) {
Log.debug("Request Open Batch Replace Dialog");
if (trId != null) {
ReplaceBatchDialog dialog = new ReplaceBatchDialog(trId,
@ -1890,6 +1884,25 @@ public class TabularDataController {
}
}
private void openPositionColumn() {
openPositionColumn(null, null);
}
private void openPositionColumn(String columnLocalId, String columnName) {
Log.debug("Request Position Column Tab");
if (trId != null) {
WidgetRequestEvent e = new WidgetRequestEvent(
WidgetRequestType.POSITIONCOLUMNPANEL);
e.setTrId(trId);
e.setColumnLocalId(columnLocalId);
e.setColumnName(columnName);
eventBus.fireEvent(e);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No tabular resource present");
}
}
private void openColumnLabel() {
openColumnLabel(null, null);
}
@ -1898,7 +1911,7 @@ public class TabularDataController {
Log.debug("Request Column Label Tab");
if (trId != null) {
WidgetRequestEvent e = new WidgetRequestEvent(
WidgetRequestType.LABELCOLUNPANEL);
WidgetRequestType.LABELCOLUMNPANEL);
e.setTrId(trId);
e.setColumnLocalId(columnLocalId);
e.setColumnName(columnName);
@ -1934,44 +1947,45 @@ public class TabularDataController {
UtilsGXT3.alert("Error", "No tabular resource present");
}
}
private void openGeospatialCSquare() {
Log.debug("Request Geospatial Create C-Square Coordiantes Tab");
if (trId != null) {
WidgetRequestEvent e = new WidgetRequestEvent(
WidgetRequestType.GEOSPATIALCREATECOORDINATESPANEL);
e.setTrId(trId);
HashMap<RequestPropertiesParameterType, Object> map=new HashMap<RequestPropertiesParameterType, Object>();
map.put(RequestPropertiesParameterType.Coordinates, GeospatialCoordinatesType.C_SQUARE);
RequestProperties requestProperties= new RequestProperties(map);
HashMap<RequestPropertiesParameterType, Object> map = new HashMap<RequestPropertiesParameterType, Object>();
map.put(RequestPropertiesParameterType.Coordinates,
GeospatialCoordinatesType.C_SQUARE);
RequestProperties requestProperties = new RequestProperties(map);
e.setRequestProperties(requestProperties);
eventBus.fireEvent(e);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No tabular resource present");
}
}
private void openGeospatialOceanArea() {
Log.debug("Request Geospatial Create Ocean Area Coordiantes Tab");
if (trId != null) {
WidgetRequestEvent e = new WidgetRequestEvent(
WidgetRequestType.GEOSPATIALCREATECOORDINATESPANEL);
e.setTrId(trId);
HashMap<RequestPropertiesParameterType, Object> map=new HashMap<RequestPropertiesParameterType, Object>();
map.put(RequestPropertiesParameterType.Coordinates, GeospatialCoordinatesType.OCEAN_AREA);
RequestProperties requestProperties= new RequestProperties(map);
HashMap<RequestPropertiesParameterType, Object> map = new HashMap<RequestPropertiesParameterType, Object>();
map.put(RequestPropertiesParameterType.Coordinates,
GeospatialCoordinatesType.OCEAN_AREA);
RequestProperties requestProperties = new RequestProperties(map);
e.setRequestProperties(requestProperties);
eventBus.fireEvent(e);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No tabular resource present");
}
}
private void openGeometryCreatePoint() {
Log.debug("Request Geometry Create Point Tab");
if (trId != null) {
@ -1979,16 +1993,13 @@ public class TabularDataController {
WidgetRequestType.GEOMETRYCREATEPOINTPANEL);
e.setTrId(trId);
eventBus.fireEvent(e);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No tabular resource present");
}
}
private void openBackgroundMonitor() {
Log.debug("Request Open Monitor Background Tab");
WidgetRequestEvent e = new WidgetRequestEvent(
@ -1996,8 +2007,7 @@ public class TabularDataController {
eventBus.fireEvent(e);
}
private void doChangeTableRequestEventCommand(
ChangeTableRequestEvent event) {
private void doChangeTableRequestEventCommand(ChangeTableRequestEvent event) {
Log.debug("Change Table Request: " + event);
switch (event.getWhy()) {
case TABLECURATION:
@ -2015,10 +2025,9 @@ public class TabularDataController {
}
};
private void addActiveTabularResourceAndOpen(final TRId trId){
Log.debug("Add Active TabResource Search: "+trId);
private void addActiveTabularResourceAndOpen(final TRId trId) {
Log.debug("Add Active TabResource Search: " + trId);
TDGWTServiceAsync.INSTANCE.getTabResourceInformation(trId,
new AsyncCallback<TabResource>() {
public void onFailure(Throwable caught) {
@ -2053,10 +2062,10 @@ public class TabularDataController {
});
}
private void addActiveTabularResourceAndOpen(final TabResource tabResource) {
Log.debug("Add Active TabResource: "+tabResource);
TDGWTServiceAsync.INSTANCE.setTabResource(tabResource
,
Log.debug("Add Active TabResource: " + tabResource);
TDGWTServiceAsync.INSTANCE.setTabResource(tabResource,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
@ -2090,9 +2099,6 @@ public class TabularDataController {
});
}
private void doRowAdd() {
onRowAdd();
@ -2141,7 +2147,7 @@ public class TabularDataController {
* @param rowsRaw
*/
private void onRowEdit(ArrayList<RowRaw> rowsRaw) {
if (rowsRaw == null||rowsRaw.isEmpty()) {
if (rowsRaw == null || rowsRaw.isEmpty()) {
UtilsGXT3.alert("No rows selected", "No rows selected");
} else {
EditRowDialog editRowDialog = new EditRowDialog(trId, rowsRaw,
@ -2218,71 +2224,75 @@ public class TabularDataController {
.getColumnSelected());
String columnName = mainBoxPanel.getColumnName(event
.getColumnSelected());
Log.debug("Selected column[ColumnLocalId: " + columnLocalId
+ ", ColumnName: " + columnName + "]");
if (opId.compareTo(GridHeaderOperationId.COLUMNLABEL.toString()) == 0) {
openColumnLabel(columnLocalId, columnName);
if (opId.compareTo(GridHeaderOperationId.COLUMNPOSITION.toString()) == 0) {
openPositionColumn(columnLocalId, columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNADD.toString()) == 0) {
openColumnAdd(columnLocalId, columnName);
if (opId.compareTo(GridHeaderOperationId.COLUMNLABEL.toString()) == 0) {
openColumnLabel(columnLocalId, columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNBATCHREPLACE
.toString()) == 0) {
openColumnBatchReplace(columnLocalId, columnName);
if (opId.compareTo(GridHeaderOperationId.COLUMNADD.toString()) == 0) {
openColumnAdd(columnLocalId, columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNDELETE
if (opId.compareTo(GridHeaderOperationId.COLUMNBATCHREPLACE
.toString()) == 0) {
openColumnDelete(columnLocalId, columnName);
openColumnBatchReplace(columnLocalId, columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNTYPE
if (opId.compareTo(GridHeaderOperationId.COLUMNDELETE
.toString()) == 0) {
openChangeColumnType(columnLocalId, columnName);
openColumnDelete(columnLocalId, columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNFILTER
if (opId.compareTo(GridHeaderOperationId.COLUMNTYPE
.toString()) == 0) {
openColumnFilter(columnLocalId, columnName);
openChangeColumnType(columnLocalId, columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.ANNOTATIONADD
if (opId.compareTo(GridHeaderOperationId.COLUMNFILTER
.toString()) == 0) {
openColumnFilter(columnLocalId, columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.DUPLICATEDETECTION
if (opId.compareTo(GridHeaderOperationId.ANNOTATIONADD
.toString()) == 0) {
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNSPLIT
if (opId.compareTo(GridHeaderOperationId.DUPLICATEDETECTION
.toString()) == 0) {
openColumnSplit(columnLocalId,
columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNMERGE
if (opId.compareTo(GridHeaderOperationId.COLUMNSPLIT
.toString()) == 0) {
openColumnMerge(columnLocalId,
openColumnSplit(columnLocalId,
columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXPRESSION
if (opId.compareTo(GridHeaderOperationId.COLUMNMERGE
.toString()) == 0) {
openReplaceColumnByExpression(
openColumnMerge(
columnLocalId,
columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXTERNAL
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXPRESSION
.toString()) == 0) {
openReplaceByExternalColWizard(
openReplaceColumnByExpression(
columnLocalId,
columnName);
} else {
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXTERNAL
.toString()) == 0) {
openReplaceByExternalColWizard(
columnLocalId,
columnName);
} else {
}
}
}
}
}
}
}
@ -2290,12 +2300,10 @@ public class TabularDataController {
}
}
}
}
}
}
}

View File

@ -209,6 +209,12 @@ public interface TabularDataResources extends ClientBundle {
@Source("column-add.png")
ImageResource columnAdd();
@Source("column-reorder_32.png")
ImageResource columnReorder32();
@Source("column-reorder.png")
ImageResource columnReorder();
@Source("column-values_32.png")
ImageResource columnValues32();

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -35,24 +35,29 @@ public class CurationToolBar {
private EventBus eventBus;
private ToolBar toolBar;
//Validation
private TextButton duplicateDetectionButton;
private TextButton applyTemplateButton;
//private TextButton rulesButton;
//private TextButton manageRulesButton;
private TextButton applyTemplateButton;
private TextButton normalizeButton;
private TextButton denormalizeButton;
//Structure
private TextButton tableTypeButton;
private TextButton changePositionColumnButton;
private TextButton changeColumnLabelButton;
private TextButton columnTypeButton;
private TextButton tableTypeButton;
private TextButton addColumnButton;
private TextButton deleteColumnButton;
private TextButton splitColumnButton;
private TextButton mergeColumnButton;
private TextButton denormalizeButton;
private TextButton normalizeButton;
//Helper
private TextButton extractCodelistButton;
private TextButton codelistMappingButton;
private TextButton codelistMappingButton;
//private TextButton generateSummaryButton;
public CurationToolBar(EventBus eventBus) {
@ -181,6 +186,25 @@ public class CurationToolBar {
structureLayout.setWidget(0, 0, tableTypeButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
changePositionColumnButton = new TextButton("Position Column",
TabularDataResources.INSTANCE.columnReorder32());
changePositionColumnButton.disable();
changePositionColumnButton.setScale(ButtonScale.LARGE);
changePositionColumnButton.setIconAlign(IconAlign.TOP);
changePositionColumnButton.setToolTip("Change position column");
changePositionColumnButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
changePositionColumnButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.COLUMN_POSITION));
}
});
structureLayout.setWidget(0, 1, changePositionColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
changeColumnLabelButton = new TextButton("Labels",
TabularDataResources.INSTANCE.columnLabel32());
changeColumnLabelButton.disable();
@ -195,8 +219,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 1, changeColumnLabelButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
structureLayout.setWidget(0, 2, changeColumnLabelButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
columnTypeButton = new TextButton("Column Type",
TabularDataResources.INSTANCE.columnType32());
@ -212,8 +236,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 2, columnTypeButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
structureLayout.setWidget(0, 3, columnTypeButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
addColumnButton = new TextButton("Add Column",
TabularDataResources.INSTANCE.columnAdd32());
@ -229,8 +253,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 3, addColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
structureLayout.setWidget(0, 4, addColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
deleteColumnButton = new TextButton("Delete Column",
TabularDataResources.INSTANCE.columnDelete32());
@ -246,8 +270,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 4, deleteColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
structureLayout.setWidget(0, 5, deleteColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 5, 2);
//
splitColumnButton = new TextButton("Split Column",
@ -264,8 +288,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 5, splitColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 5, 2);
structureLayout.setWidget(0, 6, splitColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 6, 2);
mergeColumnButton = new TextButton("Merge Column",
TabularDataResources.INSTANCE.columnMerge32());
@ -281,8 +305,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 6, mergeColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 6, 2);
structureLayout.setWidget(0, 7, mergeColumnButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 7, 2);
//
denormalizeButton = new TextButton("Denormalize",
@ -299,8 +323,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 7, denormalizeButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 7, 2);
structureLayout.setWidget(0, 8, denormalizeButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 8, 2);
normalizeButton = new TextButton("Normalize",
TabularDataResources.INSTANCE.tableNormalize32());
@ -316,8 +340,8 @@ public class CurationToolBar {
}
});
structureLayout.setWidget(0, 8, normalizeButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 8, 2);
structureLayout.setWidget(0, 9, normalizeButton);
structureLayout.getFlexCellFormatter().setRowSpan(0, 9, 2);
cleanCells(structureLayout.getElement());
@ -414,37 +438,44 @@ public class CurationToolBar {
switch (uiStateType) {
case START:
duplicateDetectionButton.disable();
//rulesButton.disable();
normalizeButton.disable();
//manageRulesButton.disable();
applyTemplateButton.disable();
denormalizeButton.disable();
//rulesButton.disable();
//manageRulesButton.disable();
tableTypeButton.disable();
changePositionColumnButton.disable();
changeColumnLabelButton.disable();
columnTypeButton.disable();
tableTypeButton.disable();
addColumnButton.disable();
deleteColumnButton.disable();
splitColumnButton.disable();
mergeColumnButton.disable();
denormalizeButton.disable();
normalizeButton.disable();
extractCodelistButton.disable();
codelistMappingButton.disable();
//generateSummaryButton.disable();
break;
case TR_CLOSE:
case TR_READONLY:
duplicateDetectionButton.disable();
//rulesButton.disable();
normalizeButton.disable();
//manageRulesButton.disable();
applyTemplateButton.disable();
denormalizeButton.disable();
//rulesButton.disable();
//manageRulesButton.disable();
tableTypeButton.disable();
changePositionColumnButton.disable();
changeColumnLabelButton.disable();
columnTypeButton.disable();
tableTypeButton.disable();
addColumnButton.disable();
deleteColumnButton.disable();
splitColumnButton.disable();
mergeColumnButton.disable();
denormalizeButton.disable();
normalizeButton.disable();
extractCodelistButton.disable();
codelistMappingButton.disable();
//generateSummaryButton.disable();
@ -456,15 +487,18 @@ public class CurationToolBar {
//rulesButton.disable();
//manageRulesButton.disable();
applyTemplateButton.enable();
denormalizeButton.enable();
normalizeButton.enable();
tableTypeButton.enable();
changePositionColumnButton.enable();
changeColumnLabelButton.enable();
columnTypeButton.enable();
tableTypeButton.enable();
addColumnButton.enable();
deleteColumnButton.enable();
splitColumnButton.enable();
mergeColumnButton.enable();
denormalizeButton.enable();
normalizeButton.enable();
extractCodelistButton.enable();
TRId trId = event.getTrId();
if (trId != null && trId.getTableType() != null
@ -477,18 +511,21 @@ public class CurationToolBar {
break;
case WIZARD_OPEN:
duplicateDetectionButton.disable();
//rulesButton.disable();
normalizeButton.disable();
//manageRulesButton.disable();
applyTemplateButton.disable();
denormalizeButton.disable();
//rulesButton.disable();
//manageRulesButton.disable();
tableTypeButton.disable();
changePositionColumnButton.disable();
changeColumnLabelButton.disable();
columnTypeButton.disable();
tableTypeButton.disable();
addColumnButton.disable();
deleteColumnButton.disable();
splitColumnButton.disable();
mergeColumnButton.disable();
denormalizeButton.disable();
normalizeButton.disable();
extractCodelistButton.disable();
codelistMappingButton.disable();
//generateSummaryButton.disable();

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -87,7 +87,7 @@
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED" /> -->
<!-- Specify the paths for translatable code -->