Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 swalkenh 1
PK
521 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
521 swalkenh 25
 
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
68
 
69
 
70
 
71
import src.plugins.PluginInterface;
72
73
74
/**
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
öhð.®*ô__0src/plugins/dummyPlugin/DummyPluginTransform.xsl<!-- for dummy plugin: simply copy the whole document -->
192
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
193
<xsl:output method="xml" indent="yes" />
194
195
 
196
 
197
</xsl:template>
198
199
<xsl:template match="node()">
200
	<xsl:copy-of select="." />
201
</xsl:template>
202
203
</xsl:stylesheet>PK
204
öhð.hÃ'ii4src/plugins/dummyPlugin/DummyPluginTransformBack.xsl<!-- backwards for dummy plugin: simply copy the whole document -->
205
 
240 swalkenh 206
<xsl:output method="xml" indent="yes" />
521 swalkenh 207
 
348 swalkenh 208
<xsl:template match="/">
209
	<xsl:apply-templates />
210
 
521 swalkenh 211
212
<xsl:template match="node()">
348 swalkenh 213
	<xsl:copy-of select="." />
214
 
521 swalkenh 215
216
</xsl:stylesheet>PK
217
218
 
240 swalkenh 219
521 swalkenh 220
 
348 swalkenh 221
222
hð.⪍//)asrc/plugins/dummyPlugin/DummyPlugin.classPK
223
 
521 swalkenh 224
hð.§¶6o
o
(×src/plugins/dummyPlugin/DummyPlugin.javaPK
225
348 swalkenh 226
öhð.®*ô__0Œ!src/plugins/dummyPlugin/DummyPluginTransform.xslPK
227
 
521 swalkenh 228
öhð.hÃ'ii49#src/plugins/dummyPlugin/DummyPluginTransformBack.xslPKêô$