Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 swalkenh 1
PK
813 swalkenh 2
 
3
 
4
Class-Path: 
240 swalkenh 5
Transform-To-File: src/plugins/dummyPlugin/DummyPluginTransform.xsl
813 swalkenh 6
XMLEditor-Plugin-Name: dummy plugin
7
Created-By: 1.4.2 (Sun Microsystems Inc.)
8
Main-Class: src.plugins.dummyPlugin.DummyPlugin
240 swalkenh 9
Description: ...(todo)
10
Transform-Fro-File: src/plugins/dummyPlugin/DummyPluginTransformBack.x
11
 sl
813 swalkenh 12
Comment: this plugin is/was used during testing
240 swalkenh 13
 
14
Name: src/plugins/dummyPlugin
813 swalkenh 15
Specification-Title: plugin for XMLEditor
16
Implementation-Title: src.plugins.dummyPlugin
240 swalkenh 17
Specification-Version: 0.4 (05/07/03)
813 swalkenh 18
Specification-Vendor: group5, software practice SS_2003, University Bi
19
 elefeld, Germany
240 swalkenh 20
Implementation-Version: 0.2 (05/07/03)
21
Implementation-Vendor: group5, software practice SS_2003, University B
22
 ielefeld, Germany
23
 
24
PK
813 swalkenh 25
 
521 swalkenh 26
pluginNameLjava/lang/String;
ConstantValuedummy pluginguiLsrc/gui/GuiInterface;ourEventListenerLsrc/control/OurEventListener;labelLjavax/swing/JLabel;originalElementLorg/w3c/dom/Node;counterI<init>()VCode
27
	
28
 
29
 
30
 
31
 
32
 
33
 
34
:=java/lang/System?outLjava/io/PrintStream;AB	@C,I'm a new instance of the dumb dummy-plugin!Ejava/io/PrintStreamGprintlnI!
35
 
813 swalkenh 36
 
521 swalkenh 37
 
38
\"javax/swing/AbstractButton`addActionListener"(Ljava/awt/event/ActionListener;)Vbc
39
 
40
 
41
 
813 swalkenh 42
´¸src/control/OurEventListenerº
firedOurEvent(Lsrc/control/OurEvent;)V¼½»¾oldNodechangedElementeLsrc/control/OurEvent;actionPerformed(Ljava/awt/event/ActionEvent;)Vjava/awt/event/ActionEventÆgetActionCommand()Ljava/lang/String;ÈÉ
43
ÇÊjava/lang/StringBufferÌdummy Item in Menu clicked Î
44
Í"append(I)Ljava/lang/StringBuffer;ÑÒ
45
ÍÓ timesÕ,(Ljava/lang/String;)Ljava/lang/StringBuffer;Ñ×
46
ÍØtoStringÚÉ
47
 
48
SourceFileDummyPlugin.java!	
49
 
50
)
51
 
52
 
53
 
54
 
55
 
521 swalkenh 56
* ss_2003
57
 
58
 
59
*/
60
813 swalkenh 61
 
62
 
63
 
64
import java.awt.event.*;
65
 
66
 
67
import org.w3c.dom.*;
68
 
69
 
521 swalkenh 70
 
71
import src.gui.*;
72
import src.plugins.PluginInterface;
73
813 swalkenh 74
521 swalkenh 75
/**
76
 
77
 */
78
 
79
						 implements PluginInterface, ActionListener {
80
	
81
	//added 16.07.03 Sascha W. cause method "firedOurEvent" has changed
813 swalkenh 82
	/** Name of the plugin, used in method <code>firePluginChangedElement</code> */
521 swalkenh 83
	final private String pluginName = "dummy plugin";
84
 
85
	private GuiInterface gui;
86
	private OurEventListener ourEventListener;
87
	
88
	private JLabel label = new JLabel("dummy plugin");
89
 
90
 
91
	private int counter = 0;
92
93
94
	public DummyPlugin() {
95
		setLayout(new BorderLayout());
96
 
97
		setVisible(false);
98
99
		System.out.println("I'm a new instance of the dumb dummy-plugin!");
100
 
101
	
102
103
 
104
	 * @see src.gui.PluginInterface#init(src.gui.GuiInterface)
105
	 */
106
 
107
		this.gui = gui;
108
 
109
 
110
	}
111
112
113
	/* (non-Javadoc)
114
 
115
	 */
116
	public void start(final Node element, final Document environment, final TreePath elementPath) {
117
 
118
 
119
		JMenu dummyMenu = new JMenu("dummy plugin");
120
		JMenuItem dummyItem = new JMenuItem("dummy Item");
121
		dummyItem.addActionListener(this);
122
		dummyMenu.add(dummyItem);
123
		gui.setPluginMenu(dummyMenu);
124
 
125
		gui.setPluginPanel(this);
126
		setVisible(true);
127
 
128
 
129
		
130
//		//for testing
131
//		forceStatusReport();
813 swalkenh 132
//		System.out.println("dummy plugin has fired");
521 swalkenh 133
	}
134
 
135
136
	/* (non-Javadoc)
137
	 * @see src.gui.PluginInterface#stop()
138
	 */
139
	public void stop() {
140
 
141
		gui.setPluginMenu(null);
142
	}
143
 
144
145
 
146
	 * @see src.gui.PluginInterface#setOurEventListener(src.control.OurEventListener)
147
	 */
148
	public void setOurEventListener(OurEventListener newListener) {
149
		ourEventListener = newListener;
150
 
151
 
152
153
	/* (non-Javadoc)
154
	 * @see src.gui.PluginInterface#forceStatusReport()
155
	 */
156
	public void forceStatusReport() {
157
		Node modifiedElement = originalElement;
158
		// removes all Attributes from "Image"
159
 
160
 
161
			attr.removeNamedItem("name");
162
			attr.removeNamedItem("url");
163
		 }
164
		 // removes first Child from "Image"
165
		if (modifiedElement.hasChildNodes()){
166
			modifiedElement.removeChild(modifiedElement.getFirstChild());
167
 
168
 
169
		Node clonedElement = modifiedElement.cloneNode(true);
170
		modifiedElement.appendChild(clonedElement);
171
		 		
172
		firePluginChangedElement(originalElement, modifiedElement);
173
	}
174
	
175
	
176
	private void firePluginChangedElement(Node oldNode, Node changedElement) {
177
		OurEvent e = new OurEvent(new Object[] {oldNode, changedElement, pluginName});
178
		ourEventListener.firedOurEvent(e);
179
	}
180
181
182
	/* (non-Javadoc)
183
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
184
 
185
	public void actionPerformed(ActionEvent arg0) {
186
		if (arg0.getActionCommand() == "dummy Item") {
187
 
188
		}
189
	}
190
 
191
 
192
xñ.¦(ãɸ¸0src/plugins/dummyPlugin/DummyPluginTransform.xsl<!-- to-direction for dummy plugin
193
     status: ready
194
     updated to given schema from 15/07/2003 
195
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
196
 
197
 
198
199
200
<xsl:template match="/">
201
	<xsl:apply-templates />
202
</xsl:template>
203
204
<xsl:template match="node()">
205
	<xsl:copy-of select="." />
206
 
240 swalkenh 207
813 swalkenh 208
 
577 swalkenh 209
</xsl:stylesheet>PK
210
xñ.gòÍ׺º4src/plugins/dummyPlugin/DummyPluginTransformBack.xsl<!-- back-direction for dummy plugin
211
     status: ready
212
     updated to given schema from 15/07/2003 
213
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
214
 
215
 
216
217
218
<xsl:template match="/">
219
 
220
</xsl:template>
221
222
<xsl:template match="node()">
223
 
224
 
240 swalkenh 225
813 swalkenh 226
 
577 swalkenh 227
</xsl:stylesheet>PK
228
229
÷ù.	META-INF/þÊPK
230
231
÷ù.J&t+META-INF/MANIFEST.MFPK
232
 
233
 
234
235
\qõ.ße•­
­
(+src/plugins/dummyPlugin/DummyPlugin.javaPK
236
237
 
238
239
xñ.gòÍ׺º4$$src/plugins/dummyPlugin/DummyPluginTransformBack.xslPKê0&