422
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 Borland Software Corporation
|
|
3 |
*
|
|
4 |
* All rights reserved. This program and the accompanying materials
|
|
5 |
* are made available under the terms of the Eclipse Public License v1.0
|
|
6 |
* which accompanies this distribution, and is available at
|
|
7 |
* http://www.eclipse.org/legal/epl-v10.html
|
|
8 |
*
|
|
9 |
* Contributors:
|
|
10 |
* Alexander Shatalin (Borland) - initial API and implementation
|
|
11 |
*/
|
|
12 |
|
|
13 |
«IMPORT "http://www.eclipse.org/gmf/2008/GenModel"»
|
|
14 |
|
|
15 |
«DEFINE AbstractNavigatorItem FOR gmfgen::GenNavigator-»
|
|
16 |
«EXPAND xpt::Common::copyright FOR editorGen-»
|
|
17 |
package «packageName»;
|
|
18 |
|
|
19 |
«EXPAND xpt::Common::generatedClassComment»
|
|
20 |
public abstract class «abstractNavigatorItemClassName» extends org.eclipse.core.runtime.PlatformObject {
|
|
21 |
|
|
22 |
«IF null != editorGen.propertySheet»
|
|
23 |
«EXPAND registerAdapterFactory-»
|
|
24 |
«ENDIF-»
|
|
25 |
|
|
26 |
«EXPAND attributes-»
|
|
27 |
|
|
28 |
«EXPAND constructor-»
|
|
29 |
|
|
30 |
«EXPAND getParent-»
|
|
31 |
|
|
32 |
«EXPAND additions-»
|
|
33 |
}
|
|
34 |
«ENDDEFINE»
|
|
35 |
|
|
36 |
«DEFINE registerAdapterFactory FOR gmfgen::GenNavigator-»
|
|
37 |
«EXPAND xpt::Common::generatedMemberComment»
|
|
38 |
static {
|
|
39 |
final Class[] supportedTypes = new Class[] { org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor.class };
|
|
40 |
final org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor propertySheetPageContributor = new org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor() {
|
|
41 |
public String getContributorId() {
|
|
42 |
return "«editorGen.plugin.iD»"; «EXPAND xpt::Common::nonNLS»
|
|
43 |
}
|
|
44 |
};
|
|
45 |
org.eclipse.core.runtime.Platform.getAdapterManager().registerAdapters(new org.eclipse.core.runtime.IAdapterFactory() {
|
|
46 |
|
|
47 |
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
|
48 |
if (adaptableObject instanceof «getAbstractNavigatorItemQualifiedClassName()» && adapterType == org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor.class) {
|
|
49 |
return propertySheetPageContributor;
|
|
50 |
}
|
|
51 |
return null;
|
|
52 |
}
|
|
53 |
|
|
54 |
public Class[] getAdapterList() {
|
|
55 |
return supportedTypes;
|
|
56 |
}
|
|
57 |
}, «getAbstractNavigatorItemQualifiedClassName()».class);
|
|
58 |
}
|
|
59 |
«ENDDEFINE»
|
|
60 |
|
|
61 |
«DEFINE attributes FOR gmfgen::GenNavigator-»
|
|
62 |
«EXPAND xpt::Common::generatedMemberComment»
|
|
63 |
private Object myParent;
|
|
64 |
«ENDDEFINE»
|
|
65 |
|
|
66 |
«DEFINE constructor FOR gmfgen::GenNavigator-»
|
|
67 |
«EXPAND xpt::Common::generatedMemberComment»
|
|
68 |
protected «abstractNavigatorItemClassName»(Object parent) {
|
|
69 |
myParent = parent;
|
|
70 |
}
|
|
71 |
«ENDDEFINE»
|
|
72 |
|
|
73 |
«DEFINE getParent FOR gmfgen::GenNavigator-»
|
|
74 |
«EXPAND xpt::Common::generatedMemberComment»
|
|
75 |
public Object getParent() {
|
|
76 |
return myParent;
|
|
77 |
}
|
|
78 |
«ENDDEFINE»
|
|
79 |
|
|
80 |
«DEFINE additions FOR gmfgen::GenNavigator-»
|
|
81 |
«ENDDEFINE» |