Minor Updated

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@91908 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-19 12:06:34 +00:00
parent 4e31d36d51
commit 00ab754fc3
2 changed files with 98 additions and 14 deletions

View File

@ -6,6 +6,7 @@ package org.gcube.portlets.user.td.client;
import org.gcube.portlets.user.td.csvexportwidget.client.CSVExportWizardTD;
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.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.openwidget.client.TDOpen;
import org.gcube.portlets.user.td.sdmxexportwidget.client.SDMXExportWizardTD;
@ -355,6 +356,7 @@ public class TabularDataController {
case ANNOTATIONADD:
break;
case COLUMNFILTER:
openMultiColumnFilter();
break;
case COLUMNEDIT:
break;
@ -631,6 +633,15 @@ public class TabularDataController {
}
protected void openMultiColumnFilter() {
Log.debug("Request Open Multi Column Filter Dialog");
if (trId != null) {
MultiColumnFilterDialog mcfDialog=new MultiColumnFilterDialog(trId, eventBus);
mcfDialog.show();
}
}
protected void openColumnFilter(String columnName) {
Log.debug("Request Open Column Filter Dialog");
if (trId != null) {

View File

@ -4,7 +4,12 @@
package org.gcube.portlets.user.td.client.ribbon;
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.user.client.ui.FlexTable;
@ -31,23 +36,16 @@ public class ModifyToolBar {
// Table
protected TextButton filterButton;
protected TextButton unionButton;
protected TextButton denormalizeButton;
protected TextButton groupButton;
protected TextButton groupbyButton;
// Column
protected TextButton removeColumnButton;
protected TextButton changeColumnTypeButton;
protected TextButton filterColumnButton;
protected TextButton editColumnValueOnConditionButton;
protected TextButton addAnnotationColumnButton;
protected TextButton validateColumnDuplicateButton;
protected TextButton aggregateButton;
protected TextButton addRowButton;
protected TextButton deleteRowButton;
protected TextButton annotationButton;
protected TextButton deleteDuplicateButton;
protected TextButton annotationButton;
// Column
protected TextButton filterColumnButton;
protected TextButton editColumnValueOnConditionButton;
public ModifyToolBar(EventBus eventBus) {
@ -239,8 +237,7 @@ public class ModifyToolBar {
.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// ImportTableEvent(ImportTableType.JSON));
eventBus.fireEvent(new RibbonEvent(RibbonType.COLUMNFILTER));
}
});
@ -270,7 +267,14 @@ public class ModifyToolBar {
cleanCells(columnLayout.getElement());
eventBus.addHandler(UIStateEvent.TYPE,
new UIStateEvent.UIStateHandler() {
public void onUIState(UIStateEvent event) {
setUI(event);
}
});
}
@ -284,5 +288,74 @@ public class ModifyToolBar {
}
}
}
public void setUI(UIStateEvent event) {
UIStateType uiStateType = event.getUIStateType();
try {
switch (uiStateType) {
case START:
// Table
filterButton.disable();
unionButton.disable();
groupbyButton.disable();
aggregateButton.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
annotationButton.disable();
// Column
filterColumnButton.disable();
editColumnValueOnConditionButton.disable();
break;
case TR_CLOSE:
// Table
filterButton.disable();
unionButton.disable();
groupbyButton.disable();
aggregateButton.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
annotationButton.disable();
// Column
filterColumnButton.disable();
editColumnValueOnConditionButton.disable();
break;
case TR_OPEN:
// Table
filterButton.disable();
unionButton.disable();
groupbyButton.disable();
aggregateButton.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
annotationButton.disable();
// Column
filterColumnButton.enable();
editColumnValueOnConditionButton.disable();
break;
case WIZARD_OPEN:
// Table
filterButton.disable();
unionButton.disable();
groupbyButton.disable();
aggregateButton.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
annotationButton.disable();
// Column
filterColumnButton.disable();
editColumnValueOnConditionButton.disable();
break;
default:
break;
}
} catch (Exception e) {
Log.error("setUI Error on Ribbon Curation: " + e.getLocalizedMessage());
}
}
}