1 19 package org.openharmonise.him.window.menus; 20 21 import java.awt.Font ; 22 23 import javax.swing.JPopupMenu ; 24 25 import org.openharmonise.him.actions.*; 26 import org.openharmonise.him.actions.dir.*; 27 import org.openharmonise.him.actions.file.*; 28 import org.openharmonise.him.actions.system.*; 29 import org.openharmonise.vfs.*; 30 import org.openharmonise.vfs.context.*; 31 32 33 41 public class CollectionContextMenu extends JPopupMenu { 42 43 49 public CollectionContextMenu(String sPath, AbstractVirtualFileSystem vfs) { 50 super(); 51 this.setup(sPath, vfs); 52 } 53 54 60 private void setup(String sPath, AbstractVirtualFileSystem vfs) { 61 String fontName = "Dialog"; 62 int fontSize = 11; 63 Font font = new Font (fontName, Font.PLAIN, fontSize); 64 this.setFont(font); 65 66 ContextEvent ce = new ContextEvent(ContextType.CONTEXT_DIRS, "", vfs, sPath); 67 68 HIMAction action = new ActionNewFile(); 69 this.add(action.getMenuItem()); 70 action.isEnabled(ce); 71 72 action = new ActionNewCollection(); 73 this.add(action.getMenuItem()); 74 action.isEnabled(ce); 75 76 action = new ActionUpload(); 77 this.add(action.getMenuItem()); 78 action.isEnabled(ce); 79 80 action = new ActionOrder(); 81 this.add(action.getMenuItem()); 82 action.isEnabled(ce); 83 84 action = new ActionRefresh(); 85 this.add(action.getMenuItem()); 86 action.isEnabled(ce); 87 88 } 89 90 93 private CollectionContextMenu(String arg0) { 94 super(arg0); 95 } 96 97 } 98 | Popular Tags |