comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java @ 4131:360e22afb98b

Cosmetics, warnings and minor TODOs.
author Christian Lins <christian.lins@intevation.de>
date Mon, 15 Oct 2012 00:04:35 +0200
parents 9b29facddbd1
children 7558a18ceb23
comparison
equal deleted inserted replaced
4130:df8ac7ff6b1a 4131:360e22afb98b
1 package de.intevation.flys.client.client.ui; 1 package de.intevation.flys.client.client.ui;
2 2
3 import de.intevation.flys.client.client.event.DatacageHandler;
4 import de.intevation.flys.client.client.event.DatacageDoubleClickHandler;
5
6 import com.google.gwt.core.client.GWT; 3 import com.google.gwt.core.client.GWT;
7
8 import com.google.gwt.user.client.rpc.AsyncCallback; 4 import com.google.gwt.user.client.rpc.AsyncCallback;
9 5
6 import com.smartgwt.client.types.SelectionStyle;
7 import com.smartgwt.client.types.TreeModelType;
10 import com.smartgwt.client.util.SC; 8 import com.smartgwt.client.util.SC;
11
12 import com.smartgwt.client.widgets.Button; 9 import com.smartgwt.client.widgets.Button;
13 10 import com.smartgwt.client.widgets.events.ClickEvent;
11 import com.smartgwt.client.widgets.events.ClickHandler;
12 import com.smartgwt.client.widgets.grid.HoverCustomizer;
13 import com.smartgwt.client.widgets.grid.ListGridRecord;
14 import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
15 import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
16 import com.smartgwt.client.widgets.layout.VLayout;
14 import com.smartgwt.client.widgets.tree.Tree; 17 import com.smartgwt.client.widgets.tree.Tree;
15 import com.smartgwt.client.widgets.tree.TreeGrid; 18 import com.smartgwt.client.widgets.tree.TreeGrid;
16 import com.smartgwt.client.widgets.tree.TreeNode; 19 import com.smartgwt.client.widgets.tree.TreeNode;
17 20
18 import com.smartgwt.client.types.SelectionStyle; 21 import de.intevation.flys.client.client.Config;
19 import com.smartgwt.client.types.TreeModelType;
20
21 import com.smartgwt.client.widgets.layout.VLayout;
22
23 import com.smartgwt.client.widgets.events.ClickHandler;
24 import com.smartgwt.client.widgets.events.ClickEvent;
25
26 import com.smartgwt.client.widgets.grid.ListGridRecord;
27
28 import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
29 import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
30
31 import com.smartgwt.client.widgets.grid.HoverCustomizer;
32
33 import de.intevation.flys.client.shared.model.Artifact;
34 import de.intevation.flys.client.shared.model.User;
35 import de.intevation.flys.client.shared.model.ToLoad;
36
37 import de.intevation.flys.client.client.FLYSConstants; 22 import de.intevation.flys.client.client.FLYSConstants;
38 import de.intevation.flys.client.client.Config; 23 import de.intevation.flys.client.client.event.DatacageDoubleClickHandler;
39 24 import de.intevation.flys.client.client.event.DatacageHandler;
40 import de.intevation.flys.client.client.services.MetaDataService; 25 import de.intevation.flys.client.client.services.MetaDataService;
41 import de.intevation.flys.client.client.services.MetaDataServiceAsync; 26 import de.intevation.flys.client.client.services.MetaDataServiceAsync;
42 27 import de.intevation.flys.client.shared.model.Artifact;
28 import de.intevation.flys.client.shared.model.AttrList;
29 import de.intevation.flys.client.shared.model.DataCageNode;
43 import de.intevation.flys.client.shared.model.DataCageTree; 30 import de.intevation.flys.client.shared.model.DataCageTree;
44 import de.intevation.flys.client.shared.model.DataCageNode; 31 import de.intevation.flys.client.shared.model.ToLoad;
45 import de.intevation.flys.client.shared.model.AttrList; 32 import de.intevation.flys.client.shared.model.User;
46 33
47 import java.util.ArrayList; 34 import java.util.ArrayList;
48 import java.util.List; 35 import java.util.List;
49 import java.util.MissingResourceException; 36 import java.util.MissingResourceException;
50 import java.util.Stack; 37 import java.util.Stack;
257 244
258 if (treeGrid == null) { 245 if (treeGrid == null) {
259 return toLoad; 246 return toLoad;
260 } 247 }
261 248
262 ListGridRecord [] selection = treeGrid.getSelection(); 249 ListGridRecord [] selection = treeGrid.getSelectedRecords();
263 250
264 if (selection != null) { 251 if (selection != null) {
265 for (ListGridRecord record: selection) { 252 for (ListGridRecord record: selection) {
266 if (record instanceof TreeNode) { 253 if (record instanceof TreeNode) {
267 collectToLoads((TreeNode)record); 254 collectToLoads((TreeNode)record);
279 public String[] getSelectionTitles() { 266 public String[] getSelectionTitles() {
280 if (treeGrid == null) { 267 if (treeGrid == null) {
281 return new String[] {}; 268 return new String[] {};
282 } 269 }
283 270
284 ListGridRecord [] selection = treeGrid.getSelection(); 271 ListGridRecord [] selection = treeGrid.getSelectedRecords();
285 272
286 if (selection == null) { 273 if (selection == null) {
287 return new String[] {}; 274 return new String[] {};
288 } 275 }
289 276
399 artifactId, 386 artifactId,
400 userId, 387 userId,
401 outs, 388 outs,
402 parameters, 389 parameters,
403 new AsyncCallback<DataCageTree>() { 390 new AsyncCallback<DataCageTree>() {
391 @Override
404 public void onFailure(Throwable caught) { 392 public void onFailure(Throwable caught) {
405 GWT.log("Could not load meta data."); 393 GWT.log("Could not load meta data.");
406 SC.warn(caught.getMessage()); 394 SC.warn(caught.getMessage());
407 } 395 }
408 396
397 @Override
409 public void onSuccess(DataCageTree dcTree) { 398 public void onSuccess(DataCageTree dcTree) {
410 GWT.log("Successfully loaded meta data."); 399 GWT.log("Successfully loaded meta data.");
411 IdGenerator idGenerator = new IdGenerator(); 400 IdGenerator idGenerator = new IdGenerator();
412 DataCageNode dcRoot = dcTree.getRoot(); 401 DataCageNode dcRoot = dcTree.getRoot();
413 TreeNode root = buildRecursiveChildren( 402 TreeNode root = buildRecursiveChildren(

http://dive4elements.wald.intevation.org