|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
SHTMLPlugin.java | - | - | - | - |
|
1 |
/*
|
|
2 |
* SimplyHTML, a word processor based on Java, HTML and CSS
|
|
3 |
* Copyright (C) 2002 Ulrich Hilger
|
|
4 |
*
|
|
5 |
* This program is free software; you can redistribute it and/or
|
|
6 |
* modify it under the terms of the GNU General Public License
|
|
7 |
* as published by the Free Software Foundation; either version 2
|
|
8 |
* of the License, or (at your option) any later version.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
18 |
*/
|
|
19 |
|
|
20 |
import javax.swing.Action;
|
|
21 |
import javax.swing.JMenu;
|
|
22 |
import javax.swing.JComponent;
|
|
23 |
import javax.swing.JMenuItem;
|
|
24 |
//import com.lightdev.app.shtm.FrmMain;
|
|
25 |
//import javax.help.*;
|
|
26 |
//import javax.help.event.*;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* Defines an interface all plug-ins for application SimplyHTML
|
|
30 |
* have to implement.
|
|
31 |
*
|
|
32 |
* @author Ulrich Hilger
|
|
33 |
* @author Light Development
|
|
34 |
* @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
|
|
35 |
* @author <a href="mailto:info@lightdev.com">info@lightdev.com</a>
|
|
36 |
* @author published under the terms and conditions of the
|
|
37 |
* GNU General Public License,
|
|
38 |
* for details see file gpl.txt in the distribution
|
|
39 |
* package of this software
|
|
40 |
*
|
|
41 |
* @version stage 11, April 27, 2003
|
|
42 |
*/
|
|
43 |
|
|
44 |
public interface SHTMLPlugin { |
|
45 |
|
|
46 |
/** indicates docking is not requested */
|
|
47 |
public static final int DOCK_LOCATION_NONE = 0; |
|
48 |
|
|
49 |
/** indicates docking requested on top of a given container */
|
|
50 |
public static final int DOCK_LOCATION_TOP = 1; |
|
51 |
|
|
52 |
/** indicates docking requested on the right of a given container */
|
|
53 |
public static final int DOCK_LOCATION_RIGHT = 2; |
|
54 |
|
|
55 |
/** indicates docking requested on bottom of a given container */
|
|
56 |
public static final int DOCK_LOCATION_BOTTOM = 3; |
|
57 |
|
|
58 |
/** indicates docking requested on the left of a given container */
|
|
59 |
public static final int DOCK_LOCATION_LEFT = 4; |
|
60 |
|
|
61 |
/**
|
|
62 |
* get the name of the plug-in as it shall appear
|
|
63 |
* on a GUI.
|
|
64 |
*
|
|
65 |
* @return the name of the plug-in
|
|
66 |
*/
|
|
67 |
public String getGUIName();
|
|
68 |
|
|
69 |
/**
|
|
70 |
* get the name used internally for this plug-in
|
|
71 |
*
|
|
72 |
* @return the internal name of this plug-in
|
|
73 |
*/
|
|
74 |
public String getInternalName();
|
|
75 |
|
|
76 |
/**
|
|
77 |
* get a menu of actions this plug-in provides.
|
|
78 |
*
|
|
79 |
* <p><code>JMenu</code> is a decendant of <code>JMenuItem</code>
|
|
80 |
* so this method may return a single menu item up to a whole
|
|
81 |
* structure of submenus in its return value.</p>
|
|
82 |
*
|
|
83 |
* @return the plug-in menu
|
|
84 |
*/
|
|
85 |
public JMenuItem getPluginMenu();
|
|
86 |
|
|
87 |
/**
|
|
88 |
* get a menu item providing documentation about this
|
|
89 |
* plug-in.
|
|
90 |
*
|
|
91 |
* <p><code>JMenu</code> is a decendant of <code>JMenuItem</code>
|
|
92 |
* so this method may return a single menu item up to a whole
|
|
93 |
* structure of submenus in its return value.</p>
|
|
94 |
*
|
|
95 |
* @return a menu item with help for this plug-in
|
|
96 |
*/
|
|
97 |
public JMenuItem getHelpMenu();
|
|
98 |
|
|
99 |
/**
|
|
100 |
* get the location the component returned by getDockComponent()
|
|
101 |
* shall be docked at.
|
|
102 |
*
|
|
103 |
* @return the dock location, one of DOCK_LOCATION_TOP, DOCK_LOCATION_BOTTOM,
|
|
104 |
* DOCK_LOCATION.LEFT, DOCK_LOCATION_RIGHT or DOCK_LOCATION_NONE, if the
|
|
105 |
* component shall not dock.
|
|
106 |
*/
|
|
107 |
public int getDockLocation(); |
|
108 |
|
|
109 |
/**
|
|
110 |
* set the location the component returned by getDockComponent()
|
|
111 |
* shall be docked at.
|
|
112 |
*
|
|
113 |
* @param location the dock location, one of DOCK_LOCATION_TOP, DOCK_LOCATION_BOTTOM,
|
|
114 |
* DOCK_LOCATION.LEFT, DOCK_LOCATION_RIGHT or DOCK_LOCATION_NONE, if the
|
|
115 |
* component shall not dock.
|
|
116 |
*/
|
|
117 |
public void setDockLocation(int location); |
|
118 |
|
|
119 |
/**
|
|
120 |
* get the component that this plug-in produces, if any
|
|
121 |
*
|
|
122 |
* @return the component produced by this plug-in, or null if none
|
|
123 |
* is produced
|
|
124 |
*/
|
|
125 |
public JComponent getComponent();
|
|
126 |
|
|
127 |
/**
|
|
128 |
* get the status of the plug-in
|
|
129 |
*
|
|
130 |
* @return true, if activated, false if not
|
|
131 |
*/
|
|
132 |
public boolean isActive(); |
|
133 |
|
|
134 |
/**
|
|
135 |
* set status of plug-in
|
|
136 |
*
|
|
137 |
* @param isActive indicates whether or not the plug-in shall be activated
|
|
138 |
*/
|
|
139 |
public void setStatus(boolean isActive); |
|
140 |
|
|
141 |
|
|
142 |
/**
|
|
143 |
* set the owner of this plug-in
|
|
144 |
*
|
|
145 |
* @param owner the main frame of the instance of SimplyHTML creating the plug-in
|
|
146 |
*/
|
|
147 |
public void setOwner(FrmMain owner); |
|
148 |
|
|
149 |
/**
|
|
150 |
* get the owner of this plug-in
|
|
151 |
*
|
|
152 |
* @return the main frame of the instance of SimplyHTML that created the plug-in
|
|
153 |
*/
|
|
154 |
public FrmMain getOwner();
|
|
155 |
|
|
156 |
/**
|
|
157 |
* get a string from the resource bundle of the owner of this plug-in
|
|
158 |
*
|
|
159 |
* @param nm the name of the string resource to get
|
|
160 |
*
|
|
161 |
* @return the string with the given name or null, if none is found
|
|
162 |
*/
|
|
163 |
public String getOwnerResString(String nm);
|
|
164 |
|
|
165 |
/**
|
|
166 |
* get an action from the resource bundle of the owner of this plug-in
|
|
167 |
*
|
|
168 |
* @param cmd the name of the action to get
|
|
169 |
*
|
|
170 |
* @return the action with the given name or null, if none is found
|
|
171 |
*/
|
|
172 |
public Action getOwnerAction(String cmd);
|
|
173 |
|
|
174 |
/**
|
|
175 |
* init the plug-in
|
|
176 |
*
|
|
177 |
* this is called by the PluginManager directly after instantiating the plug-in
|
|
178 |
* @param owner the owner of this plug-in
|
|
179 |
* @param internalName the internal name this plug-in shall have
|
|
180 |
* @param pluginMenuId the id of the plug-in menu in the ResourceBundle,
|
|
181 |
* or null if no plugin-in menu is to be created
|
|
182 |
* @param helpMenuId the id of the help menu for this plug-in in the
|
|
183 |
* ResourceBundle, or null if no help menu is to be created
|
|
184 |
*/
|
|
185 |
public void initPlugin(FrmMain owner, String internalName, String pluginMenuId, String helpMenuId); |
|
186 |
|
|
187 |
public void initHelpMenu(); |
|
188 |
|
|
189 |
public void showInitialInfo(); |
|
190 |
} |
|