Mercurial > dive4elements > river
changeset 861:65204f30877b
Display Action Widget only for cross_section theme/facet.
flys-client/trunk@2663 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 07 Sep 2011 10:40:56 +0000 (2011-09-07) |
parents | f5855350fc03 |
children | c9549074ecd1 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java |
diffstat | 2 files changed, 16 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Tue Sep 06 17:35:43 2011 +0000 +++ b/flys-client/ChangeLog Wed Sep 07 10:40:56 2011 +0000 @@ -1,3 +1,11 @@ +2011-09-07 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + Display Action Widget only for cross_section theme/facet. + + * src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java: + Put action widget only for cross_section theme, resolving a TODO. + Adjust layout slightly. + 2011-09-06 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/client/ui/map/DrawControl.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Tue Sep 06 17:35:43 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java Wed Sep 07 10:40:56 2011 +0000 @@ -55,21 +55,24 @@ ListGrid list = new ListGrid() { @Override protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) { + // Only cross_section Facets display an action widget. + final FacetRecord facetRecord = (FacetRecord) record; + if (!facetRecord.getTheme().getFacet().equals( + "cross_section")) { + return null; + } String fieldName = this.getFieldName(colNum); if (fieldName.equals("actions")) { - GWT.log("Gui: Put Actions"); HLayout recordCanvas = new HLayout(3); recordCanvas.setHeight(22); recordCanvas.setAlign(Alignment.CENTER); - // TODO decide on per case basis if to put an action - // widget or not. // TODO Refactor in createSpinner(data, artifact) SpinnerItem spinnerItem = new SpinnerItem(); spinnerItem.setShowTitle(false); spinnerItem.setTitle("Waterlevel-Spinner"); - spinnerItem.setWidth(50); + spinnerItem.setWidth(45); // TODO actually get the value from artifact // TODO actually get the range from artifact (or river?) spinnerItem.setDefaultValue(0); @@ -84,7 +87,6 @@ spinnerItem.addChangedHandler(new ChangedHandler() { @Override public void onChanged(ChangedEvent ce) { - FacetRecord facetRecord = (FacetRecord) record; DefaultDataItem kmItem = new DefaultDataItem("cross_section.km", "cross_section.km", ce.getValue().toString()); DefaultData km = new DefaultData("cross_section.km", @@ -155,7 +157,7 @@ name.setType(ListGridFieldType.TEXT); ListGridField actions = new ListGridField(GRID_FIELD_ACTIONS, - GRID_FIELD_ACTIONS, 60); + GRID_FIELD_ACTIONS, 50); list.setFields(active, name, actions); }