# HG changeset patch # User Felix Wolfsteller # Date 1364466979 -3600 # Node ID 35cd6286da2d712a18730c3909f11b831deb0c7b # Parent 6ec7c8ebb2c98708ed18c22f5adbb5b276a4ee27 WQAdaptedInputPanel: Switch focus when input had been done via inputhelper (part flys/issue1133). diff -r 6ec7c8ebb2c9 -r 35cd6286da2d flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java Thu Mar 28 09:29:42 2013 +0100 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java Thu Mar 28 11:36:19 2013 +0100 @@ -94,6 +94,9 @@ /** Stores the input panels related to their keys.*/ protected Map wqranges; + /** Index the input panels related to their keys.*/ + protected ArrayList doubleArrayPanels; + /** Stores the min/max values for each q range.*/ protected Map qranges; @@ -118,6 +121,7 @@ public WQAdaptedInputPanel() { wqranges = new HashMap(); + doubleArrayPanels = new ArrayList(); qranges = new HashMap(); wranges = new HashMap(); qdTable = new QDTable(); @@ -189,6 +193,14 @@ if (itemWithFocus != null) { itemWithFocus.setValues(new double[]{val}); + // TODO 1133, show different data for each doublearraypanel + int i = doubleArrayPanels.indexOf(itemWithFocus); + if (i == doubleArrayPanels.size()-1) { + doubleArrayPanels.get(0).focusInItem(1); + } + else { + doubleArrayPanels.get(i+1).focusInItem(1); + } } } }; @@ -466,6 +478,7 @@ label, null, this, this, TitleOrientation.LEFT); wqranges.put(title, dap); + doubleArrayPanels.add(dap); if (item instanceof WQDataItem) { WQDataItem wq = (WQDataItem) item;