1 19 20 21 package org.netbeans.modules.tasklist.bugs.issues; 22 23 import java.io.IOException ; 24 25 import org.openide.actions.CopyAction; 26 import org.openide.actions.CutAction; 27 import org.openide.actions.DeleteAction; 28 import org.openide.actions.FileSystemAction; 29 import org.openide.actions.OpenAction; 30 import org.openide.actions.PasteAction; 31 import org.openide.actions.PropertiesAction; 32 import org.openide.actions.SaveAsTemplateAction; 33 import org.openide.actions.ToolsAction; 34 import org.openide.filesystems.FileObject; 35 import org.openide.loaders.DataObjectExistsException; 36 import org.openide.loaders.ExtensionList; 37 import org.openide.loaders.MultiDataObject; 38 import org.openide.loaders.UniFileLoader; 39 import org.openide.util.NbBundle; 40 import org.openide.util.actions.SystemAction; 41 42 43 49 public final class IssuesLoader extends UniFileLoader { 50 51 52 static final long serialVersionUID = 1L; 53 54 55 protected static SystemAction[] standardActions; 56 57 public IssuesLoader() { 58 super("org.netbeans.modules.tasklist.bugs.issues.IssuesDataObject"); 60 ExtensionList extensions = new ExtensionList(); 62 extensions.addExtension("issues"); setExtensions(extensions); 64 } 65 66 69 protected SystemAction[] createDefaultActions() { 70 return new SystemAction[] { 71 SystemAction.get(OpenAction.class), 72 SystemAction.get(FileSystemAction.class), 73 null, 74 SystemAction.get(CutAction.class), 75 SystemAction.get(CopyAction.class), 76 SystemAction.get(PasteAction.class), 77 null, 78 SystemAction.get(DeleteAction.class), 79 null, 80 SystemAction.get(SaveAsTemplateAction.class), 81 null, 82 SystemAction.get(ToolsAction.class), 83 SystemAction.get(PropertiesAction.class), 84 }; 85 } 86 87 92 protected SystemAction[] defaultActions() { 93 if (standardActions != null) { 94 return standardActions; 95 } else { 96 synchronized(getClass()) { 97 if (standardActions == null) { 98 standardActions = createDefaultActions(); 99 } 100 } 101 } 102 return standardActions; 103 } 104 105 106 protected String defaultDisplayName() { 107 return NbBundle.getMessage(IssuesLoader.class, 108 "BugsLoader_Name"); } 110 111 protected MultiDataObject createMultiObject(FileObject primaryFile) 112 throws DataObjectExistsException, IOException { 113 return new IssuesDataObject(primaryFile, this); 114 } 115 } 116 117 | Popular Tags |