Changeset 78 for java/main/src/main/java/com/framsticks/gui
- Timestamp:
- 01/09/13 00:09:10 (11 years ago)
- Location:
- java/main/src/main/java/com/framsticks/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/gui/Browser.java
r77 r78 45 45 46 46 @Override 47 protected void configure() {47 protected void configure() throws Exception { 48 48 super.configure(); 49 49 } -
java/main/src/main/java/com/framsticks/gui/Frame.java
r77 r78 1 1 package com.framsticks.gui; 2 2 3 import com.framsticks.core.Node; 3 4 import com.framsticks.core.Path; 4 5 import com.framsticks.gui.view.*; … … 12 13 import javax.swing.tree.*; 13 14 import java.awt.*; 15 import java.awt.datatransfer.StringSelection; 14 16 import java.awt.event.ActionEvent; 15 17 import java.awt.event.MouseAdapter; … … 75 77 treePopupMenu.add(new JMenuItem("Refresh")); 76 78 treePopupMenu.add(new JMenuItem("Open in new frame as root")); 79 addNodeActionToTreePopupMenu("Copy path to clipboard", new NodeAction() { 80 @Override 81 public void actionPerformed(TreeNode treeNode) { 82 Path path = treeNode.getInstancePath(); 83 StringSelection selection = new StringSelection(path.toString()); 84 getToolkit().getSystemClipboard().setContents(selection, selection); 85 } 86 }); 77 87 //this.add(createMenuItem("Add to favourites", null)); 78 88 //this.add(createMenuItem("Remove from favourites", null)); -
java/main/src/main/java/com/framsticks/gui/TreeNode.java
r77 r78 124 124 LOGGER.debug("updating children of " + this); 125 125 AccessInterface access = p.getInstance().bindAccess(p.getTop()); 126 if (access == null) { 127 return; 128 } 126 129 final List<Path> childrenPaths = new LinkedList<Path>(); 127 130 /**Prepare path for each child.*/ … … 210 213 } 211 214 212 213 215 public final Panel getPanel() { 214 216 assert frame.isActive(); … … 222 224 } 223 225 AccessInterface access = p.getInstance().bindAccess(p); 224 assert access != null; 226 if (access == null) { 227 return; 228 } 225 229 StringBuilder t = new StringBuilder(); 226 230 /** html formatting is used here, since tooltips in swing do not support simple \n line breaks */ … … 494 498 495 499 return true; 500 } 501 502 public Path getInstancePath() { 503 assert frame.isActive(); 504 return path; 496 505 } 497 506
Note: See TracChangeset
for help on using the changeset viewer.