KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > antlr > works > plugin > container > PCXJApplicationInterface


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 JavaDoc;
10 import java.util.List JavaDoc;
11 /*
12
13 [The "BSD licence"]
14 Copyright (c) 2005-2006 Jean Bovet
15 All rights reserved.
16
17 Redistribution and use in source and binary forms, with or without
18 modification, are permitted provided that the following conditions
19 are met:
20
21 1. Redistributions of source code must retain the above copyright
22 notice, this list of conditions and the following disclaimer.
23 2. Redistributions in binary form must reproduce the above copyright
24 notice, this list of conditions and the following disclaimer in the
25 documentation and/or other materials provided with the distribution.
26 3. The name of the author may not be used to endorse or promote products
27 derived from this software without specific prior written permission.
28
29 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
30 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
31 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
33 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
34 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
38 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
40 */

41
42 public class PCXJApplicationInterface implements XJApplicationInterface {
43
44     private PluginContainer container;
45     private List JavaDoc<XJWindow> emptyList = new ArrayList JavaDoc<XJWindow>();
46     private XJPreferences defaultPrefs = new XJPreferences(PluginContainer.class);
47
48     public PCXJApplicationInterface(PluginContainer container) {
49         this.container = container;
50     }
51
52     public String JavaDoc 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 JavaDoc 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 JavaDoc<XJWindow> getWindows() {
85         return emptyList;
86     }
87
88     public List JavaDoc<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 JavaDoc recentFiles() {
101         return emptyList;
102     }
103
104     public void clearRecentFiles() {
105     }
106
107     public void addRecentFile(String JavaDoc path) {
108     }
109
110     public void removeRecentFile(String JavaDoc 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 JavaDoc dataClass) {
132         return null;
133     }
134
135     public boolean openDocuments(List JavaDoc<String JavaDoc> files) {
136         return false;
137     }
138
139     public boolean openDocument(String JavaDoc 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 JavaDoc path) {
153         return null;
154     }
155
156     public void removeDocument(XJDocument document) {
157     }
158
159     public List JavaDoc<XJDocument> getDocuments() {
160         List JavaDoc<XJDocument> l = new ArrayList JavaDoc<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