Changeset 2127 for trunk/autoquest-ui-swt/src/main
- Timestamp:
- 08/24/16 09:56:43 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-ui-swt/src/main/java/de/ugoe/cs/autoquest/ui/swt/ShowTaskTreeDialog.java
r2033 r2127 18 18 import java.awt.GraphicsDevice; 19 19 import java.awt.GraphicsEnvironment; 20 import java.awt.Toolkit; 21 import java.awt.datatransfer.Clipboard; 22 import java.awt.datatransfer.StringSelection; 20 23 import java.lang.reflect.Method; 24 import java.util.ArrayList; 21 25 import java.util.Collection; 22 26 import java.util.Collections; … … 348 352 } 349 353 354 VisualizationUtils.addItemSpecificContextMenu 355 (instanceTree, ITask.class, "copy to clipboard", new SelectionAdapter() 356 { 357 @Override 358 public void widgetSelected(SelectionEvent e) { 359 StringSelection stringSelection = new StringSelection 360 (taskDetailsTree.getSelection()[0].getData().toString()); 361 Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard(); 362 clpbrd.setContents(stringSelection, null); 363 } 364 }); 365 350 366 buildInstanceTree(); 351 367 instanceTreeTab.setControl(instanceTree); … … 476 492 }); 477 493 } 494 495 VisualizationUtils.addItemSpecificContextMenu 496 (taskDetailsTree, ITask.class, "copy to clipboard", new SelectionAdapter() 497 { 498 @Override 499 public void widgetSelected(SelectionEvent e) { 500 StringSelection stringSelection = new StringSelection 501 (taskDetailsTree.getSelection()[0].getData().toString()); 502 Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard(); 503 clpbrd.setContents(stringSelection, null); 504 } 505 }); 478 506 479 507 executionVariantsTree = new Tree(detailsTopSashForm, SWT.BORDER | SWT.SINGLE | SWT.WRAP); … … 514 542 }); 515 543 } 544 545 VisualizationUtils.addItemSpecificContextMenu 546 (parentTasks, ITask.class, "copy to clipboard", new SelectionAdapter() 547 { 548 @Override 549 public void widgetSelected(SelectionEvent e) { 550 StringSelection stringSelection = new StringSelection 551 (taskDetailsTree.getSelection()[0].getData().toString()); 552 Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard(); 553 clpbrd.setContents(stringSelection, null); 554 } 555 }); 516 556 517 557 involvedTargetsTree = … … 543 583 root.setData(taskModel); 544 584 545 for (IUserSession session : sessions) { 585 // simulate a child 586 new TreeItem(root, SWT.NULL); 587 588 /*for (IUserSession session : sessions) { 546 589 buildInstanceTree(root, session); 547 } 548 549 root.setExpanded( true);590 }*/ 591 592 root.setExpanded(false); 550 593 } 551 594 … … 566 609 */ 567 610 private void buildModelTree(ITaskModel taskModel) { 611 VisualizationUtils.addExpansionListener(modelTree, defaultExpansionListener); 612 568 613 Collection<ITask> allTasks = taskModel.getTasks(); 569 614 570 List<ITask> sequences = new LinkedList<ITask>();571 List<ITask> iterations = new LinkedList<ITask>();572 List<ITask> selections = new LinkedList<ITask>();573 List<ITask> optionals = new LinkedList<ITask>();574 List<ITask> others = new LinkedList<ITask>();615 List<ITask> sequences = new ArrayList<ITask>(); 616 List<ITask> iterations = new ArrayList<ITask>(); 617 List<ITask> selections = new ArrayList<ITask>(); 618 List<ITask> optionals = new ArrayList<ITask>(); 619 List<ITask> others = new ArrayList<ITask>(); 575 620 576 621 TreeItem root = new TreeItem(modelTree, SWT.NULL); … … 819 864 } 820 865 } 866 else if (parent.getData() instanceof ITaskModel) { 867 ITaskModel taskModel = (ITaskModel) parent.getData(); 868 869 for (IUserSession session : taskModel.getUserSessions()) { 870 buildInstanceTree(parent, session); 871 } 872 } 821 873 } 822 874 } … … 832 884 // simulate a child 833 885 if (taskList.size() > 0) { 834 for (ITask task : taskList) { 886 new TreeItem(item, SWT.NULL); 887 /*for (ITask task : taskList) { 835 888 VisualizationUtils.createTreeItemFor(task, item, taskModel, false); 836 } 889 }*/ 837 890 } 838 891 }
Note: See TracChangeset
for help on using the changeset viewer.