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.MultiColumnFilterDialog;
|
||||
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.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
|
||||
|
@ -834,11 +835,13 @@ public class TabularDataController {
|
|||
case COLUMN_MULTI_FILTER:
|
||||
//Filter On multicolumn
|
||||
break;
|
||||
case TABLE_REPLACE_BATCH:
|
||||
case COLUMN_REPLACE_BATCH:
|
||||
openColumnBatchReplace();
|
||||
break;
|
||||
case TABLE_REPLACE_BY_EXPRESSION:
|
||||
case COLUMN_REPLACE_BY_EXPRESSION:
|
||||
openColumnReplaceByExpression();
|
||||
break;
|
||||
case TABLE_REPLACE_BY_EXTERNAL_COL:
|
||||
case COLUMN_REPLACE_BY_EXTERNAL_COL:
|
||||
openReplaceByExternalColWizard();
|
||||
break;
|
||||
case ROW_DELETE:
|
||||
|
@ -848,6 +851,7 @@ public class TabularDataController {
|
|||
openDuplicatesRows();
|
||||
break;
|
||||
case BYEXPRESSION_DELETE:
|
||||
openRowsDeleteByExpression();
|
||||
break;
|
||||
case ROW_ADD:
|
||||
doRowAdd();
|
||||
|
@ -1701,6 +1705,9 @@ public class TabularDataController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void openColumnFilter(){
|
||||
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) {
|
||||
Log.debug("Request Open Replace Column By Expression Dialog");
|
||||
if (trId != null) {
|
||||
ReplaceColumnByExpressionDialog rceDialog = new ReplaceColumnByExpressionDialog(
|
||||
trId, columnName, eventBus);
|
||||
trId, columnLocalId, eventBus);
|
||||
rceDialog.show();
|
||||
} else {
|
||||
Log.error("TRId is null");
|
||||
|
@ -1791,7 +1822,7 @@ public class TabularDataController {
|
|||
cloneTR.cloneTR();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
private void openColumnBatchReplace() {
|
||||
openColumnBatchReplace(null, null);
|
||||
}
|
||||
|
@ -1800,7 +1831,7 @@ public class TabularDataController {
|
|||
Log.debug("Request Open Batch Replace Dialog");
|
||||
if (trId != null) {
|
||||
ReplaceBatchDialog dialog = new ReplaceBatchDialog(trId,
|
||||
columnName, eventBus);
|
||||
columnLocalId, eventBus);
|
||||
dialog.show();
|
||||
} else {
|
||||
Log.error("TRId is null");
|
||||
|
@ -2327,7 +2358,7 @@ public class TabularDataController {
|
|||
if (opId.compareTo(GridHeaderOperationId.COLUMNREPLACEBYEXPRESSION
|
||||
.toString()) == 0) {
|
||||
|
||||
openReplaceColumnByExpression(
|
||||
openColumnReplaceByExpression(
|
||||
columnLocalId,
|
||||
columnName);
|
||||
} else {
|
||||
|
|
|
@ -40,14 +40,15 @@ public class ModifyToolBar {
|
|||
private EventBus eventBus;
|
||||
private ToolBar toolBar;
|
||||
|
||||
// Tool
|
||||
// Rows
|
||||
private TextButton replaceButton;
|
||||
private TextButton deleteButton;
|
||||
private TextButton filterButton;
|
||||
private TextButton unionButton;
|
||||
private TextButton addRowButton;
|
||||
private TextButton filterButton;
|
||||
|
||||
|
||||
// Group
|
||||
// Table
|
||||
private TextButton unionButton;
|
||||
private TextButton groupbyButton;
|
||||
private TextButton timeAggregationButton;
|
||||
|
||||
|
@ -86,15 +87,15 @@ public class ModifyToolBar {
|
|||
toolBar.setEnableOverflow(false);
|
||||
|
||||
// Tools Group
|
||||
ButtonGroup toolsGroup = new ButtonGroup();
|
||||
toolsGroup.setId("Tools");
|
||||
toolsGroup.setStyleName("ribbon");
|
||||
toolsGroup.setHeadingText("Tools");
|
||||
toolsGroup.enable();
|
||||
toolBar.add(toolsGroup);
|
||||
ButtonGroup rowsGroup = new ButtonGroup();
|
||||
rowsGroup.setId("Rows");
|
||||
rowsGroup.setStyleName("ribbon");
|
||||
rowsGroup.setHeadingText("Rows");
|
||||
rowsGroup.enable();
|
||||
toolBar.add(rowsGroup);
|
||||
|
||||
FlexTable toolsLayout = new FlexTable();
|
||||
toolsGroup.add(toolsLayout);
|
||||
FlexTable rowsLayout = new FlexTable();
|
||||
rowsGroup.add(rowsLayout);
|
||||
|
||||
replaceButton = new TextButton("Replace",
|
||||
TabularDataResources.INSTANCE.tableReplaceRows32());
|
||||
|
@ -105,10 +106,10 @@ public class ModifyToolBar {
|
|||
replaceButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
replaceButton.setMenu(createReplaceMenu());
|
||||
|
||||
toolsLayout.setWidget(0, 0, replaceButton);
|
||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
rowsLayout.setWidget(0, 0, replaceButton);
|
||||
rowsLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
|
||||
deleteButton = new TextButton("Delete Row",
|
||||
deleteButton = new TextButton("Delete",
|
||||
TabularDataResources.INSTANCE.tableRowDelete32());
|
||||
deleteButton.disable();
|
||||
deleteButton.setScale(ButtonScale.LARGE);
|
||||
|
@ -117,16 +118,16 @@ public class ModifyToolBar {
|
|||
deleteButton.setArrowAlign(ButtonArrowAlign.RIGHT);
|
||||
deleteButton.setMenu(createDeleteMenu());
|
||||
|
||||
toolsLayout.setWidget(0, 1, deleteButton);
|
||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||
rowsLayout.setWidget(0, 1, deleteButton);
|
||||
rowsLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||
|
||||
|
||||
addRowButton = new TextButton("Add Row",
|
||||
addRowButton = new TextButton("Add",
|
||||
TabularDataResources.INSTANCE.rowInsert32());
|
||||
addRowButton.disable();
|
||||
addRowButton.setScale(ButtonScale.LARGE);
|
||||
addRowButton.setIconAlign(IconAlign.TOP);
|
||||
addRowButton.setToolTip("Add Row");
|
||||
addRowButton.setToolTip("Add row");
|
||||
addRowButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
addRowButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
|
@ -135,8 +136,8 @@ public class ModifyToolBar {
|
|||
}
|
||||
});
|
||||
|
||||
toolsLayout.setWidget(0, 2, addRowButton);
|
||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||
rowsLayout.setWidget(0, 2, addRowButton);
|
||||
rowsLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||
|
||||
|
||||
filterButton = new TextButton("Filter",
|
||||
|
@ -153,38 +154,22 @@ public class ModifyToolBar {
|
|||
}
|
||||
});
|
||||
|
||||
toolsLayout.setWidget(0, 3, filterButton);
|
||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
|
||||
rowsLayout.setWidget(0, 3, filterButton);
|
||||
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) {
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLE_UNION));
|
||||
}
|
||||
});
|
||||
cleanCells(rowsLayout.getElement());
|
||||
|
||||
toolsLayout.setWidget(0, 4, unionButton);
|
||||
toolsLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
|
||||
// Table Group
|
||||
ButtonGroup tableGroup = new ButtonGroup();
|
||||
tableGroup.setId("Table");
|
||||
tableGroup.setStyleName("ribbon");
|
||||
tableGroup.setHeadingText("Table");
|
||||
tableGroup.enable();
|
||||
toolBar.add(tableGroup);
|
||||
|
||||
cleanCells(toolsLayout.getElement());
|
||||
|
||||
// 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);
|
||||
FlexTable tableLayout = new FlexTable();
|
||||
tableGroup.add(tableLayout);
|
||||
|
||||
groupbyButton = new TextButton("Group By",
|
||||
TabularDataResources.INSTANCE.group32());
|
||||
|
@ -200,8 +185,8 @@ public class ModifyToolBar {
|
|||
}
|
||||
});
|
||||
|
||||
groupLayout.setWidget(0, 0, groupbyButton);
|
||||
groupLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
tableLayout.setWidget(0, 0, groupbyButton);
|
||||
tableLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
|
||||
timeAggregationButton = new TextButton("Time Aggregation",
|
||||
TabularDataResources.INSTANCE.timeAggregate32());
|
||||
|
@ -218,9 +203,27 @@ public class ModifyToolBar {
|
|||
}
|
||||
});
|
||||
|
||||
groupLayout.setWidget(0, 1, timeAggregationButton);
|
||||
groupLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||
cleanCells(groupLayout.getElement());
|
||||
tableLayout.setWidget(0, 1, timeAggregationButton);
|
||||
tableLayout.getFlexCellFormatter().setRowSpan(0, 1, 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) {
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLE_UNION));
|
||||
}
|
||||
});
|
||||
|
||||
tableLayout.setWidget(0, 2, unionButton);
|
||||
tableLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||
|
||||
cleanCells(tableLayout.getElement());
|
||||
|
||||
// Geospatial Group
|
||||
ButtonGroup geospatialGroup = new ButtonGroup();
|
||||
|
@ -347,7 +350,7 @@ public class ModifyToolBar {
|
|||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
eventBus.fireEvent(new RibbonEvent(
|
||||
RibbonType.TABLE_REPLACE_BATCH));
|
||||
RibbonType.COLUMN_REPLACE_BATCH));
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -358,7 +361,7 @@ public class ModifyToolBar {
|
|||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
eventBus.fireEvent(new RibbonEvent(
|
||||
RibbonType.TABLE_REPLACE_BY_EXPRESSION));
|
||||
RibbonType.COLUMN_REPLACE_BY_EXPRESSION));
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -369,7 +372,7 @@ public class ModifyToolBar {
|
|||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
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() {
|
||||
Menu menuDelete = new Menu();
|
||||
deleteSelectedRowsItem = new MenuItem("Selected Row",
|
||||
deleteSelectedRowsItem = new MenuItem("Selected",
|
||||
TabularDataResources.INSTANCE.tableRowDeleteSelected());
|
||||
deleteDuplicateItem = new MenuItem("Duplicate",
|
||||
TabularDataResources.INSTANCE.tableDuplicateRowsRemove());
|
||||
|
|
Loading…
Reference in New Issue