Updated Ribbon
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@113681 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
351b0cf417
commit
9cbe065f21
|
@ -20,6 +20,7 @@ import org.gcube.portlets.user.td.csvimportwidget.client.CSVImportWizardTD;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.ColumnFilterDialog;
|
import org.gcube.portlets.user.td.expressionwidget.client.ColumnFilterDialog;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.MultiColumnFilterDialog;
|
import org.gcube.portlets.user.td.expressionwidget.client.MultiColumnFilterDialog;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.ReplaceColumnByExpressionDialog;
|
import org.gcube.portlets.user.td.expressionwidget.client.ReplaceColumnByExpressionDialog;
|
||||||
|
import org.gcube.portlets.user.td.expressionwidget.client.RowsDeleteByExpressionDialog;
|
||||||
import org.gcube.portlets.user.td.extractcodelistwidget.client.ExtractCodelistWizardTD;
|
import org.gcube.portlets.user.td.extractcodelistwidget.client.ExtractCodelistWizardTD;
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
|
||||||
|
@ -834,11 +835,13 @@ public class TabularDataController {
|
||||||
case COLUMN_MULTI_FILTER:
|
case COLUMN_MULTI_FILTER:
|
||||||
//Filter On multicolumn
|
//Filter On multicolumn
|
||||||
break;
|
break;
|
||||||
case TABLE_REPLACE_BATCH:
|
case COLUMN_REPLACE_BATCH:
|
||||||
|
openColumnBatchReplace();
|
||||||
break;
|
break;
|
||||||
case TABLE_REPLACE_BY_EXPRESSION:
|
case COLUMN_REPLACE_BY_EXPRESSION:
|
||||||
|
openColumnReplaceByExpression();
|
||||||
break;
|
break;
|
||||||
case TABLE_REPLACE_BY_EXTERNAL_COL:
|
case COLUMN_REPLACE_BY_EXTERNAL_COL:
|
||||||
openReplaceByExternalColWizard();
|
openReplaceByExternalColWizard();
|
||||||
break;
|
break;
|
||||||
case ROW_DELETE:
|
case ROW_DELETE:
|
||||||
|
@ -848,6 +851,7 @@ public class TabularDataController {
|
||||||
openDuplicatesRows();
|
openDuplicatesRows();
|
||||||
break;
|
break;
|
||||||
case BYEXPRESSION_DELETE:
|
case BYEXPRESSION_DELETE:
|
||||||
|
openRowsDeleteByExpression();
|
||||||
break;
|
break;
|
||||||
case ROW_ADD:
|
case ROW_ADD:
|
||||||
doRowAdd();
|
doRowAdd();
|
||||||
|
@ -1701,6 +1705,9 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void openColumnFilter(){
|
private void openColumnFilter(){
|
||||||
openColumnFilter(null,null);
|
openColumnFilter(null,null);
|
||||||
}
|
}
|
||||||
|
@ -1718,12 +1725,36 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openReplaceColumnByExpression(String columnLocalId,
|
private void openRowsDeleteByExpression(){
|
||||||
|
openRowsDeleteByExpression(null,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void openRowsDeleteByExpression(String columnLocalId, String columnName) {
|
||||||
|
Log.debug("Request Open Row Delete By Expression Dialog");
|
||||||
|
if (trId != null) {
|
||||||
|
RowsDeleteByExpressionDialog cfDialog = new RowsDeleteByExpressionDialog(trId,
|
||||||
|
columnLocalId, eventBus);
|
||||||
|
cfDialog.show();
|
||||||
|
} else {
|
||||||
|
Log.error("TRId is null");
|
||||||
|
UtilsGXT3.alert("Error", "No current tabular resource present");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void openColumnReplaceByExpression(){
|
||||||
|
openColumnReplaceByExpression(null,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openColumnReplaceByExpression(String columnLocalId,
|
||||||
String columnName) {
|
String columnName) {
|
||||||
Log.debug("Request Open Replace Column By Expression Dialog");
|
Log.debug("Request Open Replace Column By Expression Dialog");
|
||||||
if (trId != null) {
|
if (trId != null) {
|
||||||
ReplaceColumnByExpressionDialog rceDialog = new ReplaceColumnByExpressionDialog(
|
ReplaceColumnByExpressionDialog rceDialog = new ReplaceColumnByExpressionDialog(
|
||||||
trId, columnName, eventBus);
|
trId, columnLocalId, eventBus);
|
||||||
rceDialog.show();
|
rceDialog.show();
|
||||||
} else {
|
} else {
|
||||||
Log.error("TRId is null");
|
Log.error("TRId is null");
|
||||||
|
@ -1791,7 +1822,7 @@ public class TabularDataController {
|
||||||
cloneTR.cloneTR();
|
cloneTR.cloneTR();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
private void openColumnBatchReplace() {
|
private void openColumnBatchReplace() {
|
||||||
openColumnBatchReplace(null, null);
|
openColumnBatchReplace(null, null);
|
||||||
}
|
}
|
||||||
|
@ -1800,7 +1831,7 @@ public class TabularDataController {
|
||||||
Log.debug("Request Open Batch Replace Dialog");
|
Log.debug("Request Open Batch Replace Dialog");
|
||||||
if (trId != null) {
|
if (trId != null) {
|
||||||
ReplaceBatchDialog dialog = new ReplaceBatchDialog(trId,
|
ReplaceBatchDialog dialog = new ReplaceBatchDialog(trId,
|
||||||
columnName, eventBus);
|
columnLocalId, eventBus);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
} else {
|
} else {
|
||||||
Log.error("TRId is null");
|
Log.error("TRId is null");
|
||||||
|
@ -2327,7 +2358,7 @@ public class TabularDataController {
|
||||||
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXPRESSION
|
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXPRESSION
|
||||||
.toString()) == 0) {
|
.toString()) == 0) {
|
||||||
|
|
||||||
openReplaceColumnByExpression(
|
openColumnReplaceByExpression(
|
||||||
columnLocalId,
|
columnLocalId,
|
||||||
columnName);
|
columnName);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -40,14 +40,15 @@ public class ModifyToolBar {
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private ToolBar toolBar;
|
private ToolBar toolBar;
|
||||||
|
|
||||||
// Tool
|
// Rows
|
||||||
private TextButton replaceButton;
|
private TextButton replaceButton;
|
||||||
private TextButton deleteButton;
|
private TextButton deleteButton;
|
||||||
private TextButton filterButton;
|
|
||||||
private TextButton unionButton;
|
|
||||||
private TextButton addRowButton;
|
private TextButton addRowButton;
|
||||||
|
private TextButton filterButton;
|
||||||
|
|
||||||
|
|
||||||
// Group
|
// Table
|
||||||
|
private TextButton unionButton;
|
||||||
private TextButton groupbyButton;
|
private TextButton groupbyButton;
|
||||||
private TextButton timeAggregationButton;
|
private TextButton timeAggregationButton;
|
||||||
|
|
||||||
|
@ -86,15 +87,15 @@ public class ModifyToolBar {
|
||||||
toolBar.setEnableOverflow(false);
|
toolBar.setEnableOverflow(false);
|
||||||
|
|
||||||
// Tools Group
|
// Tools Group
|
||||||
ButtonGroup toolsGroup = new ButtonGroup();
|
ButtonGroup rowsGroup = new ButtonGroup();
|
||||||
toolsGroup.setId("Tools");
|
rowsGroup.setId("Rows");
|
||||||
toolsGroup.setStyleName("ribbon");
|
rowsGroup.setStyleName("ribbon");
|
||||||
toolsGroup.setHeadingText("Tools");
|
rowsGroup.setHeadingText("Rows");
|
||||||
toolsGroup.enable();
|
rowsGroup.enable();
|
||||||
toolBar.add(toolsGroup);
|
toolBar.add(rowsGroup);
|
||||||
|
|
||||||
FlexTable toolsLayout = new FlexTable();
|
FlexTable rowsLayout = new FlexTable();
|
||||||
toolsGroup.add(toolsLayout);
|
rowsGroup.add(rowsLayout);
|
||||||
|
|
||||||
replaceButton = new TextButton("Replace",
|
replaceButton = new TextButton("Replace",
|
||||||
TabularDataResources.INSTANCE.tableReplaceRows32());
|
TabularDataResources.INSTANCE.tableReplaceRows32());
|
||||||
|
@ -105,10 +106,10 @@ public class ModifyToolBar {
|
||||||
replaceButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
replaceButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||||
replaceButton.setMenu(createReplaceMenu());
|
replaceButton.setMenu(createReplaceMenu());
|
||||||
|
|
||||||
toolsLayout.setWidget(0, 0, replaceButton);
|
rowsLayout.setWidget(0, 0, replaceButton);
|
||||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
rowsLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||||
|
|
||||||
deleteButton = new TextButton("Delete Row",
|
deleteButton = new TextButton("Delete",
|
||||||
TabularDataResources.INSTANCE.tableRowDelete32());
|
TabularDataResources.INSTANCE.tableRowDelete32());
|
||||||
deleteButton.disable();
|
deleteButton.disable();
|
||||||
deleteButton.setScale(ButtonScale.LARGE);
|
deleteButton.setScale(ButtonScale.LARGE);
|
||||||
|
@ -117,16 +118,16 @@ public class ModifyToolBar {
|
||||||
deleteButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
deleteButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||||
deleteButton.setMenu(createDeleteMenu());
|
deleteButton.setMenu(createDeleteMenu());
|
||||||
|
|
||||||
toolsLayout.setWidget(0, 1, deleteButton);
|
rowsLayout.setWidget(0, 1, deleteButton);
|
||||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
rowsLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||||
|
|
||||||
|
|
||||||
addRowButton = new TextButton("Add Row",
|
addRowButton = new TextButton("Add",
|
||||||
TabularDataResources.INSTANCE.rowInsert32());
|
TabularDataResources.INSTANCE.rowInsert32());
|
||||||
addRowButton.disable();
|
addRowButton.disable();
|
||||||
addRowButton.setScale(ButtonScale.LARGE);
|
addRowButton.setScale(ButtonScale.LARGE);
|
||||||
addRowButton.setIconAlign(IconAlign.TOP);
|
addRowButton.setIconAlign(IconAlign.TOP);
|
||||||
addRowButton.setToolTip("Add Row");
|
addRowButton.setToolTip("Add row");
|
||||||
addRowButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
addRowButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
addRowButton.addSelectHandler(new SelectHandler() {
|
addRowButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@ -135,8 +136,8 @@ public class ModifyToolBar {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toolsLayout.setWidget(0, 2, addRowButton);
|
rowsLayout.setWidget(0, 2, addRowButton);
|
||||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
rowsLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||||
|
|
||||||
|
|
||||||
filterButton = new TextButton("Filter",
|
filterButton = new TextButton("Filter",
|
||||||
|
@ -153,38 +154,22 @@ public class ModifyToolBar {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toolsLayout.setWidget(0, 3, filterButton);
|
rowsLayout.setWidget(0, 3, filterButton);
|
||||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
|
rowsLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
|
||||||
|
|
||||||
unionButton = new TextButton("Union",
|
|
||||||
TabularDataResources.INSTANCE.union32());
|
|
||||||
unionButton.disable();
|
|
||||||
unionButton.setScale(ButtonScale.LARGE);
|
|
||||||
unionButton.setIconAlign(IconAlign.TOP);
|
|
||||||
unionButton.setToolTip("Merge tables data");
|
|
||||||
unionButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
unionButton.addSelectHandler(new SelectHandler() {
|
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
cleanCells(rowsLayout.getElement());
|
||||||
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLE_UNION));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
toolsLayout.setWidget(0, 4, unionButton);
|
// Table Group
|
||||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
|
ButtonGroup tableGroup = new ButtonGroup();
|
||||||
|
tableGroup.setId("Table");
|
||||||
|
tableGroup.setStyleName("ribbon");
|
||||||
|
tableGroup.setHeadingText("Table");
|
||||||
|
tableGroup.enable();
|
||||||
|
toolBar.add(tableGroup);
|
||||||
|
|
||||||
cleanCells(toolsLayout.getElement());
|
FlexTable tableLayout = new FlexTable();
|
||||||
|
tableGroup.add(tableLayout);
|
||||||
// Group Group
|
|
||||||
ButtonGroup groupGroup = new ButtonGroup();
|
|
||||||
groupGroup.setId("Group");
|
|
||||||
groupGroup.setStyleName("ribbon");
|
|
||||||
groupGroup.setHeadingText("Group");
|
|
||||||
groupGroup.enable();
|
|
||||||
toolBar.add(groupGroup);
|
|
||||||
|
|
||||||
FlexTable groupLayout = new FlexTable();
|
|
||||||
groupGroup.add(groupLayout);
|
|
||||||
|
|
||||||
groupbyButton = new TextButton("Group By",
|
groupbyButton = new TextButton("Group By",
|
||||||
TabularDataResources.INSTANCE.group32());
|
TabularDataResources.INSTANCE.group32());
|
||||||
|
@ -200,8 +185,8 @@ public class ModifyToolBar {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
groupLayout.setWidget(0, 0, groupbyButton);
|
tableLayout.setWidget(0, 0, groupbyButton);
|
||||||
groupLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
tableLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||||
|
|
||||||
timeAggregationButton = new TextButton("Time Aggregation",
|
timeAggregationButton = new TextButton("Time Aggregation",
|
||||||
TabularDataResources.INSTANCE.timeAggregate32());
|
TabularDataResources.INSTANCE.timeAggregate32());
|
||||||
|
@ -218,9 +203,27 @@ public class ModifyToolBar {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
groupLayout.setWidget(0, 1, timeAggregationButton);
|
tableLayout.setWidget(0, 1, timeAggregationButton);
|
||||||
groupLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
tableLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||||
cleanCells(groupLayout.getElement());
|
|
||||||
|
unionButton = new TextButton("Union",
|
||||||
|
TabularDataResources.INSTANCE.union32());
|
||||||
|
unionButton.disable();
|
||||||
|
unionButton.setScale(ButtonScale.LARGE);
|
||||||
|
unionButton.setIconAlign(IconAlign.TOP);
|
||||||
|
unionButton.setToolTip("Merge tables data");
|
||||||
|
unionButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
|
unionButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLE_UNION));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
tableLayout.setWidget(0, 2, unionButton);
|
||||||
|
tableLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||||
|
|
||||||
|
cleanCells(tableLayout.getElement());
|
||||||
|
|
||||||
// Geospatial Group
|
// Geospatial Group
|
||||||
ButtonGroup geospatialGroup = new ButtonGroup();
|
ButtonGroup geospatialGroup = new ButtonGroup();
|
||||||
|
@ -347,7 +350,7 @@ public class ModifyToolBar {
|
||||||
@Override
|
@Override
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
eventBus.fireEvent(new RibbonEvent(
|
eventBus.fireEvent(new RibbonEvent(
|
||||||
RibbonType.TABLE_REPLACE_BATCH));
|
RibbonType.COLUMN_REPLACE_BATCH));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -358,7 +361,7 @@ public class ModifyToolBar {
|
||||||
@Override
|
@Override
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
eventBus.fireEvent(new RibbonEvent(
|
eventBus.fireEvent(new RibbonEvent(
|
||||||
RibbonType.TABLE_REPLACE_BY_EXPRESSION));
|
RibbonType.COLUMN_REPLACE_BY_EXPRESSION));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -369,7 +372,7 @@ public class ModifyToolBar {
|
||||||
@Override
|
@Override
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
eventBus.fireEvent(new RibbonEvent(
|
eventBus.fireEvent(new RibbonEvent(
|
||||||
RibbonType.TABLE_REPLACE_BY_EXTERNAL_COL));
|
RibbonType.COLUMN_REPLACE_BY_EXTERNAL_COL));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -382,7 +385,7 @@ public class ModifyToolBar {
|
||||||
|
|
||||||
private Menu createDeleteMenu() {
|
private Menu createDeleteMenu() {
|
||||||
Menu menuDelete = new Menu();
|
Menu menuDelete = new Menu();
|
||||||
deleteSelectedRowsItem = new MenuItem("Selected Row",
|
deleteSelectedRowsItem = new MenuItem("Selected",
|
||||||
TabularDataResources.INSTANCE.tableRowDeleteSelected());
|
TabularDataResources.INSTANCE.tableRowDeleteSelected());
|
||||||
deleteDuplicateItem = new MenuItem("Duplicate",
|
deleteDuplicateItem = new MenuItem("Duplicate",
|
||||||
TabularDataResources.INSTANCE.tableDuplicateRowsRemove());
|
TabularDataResources.INSTANCE.tableDuplicateRowsRemove());
|
||||||
|
|
Loading…
Reference in New Issue