Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6c4fa501a53da744f330e5b88685bff4dcd8449e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
package org.eclipse.papyrus.prototype.infra.gmfdiag.css;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.common.util.EList;
import org.eclipse.e4.ui.css.core.dom.CSSExtendedProperties;
import org.eclipse.e4.ui.css.core.dom.CSSStylableElement;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.core.impl.dom.CSSExtendedPropertiesImpl;
import org.eclipse.gmf.runtime.notation.*;
import org.eclipse.gmf.runtime.notation.impl.TitleStyleImpl;
import org.eclipse.papyrus.prototype.infra.gmfdiag.css.style.CSSTitleStyle;
import org.eclipse.papyrus.prototype.infra.gmfdiag.css.style.impl.CSSTitleStyleImpl;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.TypeInfo;
import org.w3c.dom.UserDataHandler;
import org.w3c.dom.css.CSSStyleDeclaration;
import org.eclipse.papyrus.prototype.infra.gmfdiag.css.adapter.GMFCSSAdapter;

@SuppressWarnings("restriction")
public class GMFCSSTitleStyle extends TitleStyleImpl implements CSSStylableElement, CSSTitleStyle {

	protected CSSEngine engine;

	private CSSStylableElement cssAdapter;

	private CSSTitleStyle titleStyle;
	
	public GMFCSSTitleStyle(CSSEngine engine) {
		this.engine = engine;
		this.cssAdapter = new GMFCSSAdapter(this, engine);
		this.titleStyle = new CSSTitleStyleImpl(this, this, engine);
	}

	//////////////////////////////////////////
	//	Forwards accesses to CSS properties	//
	//////////////////////////////////////////

	public boolean isCSSShowTitle(){
		if (eIsSet(NotationPackage.eINSTANCE.getTitleStyle_ShowTitle())){
			return super.isShowTitle();
		} else {
			return titleStyle.isCSSShowTitle();
		}
	}


	@Override
	public boolean isShowTitle(){
		//return super.isShowTitle();
		return isCSSShowTitle();
	}


	//////////////////////////////////////////
	//	Forwards all calls to cssAdapter	//
	//////////////////////////////////////////

	public String getTagName() {
		return cssAdapter.getTagName();
	}
	
	public String getAttribute(String name) {
		return cssAdapter.getAttribute(name);
	}
	
	public void setAttribute(String name, String value) throws DOMException {
		setAttribute(name, value);
	}
	
	public void removeAttribute(String name) throws DOMException {
		removeAttribute(name);
	}
	
	public Attr getAttributeNode(String name) {
		return cssAdapter.getAttributeNode(name);
	}
	
	public Attr setAttributeNode(Attr newAttr) throws DOMException {
		return cssAdapter.setAttributeNode(newAttr);
	}
	
	public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
		return cssAdapter.removeAttributeNode(oldAttr);
	}
	
	public NodeList getElementsByTagName(String name) {
		return cssAdapter.getElementsByTagName(name);
	}
	
	public String getAttributeNS(String namespaceURI, String localName) throws DOMException {
		return cssAdapter.getAttributeNS(namespaceURI, localName);
	}
	
	public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException {
		setAttributeNS(namespaceURI, qualifiedName, value);
	}
	
	public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
		removeAttributeNS(namespaceURI, localName);
	}
	
	public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException {
		return cssAdapter.getAttributeNodeNS(namespaceURI, localName);
	}
	
	public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
		return cssAdapter.setAttributeNodeNS(newAttr);
	}
	
	public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException {
		return cssAdapter.getElementsByTagNameNS(namespaceURI, localName);
	}
	
	public boolean hasAttribute(String name) {
		return cssAdapter.hasAttribute(name);
	}
	
	public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException {
		return cssAdapter.hasAttributeNS(namespaceURI, localName);
	}
	
	public TypeInfo getSchemaTypeInfo() {
		return cssAdapter.getSchemaTypeInfo();
	}
	
	public void setIdAttribute(String name, boolean isId) throws DOMException {
		setIdAttribute(name, isId);
	}
	
	public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
		setIdAttributeNS(namespaceURI, localName, isId);
	}
	
	public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException {
		setIdAttributeNode(idAttr, isId);
	}
	
	public String getNodeName() {
		return cssAdapter.getNodeName();
	}
	
	public String getNodeValue() throws DOMException {
		return cssAdapter.getNodeValue();
	}
	
	public void setNodeValue(String nodeValue) throws DOMException {
		setNodeValue(nodeValue);
	}
	
	public short getNodeType() {
		return cssAdapter.getNodeType();
	}
	
	public Node getParentNode() {
		return cssAdapter.getParentNode();
	}
	
	public NodeList getChildNodes() {
		return cssAdapter.getChildNodes();
	}
	
	public Node getFirstChild() {
		return cssAdapter.getFirstChild();
	}
	
	public Node getLastChild() {
		return cssAdapter.getLastChild();
	}
	
	public Node getPreviousSibling() {
		return cssAdapter.getPreviousSibling();
	}
	
	public Node getNextSibling() {
		return cssAdapter.getNextSibling();
	}
	
	public NamedNodeMap getAttributes() {
		return cssAdapter.getAttributes();
	}
	
	public Document getOwnerDocument() {
		return cssAdapter.getOwnerDocument();
	}
	
	public Node insertBefore(Node newChild, Node refChild) throws DOMException {
		return cssAdapter.insertBefore(newChild, refChild);
	}
	
	public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
		return cssAdapter.replaceChild(newChild, oldChild);
	}
	
	public Node removeChild(Node oldChild) throws DOMException {
		return cssAdapter.removeChild(oldChild);
	}
	
	public Node appendChild(Node newChild) throws DOMException {
		return cssAdapter.appendChild(newChild);
	}
	
	public boolean hasChildNodes() {
		return cssAdapter.hasChildNodes();
	}
	
	public Node cloneNode(boolean deep) {
		return cssAdapter.cloneNode(deep);
	}
	
	public void normalize() {
		normalize();
	}
	
	public boolean isSupported(String feature, String version) {
		return cssAdapter.isSupported(feature, version);
	}
	
	public String getNamespaceURI() {
		return cssAdapter.getNamespaceURI();
	}
	
	public String getPrefix() {
		return cssAdapter.getPrefix();
	}
	
	public void setPrefix(String prefix) throws DOMException {
		setPrefix(prefix);
	}
	
	public String getLocalName() {
		return cssAdapter.getLocalName();
	}
	
	public boolean hasAttributes() {
		return cssAdapter.hasAttributes();
	}
	
	public String getBaseURI() {
		return cssAdapter.getBaseURI();
	}
	
	public short compareDocumentPosition(Node other) throws DOMException {
		return cssAdapter.compareDocumentPosition(other);
	}
	
	public String getTextContent() throws DOMException {
		return cssAdapter.getTextContent();
	}
	
	public void setTextContent(String textContent) throws DOMException {
		setTextContent(textContent);
	}
	
	public boolean isSameNode(Node other) {
		return cssAdapter.isSameNode(other);
	}
	
	public String lookupPrefix(String namespaceURI) {
		return cssAdapter.lookupPrefix(namespaceURI);
	}
	
	public boolean isDefaultNamespace(String namespaceURI) {
		return cssAdapter.isDefaultNamespace(namespaceURI);
	}
	
	public String lookupNamespaceURI(String prefix) {
		return cssAdapter.lookupNamespaceURI(prefix);
	}
	
	public boolean isEqualNode(Node arg) {
		return cssAdapter.isEqualNode(arg);
	}
	
	public Object getFeature(String feature, String version) {
		return cssAdapter.getFeature(feature, version);
	}
	
	public Object setUserData(String key, Object data, UserDataHandler handler) {
		return cssAdapter.setUserData(key, data, handler);
	}
	
	public Object getUserData(String key) {
		return cssAdapter.getUserData(key);
	}
	
	public Object getNativeWidget() {
		return cssAdapter.getNativeWidget();
	}
	
	public String getCSSId() {
		return cssAdapter.getCSSId();
	}
	
	public String getCSSClass() {
		return cssAdapter.getCSSClass();
	}
	
	public String getCSSStyle() {
		return cssAdapter.getCSSStyle();
	}
	
	public CSSStyleDeclaration getDefaultStyleDeclaration(String pseudoE) {
		return cssAdapter.getDefaultStyleDeclaration(pseudoE);
	}
	
	public void copyDefaultStyleDeclarations(CSSStylableElement stylableElement) {
		copyDefaultStyleDeclarations(stylableElement);
	}
	
	public void setDefaultStyleDeclaration(String pseudoE, CSSStyleDeclaration defaultStyleDeclaration) {
		setDefaultStyleDeclaration(pseudoE, defaultStyleDeclaration);
	}
	
	public boolean isPseudoInstanceOf(String s) {
		return cssAdapter.isPseudoInstanceOf(s);
	}
	
	public String[] getStaticPseudoInstances() {
		return cssAdapter.getStaticPseudoInstances();
	}
	
	public boolean isStaticPseudoInstance(String s) {
		return cssAdapter.isStaticPseudoInstance(s);
	}
	
	public void onStylesApplied(NodeList nodes) {
		onStylesApplied(nodes);
	}
	
	public CSSExtendedProperties getStyle() {
		return cssAdapter.getStyle();
	}
	
	public void initialize() {
		initialize();
	}
	
	public void dispose() {
		dispose();
	}
}

Back to the top