Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@111930 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-02-12 11:54:34 +00:00
parent 7564406a90
commit 2ffb25d575
12 changed files with 174 additions and 459 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;
//import org.gcube.portlets.user.tdtemplate.client.TdTemplateController;
/**
*
@ -97,10 +96,8 @@ import com.sencha.gxt.widget.core.client.event.DialogHideEvent.DialogHideHandler
*
*/
public class TabularDataController {
// implements HasCloseHandlers<Long>, HasOpenHandlers<Long> {
private SimpleEventBus eventBus;
// private TabularDataX tabularData;
private MainBoxPanel mainBoxPanel;
private UIStateType uiState = UIStateType.START;
@ -123,8 +120,6 @@ public class TabularDataController {
/**
* Grid TableId
*/
// private TableId tableOpening;
private TRId openTRIdAfterServerUpdate;
public TabularDataController() {
@ -151,10 +146,7 @@ public class TabularDataController {
return eventBus;
}
/*
* public void setTabularData(TabularDataX tabularData) { this.tabularData =
* tabularData; }
*/
public ContentPanel getToolBoxPanel() {
return toolBoxPanel;
@ -867,6 +859,9 @@ public class TabularDataController {
case GEOSPATIAL_OCEAN_AREA:
openGeospatialOceanArea();
break;
case GEOMETRY_POINT:
openGeometryCreatePoint();
break;
case ANNOTATION_ADD:
break;
case COLUMN_FILTER:
@ -1977,6 +1972,20 @@ public class TabularDataController {
}
}
private void openGeometryCreatePoint() {
Log.debug("Request Geometry Create Point Tab");
if (trId != null) {
WidgetRequestEvent e = new WidgetRequestEvent(
WidgetRequestType.GEOMETRYCREATEPOINTPANEL);
e.setTrId(trId);
eventBus.fireEvent(e);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No tabular resource present");
}
}

View File

@ -28,7 +28,7 @@ import com.sencha.gxt.widget.core.client.container.Viewport;
*/
public class TabularDataPortlet implements EntryPoint {
protected static final String JSP_TAG_ID = "tdp";
private static final String JSP_TAG_ID = "tdp";
/**
*

View File

@ -435,6 +435,10 @@ public interface TabularDataResources extends ClientBundle {
@Source("flag-green.png")
ImageResource geospatialCoordinates();
@Source("point_32.png")
ImageResource geometryPoint32();
@Source("point.png")
ImageResource geometryPoint();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -32,28 +32,17 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
*/
public class AnalyseToolBar {
protected EventBus eventBus;
protected ToolBar toolBar;
private EventBus eventBus;
private ToolBar toolBar;
//protected TextButton pieButton;
protected TextButton chartCreateButton;
//protected TextButton curveButton;
//protected TextButton scatterButton;
protected TextButton statisticalButton;
protected TextButton rstudioButton;
private TextButton chartCreateButton;
private TextButton statisticalButton;
private TextButton rstudioButton;
protected TextButton gisButton;
protected TextButton spreadButton;
protected TextButton filterButton;
protected TextButton unionButton;
protected TextButton groupbyButton;
protected TextButton aggregateButton;
protected TextButton addRowButton;
protected TextButton deleteRowButton;
protected TextButton deleteDuplicateButton;
// protected TextButton annotationButton;
protected TextButton filterColumnButton;
protected TextButton replaceValueBatchButton;
private TextButton gisButton;
//private TextButton spreadButton;
public AnalyseToolBar(EventBus eventBus) {
this.eventBus = eventBus;
@ -69,185 +58,6 @@ public class AnalyseToolBar {
toolBar.setSpacing(1);
toolBar.setEnableOverflow(false);
// Table Group
ButtonGroup tableGroup = new ButtonGroup();
tableGroup.setId("Table");
tableGroup.setStyleName("ribbon");
tableGroup.setHeadingText("Table");
tableGroup.disable();
//toolBar.add(tableGroup);
FlexTable tableLayout = new FlexTable();
tableGroup.add(tableLayout);
filterButton = new TextButton("Filter",
TabularDataResources.INSTANCE.filter32());
filterButton.setScale(ButtonScale.LARGE);
filterButton.setIconAlign(IconAlign.TOP);
filterButton.setToolTip("Filter table data");
filterButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
filterButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 0, filterButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
unionButton = new TextButton("Union",
TabularDataResources.INSTANCE.union32());
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.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 1, unionButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
groupbyButton = new TextButton("Group By",
TabularDataResources.INSTANCE.group32());
groupbyButton.setScale(ButtonScale.LARGE);
groupbyButton.setIconAlign(IconAlign.TOP);
groupbyButton.setToolTip("Perform data grouping");
groupbyButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
groupbyButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 2, groupbyButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
aggregateButton = new TextButton("Aggregate",
TabularDataResources.INSTANCE.aggregate32());
aggregateButton.setScale(ButtonScale.LARGE);
aggregateButton.setIconAlign(IconAlign.TOP);
aggregateButton.setToolTip("Performs data aggregation");
aggregateButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
aggregateButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 3, aggregateButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
addRowButton = new TextButton("Add Row",
TabularDataResources.INSTANCE.rowInsert32());
addRowButton.setScale(ButtonScale.LARGE);
addRowButton.setIconAlign(IconAlign.TOP);
addRowButton.setToolTip("Add row");
addRowButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
addRowButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 4, addRowButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
deleteRowButton = new TextButton("Delete Row",
TabularDataResources.INSTANCE.rowRemove32());
deleteRowButton.setScale(ButtonScale.LARGE);
deleteRowButton.setIconAlign(IconAlign.TOP);
deleteRowButton.setToolTip("Delete row");
deleteRowButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
deleteRowButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 5, deleteRowButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 5, 2);
deleteDuplicateButton = new TextButton("Delete Duplicate",
TabularDataResources.INSTANCE.tableDuplicateRowsRemove32());
deleteDuplicateButton.setScale(ButtonScale.LARGE);
deleteDuplicateButton.setIconAlign(IconAlign.TOP);
deleteDuplicateButton.setToolTip("Delete duplicate row");
deleteDuplicateButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
deleteDuplicateButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 6, deleteDuplicateButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 6, 2);
cleanCells(tableLayout.getElement());
// Column Group
ButtonGroup columnGroup = new ButtonGroup();
columnGroup.setId("Column");
columnGroup.setStyleName("ribbon");
columnGroup.setHeadingText("Column");
columnGroup.disable();
//toolBar.add(columnGroup);
FlexTable columnLayout = new FlexTable();
columnGroup.add(columnLayout);
filterColumnButton = new TextButton("Filter",
TabularDataResources.INSTANCE.columnFilter32());
filterColumnButton.setScale(ButtonScale.LARGE);
filterColumnButton.setIconAlign(IconAlign.TOP);
filterColumnButton
.setToolTip("Filter column values according to an condition");
filterColumnButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
filterColumnButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
columnLayout.setWidget(0, 0, filterColumnButton);
columnLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
replaceValueBatchButton = new TextButton("Replace Batch",
TabularDataResources.INSTANCE.columnReplaceBatch32());
replaceValueBatchButton.setScale(ButtonScale.LARGE);
replaceValueBatchButton.setIconAlign(IconAlign.TOP);
replaceValueBatchButton.setToolTip("Replace column values in batch");
replaceValueBatchButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
replaceValueBatchButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
columnLayout.setWidget(0, 1, replaceValueBatchButton);
columnLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
cleanCells(columnLayout.getElement());
// Charts Group
ButtonGroup chartsGroup = new ButtonGroup();
chartsGroup.setId("Charts");
@ -258,24 +68,7 @@ public class AnalyseToolBar {
FlexTable basicLayout = new FlexTable();
chartsGroup.add(basicLayout);
/*
pieButton = new TextButton("Pie",
TabularDataResources.INSTANCE.chartPie32());
pieButton.setScale(ButtonScale.LARGE);
pieButton.setIconAlign(IconAlign.TOP);
pieButton.setToolTip("Pie");
pieButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
pieButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
basicLayout.setWidget(0, 0, pieButton);
basicLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
*/
chartCreateButton = new TextButton("Create Chart",
TabularDataResources.INSTANCE.chartBar32());
@ -294,42 +87,7 @@ public class AnalyseToolBar {
basicLayout.setWidget(0, 0, chartCreateButton);
basicLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
/*
curveButton = new TextButton("Curve",
TabularDataResources.INSTANCE.chartCurve32());
curveButton.setScale(ButtonScale.LARGE);
curveButton.setIconAlign(IconAlign.TOP);
curveButton.setToolTip("Curve");
curveButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
curveButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
basicLayout.setWidget(0, 2, curveButton);
basicLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
scatterButton = new TextButton("Scatter",
TabularDataResources.INSTANCE.chartBulls32());
scatterButton.setScale(ButtonScale.LARGE);
scatterButton.setIconAlign(IconAlign.TOP);
scatterButton.setToolTip("Scatter");
scatterButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
scatterButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
// eventBus.fireEvent(new
// RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
basicLayout.setWidget(0, 3, scatterButton);
basicLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
*/
cleanCells(basicLayout.getElement());
@ -378,7 +136,8 @@ public class AnalyseToolBar {
processLayout.setWidget(0, 1, statisticalButton);
processLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
/*
spreadButton = new TextButton("SPREAD",
TabularDataResources.INSTANCE.cog32());
spreadButton.disable();
@ -396,7 +155,8 @@ public class AnalyseToolBar {
processLayout.setWidget(0, 2, spreadButton);
processLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
*/
cleanCells(processLayout.getElement());
// GIS

View File

@ -33,27 +33,27 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
*/
public class CurationToolBar {
protected EventBus eventBus;
protected ToolBar toolBar;
private EventBus eventBus;
private ToolBar toolBar;
protected TextButton duplicateDetectionButton;
//protected TextButton rulesButton;
//protected TextButton manageRulesButton;
protected TextButton applyTemplateButton;
protected TextButton normalizeButton;
protected TextButton denormalizeButton;
protected TextButton changeColumnLabelButton;
protected TextButton columnTypeButton;
protected TextButton tableTypeButton;
protected TextButton addColumnButton;
protected TextButton deleteColumnButton;
protected TextButton splitColumnButton;
protected TextButton mergeColumnButton;
private TextButton duplicateDetectionButton;
//private TextButton rulesButton;
//private TextButton manageRulesButton;
private TextButton applyTemplateButton;
private TextButton normalizeButton;
private TextButton denormalizeButton;
private TextButton changeColumnLabelButton;
private TextButton columnTypeButton;
private TextButton tableTypeButton;
private TextButton addColumnButton;
private TextButton deleteColumnButton;
private TextButton splitColumnButton;
private TextButton mergeColumnButton;
protected TextButton extractCodelistButton;
protected TextButton codelistMappingButton;
//protected TextButton generateSummaryButton;
private TextButton extractCodelistButton;
private TextButton codelistMappingButton;
//private TextButton generateSummaryButton;
public CurationToolBar(EventBus eventBus) {
this.eventBus = eventBus;

View File

@ -33,42 +33,41 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
*/
public class FileToolBar {
protected EventBus eventBus;
protected ToolBar toolBar;
private EventBus eventBus;
private ToolBar toolBar;
protected TextButton openButton;
protected TextButton cloneButton;
protected TextButton closeButton;
private TextButton openButton;
private TextButton cloneButton;
private TextButton closeButton;
protected TextButton deleteButton;
protected TextButton propertiesButton;
private TextButton deleteButton;
private TextButton propertiesButton;
protected TextButton importCSVButton;
protected TextButton importJSONButton;
protected TextButton importSDMXButton;
private TextButton importCSVButton;
private TextButton importJSONButton;
private TextButton importSDMXButton;
protected TextButton exportSDMXButton;
protected TextButton exportCSVButton;
protected TextButton exportJSONButton;
private TextButton exportSDMXButton;
private TextButton exportCSVButton;
private TextButton exportJSONButton;
//Template
protected TextButton templateNewButton;
protected TextButton templateOpenButton;
protected TextButton templateDeleteButton;
private TextButton templateNewButton;
private TextButton templateOpenButton;
private TextButton templateDeleteButton;
//Share
protected TextButton shareButton;
private TextButton shareButton;
protected TextButton timelineButton;
protected TextButton backgroundButton;
private TextButton timelineButton;
private TextButton backgroundButton;
// History
protected TextButton historyButton;
protected TextButton undoButton;
//protected TextButton discardAllButton;
private TextButton historyButton;
private TextButton undoButton;
protected TextButton helpButton;
protected TextButton logsButton;
private TextButton helpButton;
//private TextButton logsButton;
public FileToolBar(EventBus eventBus) {
@ -479,18 +478,6 @@ public class FileToolBar {
historyLayout.setWidget(0, 1, undoButton);
historyLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
/*discardAllButton = new TextButton("Discard All",
TabularDataResources.INSTANCE.discardAll());
discardAllButton.disable();
discardAllButton.setToolTip("Discard all unsaved operations");
historyLayout.setWidget(1, 1, discardAllButton);
discardAllButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.DISCARDALL));
}
});*/
cleanCells(historyLayout.getElement());
// Help
@ -587,7 +574,6 @@ public class FileToolBar {
backgroundButton.enable();
historyButton.disable();
undoButton.disable();
//discardAllButton.disable();
break;
case TR_CLOSE:
case TR_READONLY:
@ -610,7 +596,6 @@ public class FileToolBar {
backgroundButton.enable();
historyButton.disable();
undoButton.disable();
//discardAllButton.disable();
break;
case TR_OPEN:
case TABLEUPDATE:
@ -639,7 +624,6 @@ public class FileToolBar {
backgroundButton.enable();
historyButton.enable();
undoButton.enable();
//discardAllButton.disable();
break;
case WIZARD_OPEN:
openButton.disable();
@ -661,7 +645,6 @@ public class FileToolBar {
backgroundButton.disable();
historyButton.disable();
undoButton.disable();
//discardAllButton.disable();
break;
default:
break;

View File

@ -26,31 +26,28 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
/**
*
* @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 class ModifyToolBar {
protected EventBus eventBus;
protected ToolBar toolBar;
private EventBus eventBus;
private ToolBar toolBar;
// Table
//protected TextButton filterButton;
protected TextButton unionButton;
protected TextButton groupbyButton;
//protected TextButton aggregateButton;
protected TextButton timeAggregationButton;
protected TextButton replaceByExternalCol;
protected TextButton addRowButton;
protected TextButton deleteRowButton;
protected TextButton deleteDuplicateButton;
//protected TextButton annotationButton;
private TextButton unionButton;
private TextButton groupbyButton;
private TextButton timeAggregationButton;
private TextButton replaceByExternalCol;
private TextButton addRowButton;
private TextButton deleteRowButton;
private TextButton deleteDuplicateButton;
// Column
protected TextButton csquareButton;
protected TextButton oceanAreaButton;
// Geospatial
private TextButton csquareButton;
private TextButton oceanAreaButton;
private TextButton pointButton;
public ModifyToolBar(EventBus eventBus) {
this.eventBus = eventBus;
@ -76,24 +73,6 @@ public class ModifyToolBar {
FlexTable tableLayout = new FlexTable();
tableGroup.add(tableLayout);
/*
filterButton = new TextButton("Filter",
TabularDataResources.INSTANCE.filter32());
filterButton.disable();
filterButton.setScale(ButtonScale.LARGE);
filterButton.setIconAlign(IconAlign.TOP);
filterButton.setToolTip("Filter table data");
filterButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
filterButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
//eventBus.fireEvent(new RibbonEvent(RibbonType.TABLEFILTER));
}
});
tableLayout.setWidget(0, 0, filterButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
*/
unionButton = new TextButton("Union",
TabularDataResources.INSTANCE.union32());
unionButton.disable();
@ -111,7 +90,6 @@ public class ModifyToolBar {
tableLayout.setWidget(0, 1, unionButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
groupbyButton = new TextButton("Group By",
TabularDataResources.INSTANCE.group32());
groupbyButton.disable();
@ -128,26 +106,7 @@ public class ModifyToolBar {
tableLayout.setWidget(0, 2, groupbyButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
/*
aggregateButton = new TextButton("Aggregate",
TabularDataResources.INSTANCE.aggregate32());
aggregateButton.disable();
aggregateButton.setScale(ButtonScale.LARGE);
aggregateButton.setIconAlign(IconAlign.TOP);
aggregateButton.setToolTip("Performs data aggregation");
aggregateButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
aggregateButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLEAGGREAGETE));
}
});
tableLayout.setWidget(0, 3, aggregateButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
*/
timeAggregationButton = new TextButton("Time Aggregation",
TabularDataResources.INSTANCE.timeAggregate32());
timeAggregationButton.disable();
@ -158,14 +117,14 @@ public class ModifyToolBar {
timeAggregationButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLE_TIME_AGGREGATE));
eventBus.fireEvent(new RibbonEvent(
RibbonType.TABLE_TIME_AGGREGATE));
}
});
tableLayout.setWidget(0, 3, timeAggregationButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
replaceByExternalCol = new TextButton("Replace by External",
TabularDataResources.INSTANCE.replaceByExternalCol32());
replaceByExternalCol.disable();
@ -176,16 +135,14 @@ public class ModifyToolBar {
replaceByExternalCol.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLE_REPLACE_BY_EXTERNAL_COL));
eventBus.fireEvent(new RibbonEvent(
RibbonType.TABLE_REPLACE_BY_EXTERNAL_COL));
}
});
tableLayout.setWidget(0, 4, replaceByExternalCol);
tableLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
addRowButton = new TextButton("Add Row",
TabularDataResources.INSTANCE.rowInsert32());
addRowButton.disable();
@ -202,7 +159,7 @@ public class ModifyToolBar {
tableLayout.setWidget(0, 5, addRowButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 5, 2);
deleteRowButton = new TextButton("Delete Row",
TabularDataResources.INSTANCE.rowRemove32());
deleteRowButton.disable();
@ -219,7 +176,7 @@ public class ModifyToolBar {
tableLayout.setWidget(0, 6, deleteRowButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 6, 2);
deleteDuplicateButton = new TextButton("Delete Duplicate",
TabularDataResources.INSTANCE.tableDuplicateRowsRemove32());
deleteDuplicateButton.disable();
@ -236,25 +193,6 @@ public class ModifyToolBar {
tableLayout.setWidget(0, 7, deleteDuplicateButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 7, 2);
/*
annotationButton = new TextButton("Annotation",
TabularDataResources.INSTANCE.annotationAdd32());
annotationButton.disable();
annotationButton.setScale(ButtonScale.LARGE);
annotationButton.setIconAlign(IconAlign.TOP);
annotationButton.setToolTip("Add annotation column");
annotationButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
annotationButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
//eventBus.fireEvent(new RibbonEvent(RibbonType.ANNOTATIONADD));
}
});
tableLayout.setWidget(0, 7, annotationButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 7, 2);
*/
cleanCells(tableLayout.getElement());
// Geospatial Group
@ -269,48 +207,73 @@ public class ModifyToolBar {
FlexTable geospatialLayout = new FlexTable();
geospatialGroup.add(geospatialLayout);
csquareButton = new TextButton("C-Square",
TabularDataResources.INSTANCE.geospatialCSquare32());
csquareButton.disable();
csquareButton.setScale(ButtonScale.LARGE);
csquareButton.setIconAlign(IconAlign.TOP);
csquareButton
.setToolTip("Create C-Square Coordinates");
csquareButton
.setArrowAlign(ButtonArrowAlign.BOTTOM);
csquareButton
.addSelectHandler(new SelectHandler() {
csquareButton.setToolTip("Create C-Square Coordinates");
csquareButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
csquareButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.GEOSPATIAL_CSQUARE));
}
});
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(
RibbonType.GEOSPATIAL_CSQUARE));
}
});
geospatialLayout.setWidget(0, 0, csquareButton);
geospatialLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
oceanAreaButton = new TextButton("Ocean Area",
TabularDataResources.INSTANCE.geospatialOceanArea32());
oceanAreaButton.disable();
oceanAreaButton.setScale(ButtonScale.LARGE);
oceanAreaButton.setIconAlign(IconAlign.TOP);
oceanAreaButton
.setToolTip("Create Ocean Area Coordinates");
oceanAreaButton
.setArrowAlign(ButtonArrowAlign.BOTTOM);
oceanAreaButton
.addSelectHandler(new SelectHandler() {
oceanAreaButton.setToolTip("Create Ocean Area Coordinates");
oceanAreaButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
oceanAreaButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.GEOSPATIAL_OCEAN_AREA));
}
});
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(
RibbonType.GEOSPATIAL_OCEAN_AREA));
}
});
geospatialLayout.setWidget(0, 1, oceanAreaButton);
geospatialLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
cleanCells(geospatialLayout.getElement());
// Geometry Group
ButtonGroup geometryGroup = new ButtonGroup();
geometryGroup.setId("Geometry");
geometryGroup.setStyleName("ribbon");
geometryGroup.setHeadingText("Geometry");
geometryGroup.enable();
geometryGroup.setVisible(true);
toolBar.add(geometryGroup);
FlexTable geometryLayout = new FlexTable();
geometryGroup.add(geometryLayout);
pointButton = new TextButton("Point",
TabularDataResources.INSTANCE.geometryPoint32());
pointButton.disable();
pointButton.setScale(ButtonScale.LARGE);
pointButton.setIconAlign(IconAlign.TOP);
pointButton.setToolTip("Create Point");
pointButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
pointButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.GEOMETRY_POINT));
}
});
geometryLayout.setWidget(0, 0, pointButton);
geometryLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
cleanCells(geospatialLayout.getElement());
eventBus.addHandler(UIStateEvent.TYPE,
@ -334,84 +297,80 @@ public class ModifyToolBar {
}
}
}
public void setUI(UIStateEvent event) {
UIStateType uiStateType = event.getUIStateType();
try {
switch (uiStateType) {
case START:
// Table
//filterButton.disable();
unionButton.disable();
groupbyButton.disable();
timeAggregationButton.disable();
//aggregateButton.disable();
replaceByExternalCol.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
//annotationButton.disable();
// geospatial
// Geospatial
csquareButton.disable();
oceanAreaButton.disable();
// Geometry
pointButton.disable();
break;
case TR_CLOSE:
case TR_READONLY:
case TR_READONLY:
// Table
//filterButton.disable();
unionButton.disable();
groupbyButton.disable();
timeAggregationButton.disable();
//aggregateButton.disable();
replaceByExternalCol.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
//annotationButton.disable();
// geospatial
// Geospatial
csquareButton.disable();
oceanAreaButton.disable();
// Geometry
pointButton.disable();
break;
case TR_OPEN:
case TABLEUPDATE:
case TABLECURATION:
case TABLECURATION:
// Table
//filterButton.disable();
unionButton.enable();
groupbyButton.enable();
timeAggregationButton.enable();
//aggregateButton.disable();
replaceByExternalCol.enable();
addRowButton.enable();
deleteRowButton.enable();
deleteDuplicateButton.enable();
//annotationButton.disable();
// geospatial
// Geospatial
csquareButton.enable();
oceanAreaButton.enable();
// Geometry
pointButton.enable();
break;
case WIZARD_OPEN:
// Table
//filterButton.disable();
unionButton.disable();
groupbyButton.disable();
timeAggregationButton.disable();
//aggregateButton.disable();
replaceByExternalCol.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
//annotationButton.disable();
// Column
// Geospatial
csquareButton.disable();
oceanAreaButton.disable();
// Geometry
pointButton.disable();
break;
default:
break;
}
} catch (Exception e) {
Log.error("setUI Error on Ribbon Curation: " + e.getLocalizedMessage());
Log.error("setUI Error on Ribbon Curation: "
+ e.getLocalizedMessage());
}
}

View File

@ -20,14 +20,14 @@ public class TabularDataRibbon {
private static final String RIBBON_HEIGHT = "100px";
protected TabPanel ribbon;
private TabPanel ribbon;
//protected PlainTabPanel ribbon;
//private PlainTabPanel ribbon;
protected FileToolBar fileToolBar;
protected CurationToolBar curationToolBar;
protected ModifyToolBar modifyToolBar;
protected AnalyseToolBar analyseToolBar;
private FileToolBar fileToolBar;
private CurationToolBar curationToolBar;
private ModifyToolBar modifyToolBar;
private AnalyseToolBar analyseToolBar;
public TabularDataRibbon(EventBus eventBus) {
try {

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB