| 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.file.*; 27 import org.openharmonise.him.actions.publish.*; 28 import org.openharmonise.vfs.*; 29 import org.openharmonise.vfs.context.*; 30 31 32 39 public class FileContextMenu extends JPopupMenu { 40 41 47 public FileContextMenu(String sPath, AbstractVirtualFileSystem vfs) { 48 super(); 49 this.setup(sPath, vfs); 50 } 51 52 58 private void setup(String sPath, AbstractVirtualFileSystem vfs) { 59 String fontName = "Dialog"; 60 int fontSize = 11; 61 Font font = new Font (fontName, Font.PLAIN, fontSize); 62 this.setFont(font); 63 64 ContextEvent ce = new ContextEvent(ContextType.CONTEXT_FILES, "", vfs, sPath); 65 66 HIMAction action = new ActionOpen(); 67 this.add(action.getMenuItem()); 68 action.isEnabled(ce); 69 70 this.addSeparator(); 71 72 action = new ActionPreview(); 73 this.add(action.getMenuItem()); 74 action.isEnabled(ce); 75 76 action = new ActionPublishToInternet(); 77 this.add(action.getMenuItem()); 78 action.isEnabled(ce); 79 80 action = new ActionExport(); 81 this.add(action.getMenuItem()); 82 action.isEnabled(ce); 83 84 this.addSeparator(); 85 86 action = new ActionArchive(); 87 this.add(action.getMenuItem()); 88 action.isEnabled(ce); 89 90 action = new ActionRetrieve(); 91 this.add(action.getMenuItem()); 92 action.isEnabled(ce); 93 94 this.addSeparator(); 95 96 100 104 action = new ActionUpload(); 105 this.add(action.getMenuItem()); 106 action.isEnabled(ce); 107 108 action = new ActionCreateCopy(); 109 this.add(action.getMenuItem()); 110 action.isEnabled(ce); 111 112 this.addSeparator(); 113 114 action = new ActionSynchronise(); 115 this.add(action.getMenuItem()); 116 action.isEnabled(ce); 117 118 action = new ActionLock(); 119 this.add(action.getMenuItem()); 120 action.isEnabled(ce); 121 122 action = new ActionUnlock(); 123 this.add(action.getMenuItem()); 124 action.isEnabled(ce); 125 126 } 127 128 131 private FileContextMenu(String arg0) { 132 super(arg0); 133 } 134 135 } 136 | Popular Tags |