| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package org.xmlhammer.gui.output; |
| 22 |
|
|
| 23 |
|
import java.net.URI; |
| 24 |
|
|
| 25 |
|
import javax.swing.Icon; |
| 26 |
|
import javax.swing.ImageIcon; |
| 27 |
|
import javax.swing.JFrame; |
| 28 |
|
import javax.swing.JPopupMenu; |
| 29 |
|
|
| 30 |
|
import org.bounce.RunnableAction; |
| 31 |
|
import org.bounce.MenuUtilities; |
| 32 |
|
import org.bounce.image.ImageLoader; |
| 33 |
|
import org.bounce.util.URIUtils; |
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
public class DirectoryNode extends URINode { |
| 42 |
|
private static final long serialVersionUID = -8085361000356059123L; |
| 43 |
|
|
| 44 |
0 |
private static final ImageIcon ICON = ImageLoader.get().getImage( "/org/xmlhammer/gui/icons/etool16/dir.gif"); |
| 45 |
|
|
| 46 |
|
public DirectoryNode(URI uri) { |
| 47 |
0 |
super(uri); |
| 48 |
0 |
} |
| 49 |
|
|
| 50 |
|
public String getName() { |
| 51 |
0 |
return URIUtils.getDirectoryName(getURI()); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
public String getValue() { |
| 55 |
0 |
return getName(); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public String getDescription() { |
| 59 |
0 |
return URIUtils.toString(getURI()); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public Icon getIcon() { |
| 63 |
0 |
return ICON; |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
@Override |
| 67 |
|
public JPopupMenu getPopupMenu(JFrame parent) { |
| 68 |
0 |
JPopupMenu popup = new JPopupMenu(); |
| 69 |
0 |
popup.add(getOpenURIAction(null, 0, 0)); |
| 70 |
0 |
popup.add(getEditURIAction(null, 0, 0)); |
| 71 |
0 |
popup.addSeparator(); |
| 72 |
0 |
popup.add(getCopyAction()); |
| 73 |
0 |
popup.addSeparator(); |
| 74 |
0 |
popup.add(getPropertiesAction(null)); |
| 75 |
|
|
| 76 |
0 |
MenuUtilities.alignMenu(popup); |
| 77 |
|
|
| 78 |
0 |
return popup; |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
@Override |
| 82 |
|
public RunnableAction getDefaultAction(JFrame parent) { |
| 83 |
0 |
return null; |
| 84 |
|
} |
| 85 |
|
} |