1 package org.antlr.works.plugin.container; 2 3 import org.antlr.works.IDE; 4 import org.antlr.xjlib.appkit.app.XJApplicationInterface; 5 import org.antlr.xjlib.appkit.app.XJPreferences; 6 import org.antlr.xjlib.appkit.document.XJDocument; 7 import org.antlr.xjlib.appkit.frame.XJWindow; 8 9 import java.util.ArrayList ; 10 import java.util.List ; 11 41 42 public class PCXJApplicationInterface implements XJApplicationInterface { 43 44 private PluginContainer container; 45 private List <XJWindow> emptyList = new ArrayList <XJWindow>(); 46 private XJPreferences defaultPrefs = new XJPreferences(PluginContainer.class); 47 48 public PCXJApplicationInterface(PluginContainer container) { 49 this.container = container; 50 } 51 52 public String getApplicationName() { 53 return "ANTLRWorks Plugin"; 54 } 55 56 public XJPreferences getPreferences() { 57 if(container == null) { 58 return defaultPrefs; 59 } else { 60 return container.getPreferences(); 61 } 62 } 63 64 public List getDocumentExtensions() { 65 return emptyList; 66 } 67 68 public XJDocument getActiveDocument() { 69 if(container == null) { 70 return null; 71 } else { 72 return container.getDocument(); 73 } 74 } 75 76 public XJDocument newDocument() { 77 return null; 78 } 79 80 public boolean openDocument() { 81 return false; 82 } 83 84 public List <XJWindow> getWindows() { 85 return emptyList; 86 } 87 88 public List <XJWindow> getWindowsInWindowMenu() { 89 return emptyList; 90 } 91 92 public boolean supportsPersistence() { 93 return false; 94 } 95 96 public boolean hasPreferencesMenuItem() { 97 return false; 98 } 99 100 public List recentFiles() { 101 return emptyList; 102 } 103 104 public void clearRecentFiles() { 105 } 106 107 public void addRecentFile(String path) { 108 } 109 110 public void removeRecentFile(String file) { 111 } 112 113 public void performQuit() { 114 } 115 116 public void displayPrefs() { 117 } 118 119 public void displayAbout() { 120 PluginContainer.showAbout(); 121 } 122 123 public boolean useDesktopMode() { 124 return false; 125 } 126 127 public void displayHelp() { 128 IDE.showHelp(container==null?null:container.getParent()); 129 } 130 131 public XJDocument newDocumentOfData(Class dataClass) { 132 return null; 133 } 134 135 public boolean openDocuments(List <String > files) { 136 return false; 137 } 138 139 public boolean openDocument(String file) { 140 return false; 141 } 142 143 public void addWindow(XJWindow window) { 144 } 145 146 public void removeWindow(XJWindow window) { 147 } 148 149 public void addDocument(XJDocument document) { 150 } 151 152 public XJDocument getDocumentForPath(String path) { 153 return null; 154 } 155 156 public void removeDocument(XJDocument document) { 157 } 158 159 public List <XJDocument> getDocuments() { 160 List <XJDocument> l = new ArrayList <XJDocument>(); 161 if(container != null) { 162 l.add(container.getDocument()); 163 } 164 return l; 165 } 166 167 public boolean openLastUsedDocument() { 168 return false; 169 } 170 171 public XJWindow getActiveWindow() { 172 return null; 173 } 174 175 } 176 | Popular Tags |