Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 788:dfbc6693247e
Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time.
flys-client/trunk@2289 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 06 Jul 2011 12:31:32 +0000 |
parents | 854312c0528c |
children | cd8603aaa730 |
comparison
equal
deleted
inserted
replaced
787:4e0b73b7113b | 788:dfbc6693247e |
---|---|
318 | 318 |
319 Artifact art = event.getNewValue(); | 319 Artifact art = event.getNewValue(); |
320 ArtifactDescription desc = art.getArtifactDescription(); | 320 ArtifactDescription desc = art.getArtifactDescription(); |
321 OutputMode[] outs = desc.getOutputModes(); | 321 OutputMode[] outs = desc.getOutputModes(); |
322 | 322 |
323 fireOutputModesChangeEvent(outs); | |
324 | |
325 setArtifact(art); | 323 setArtifact(art); |
326 clearOutputTabs(); | 324 |
327 | |
328 if (parameterList.hasPanel()) { | |
329 parameterList.removePanel(); | |
330 } | |
331 Collection c = getCollection(); | 325 Collection c = getCollection(); |
332 | 326 |
333 if (outs != null && c == null) { | 327 if (outs != null && c == null) { |
334 User user = getFlys().getCurrentUser(); | 328 User user = getFlys().getCurrentUser(); |
335 createNewCollection(user.identifier()); | 329 createNewCollection(user.identifier()); |
336 } | 330 } |
337 else if (outs != null && c != null) { | 331 else if (c != null) { |
338 Config config = Config.getInstance(); | 332 Config config = Config.getInstance(); |
339 String url = config.getServerUrl(); | 333 String url = config.getServerUrl(); |
340 String locale = config.getLocale(); | 334 String locale = config.getLocale(); |
341 | 335 |
342 describeCollectionService.describe(c.identifier(), url, locale, | 336 describeCollectionService.describe(c.identifier(), url, locale, |
405 updateView(); | 399 updateView(); |
406 } | 400 } |
407 | 401 |
408 | 402 |
409 public void onOutputModesChange(OutputModesChangeEvent event) { | 403 public void onOutputModesChange(OutputModesChangeEvent event) { |
404 clearOutputTabs(); | |
410 OutputMode[] outs = event.getOutputModes(); | 405 OutputMode[] outs = event.getOutputModes(); |
411 | 406 |
412 if (outs == null) { | 407 if (outs == null) { |
413 return; | 408 return; |
414 } | 409 } |
415 | 410 |
411 boolean hasCSV = false; | |
412 | |
416 for (OutputMode out: outs) { | 413 for (OutputMode out: outs) { |
417 addOutputTab(out.getName(), out); | 414 addOutputTab(out.getName(), out); |
415 | |
416 if (out instanceof ExportMode) { | |
417 ExportMode export = (ExportMode) out; | |
418 | |
419 if (export.getFacet("csv") != null) { | |
420 hasCSV = true; | |
421 } | |
422 } | |
423 } | |
424 | |
425 if (!hasCSV) { | |
426 parameterList.removeTable(); | |
418 } | 427 } |
419 } | 428 } |
420 | 429 |
421 | 430 |
422 /** | 431 /** |
426 */ | 435 */ |
427 protected void addOutputTab(String name, OutputMode out) { | 436 protected void addOutputTab(String name, OutputMode out) { |
428 if (out instanceof ExportMode) { | 437 if (out instanceof ExportMode) { |
429 ExportMode export = (ExportMode) out; | 438 ExportMode export = (ExportMode) out; |
430 | 439 |
431 if (export.getFacet("csv") != null) { | 440 if (export.getFacet("csv") != null && !parameterList.hasTable()) { |
432 TableDataPanel p = new TableDataPanel(); | 441 TableDataPanel p = new TableDataPanel(); |
433 p.setUuid(collection.identifier()); | 442 p.setUuid(collection.identifier()); |
434 p.setName(out.getName()); | 443 p.setName(out.getName()); |
435 parameterList.setPanel (p); | 444 parameterList.setTable(p); |
436 } | 445 } |
437 | 446 |
438 return; | 447 return; |
439 } | 448 } |
440 | 449 |