Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

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