public FeatureListGridTab(final MapWidget mapWidget, final VectorLayer layer, final ExportToCsvHandler handler)
{
super(layer.getLabel());
this.handler = handler;
setOverflow(Overflow.HIDDEN);
ToolStrip toolStrip = new ToolStrip();
toolStrip.setWidth100();
focusButton = new ToolStripButton(messages.multiFeatureListGridButtonFocusSelection());
showButton = new ToolStripButton(messages.multiFeatureListGridButtonShowDetail());
exportButton = new ToolStripButton(messages.multiFeatureListGridButtonExportToCSV());
focusButton.setIcon(BTN_FOCUSSELECTION);
showButton.setIcon(BTN_SHOWDETAIL);
exportButton.setIcon(BTN_EXPORT);
focusButton.setTooltip(messages.multiFeatureListGridButtonFocusSelectionTooltip());
showButton.setTooltip(messages.multiFeatureListGridButtonShowDetailTooltip());
exportButton.setTooltip(messages.multiFeatureListGridButtonExportToCSVTooltip());
focusButton.setDisabled(true);
showButton.setDisabled(true);
showButton.setShowDisabledIcon(false);
focusButton.setShowDisabledIcon(false);
exportButton.setShowDisabledIcon(false);
if (handler == null) {
exportButton.setVisible(false);
}
focusButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
zoomToBounds();
}
});
showButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showFeatureDetail();
}
});
exportButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (handler != null) {
exportButton.setDisabled(true);
exportButton.setIcon(PROCESSING);
handler.execute(layer, new Callback() {
public void execute() {
exportButton.setDisabled(false);
exportButton.setIcon(BTN_EXPORT);
}
});
}
}
});
toolStrip.addButton(focusButton);
toolStrip.addButton(showButton);
toolStrip.addButton(exportButton);
featureListGrid = new FeatureListGrid(mapWidget.getMapModel(), new DoubleClickHandler() {
public void onDoubleClick(DoubleClickEvent event) {
showFeatureDetail();
}