|
Lines 37-65
Link Here
|
| 37 |
protected void updateModel( final IProgressMonitor monitor ) |
37 |
protected void updateModel( final IProgressMonitor monitor ) |
| 38 |
throws CoreException |
38 |
throws CoreException |
| 39 |
{ |
39 |
{ |
| 40 |
createEntryPointsExtension(); |
40 |
createApplicationExtension(); |
| 41 |
createPerspectivesExtension(); |
41 |
createPerspectivesExtension(); |
| 42 |
} |
42 |
} |
| 43 |
|
43 |
|
| 44 |
// helping methods |
44 |
// helping methods |
| 45 |
// //////////////// |
45 |
// //////////////// |
| 46 |
private void createEntryPointsExtension() throws CoreException { |
46 |
private void createApplicationExtension() throws CoreException { |
| 47 |
IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT, |
47 |
IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION, |
| 48 |
true ); |
48 |
true ); |
| 49 |
IPluginElement element = createElement( extension ); |
49 |
extension.setId( "hello" ); |
| 50 |
element.setName( XmlNames.ELEM_ENTRYPOINT ); |
50 |
IPluginElement applicationElement = createElement( extension ); |
| 51 |
element.setAttribute( XmlNames.ATT_CLASS, |
51 |
applicationElement.setName( XmlNames.ELEM_APPLICATION ); |
| 52 |
getEntrypointId() ); //$NON-NLS-1$ |
52 |
applicationElement.setAttribute( XmlNames.ATT_VISIBLE, |
| 53 |
element.setAttribute( XmlNames.ATT_ID, |
53 |
getVisibility() ); //$NON-NLS-1$ |
| 54 |
getEntrypointId() ); //$NON-NLS-1$ |
54 |
applicationElement.setAttribute( XmlNames.ATT_CARDINALITY, |
| 55 |
element.setAttribute( XmlNames.ATT_PARAMETER, "hello" ); //$NON-NLS-1$ |
55 |
getCardinality() ); //$NON-NLS-1$ |
| 56 |
extension.add( element ); |
56 |
applicationElement.setAttribute( XmlNames.ATT_THREAD, |
|
|
57 |
getThread() ); //$NON-NLS-1$ |
| 58 |
extension.add( applicationElement ); |
| 59 |
IPluginElement runElement = createElement( extension ); |
| 60 |
runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$ |
| 61 |
runElement.setAttribute( XmlNames.ATT_CLASS, getEntrypointId() ); //$NON-NLS-1$ |
| 62 |
applicationElement.add( runElement ); |
| 57 |
addExtensionToPlugin( extension ); |
63 |
addExtensionToPlugin( extension ); |
| 58 |
} |
64 |
} |
| 59 |
|
65 |
|
| 60 |
private String getEntrypointId() { |
66 |
private String getEntrypointId() { |
| 61 |
return getPackageName() + "." + getApplicationName(); |
67 |
return getPackageName() + "." + getApplicationName(); |
| 62 |
} |
68 |
} |
|
|
69 |
|
| 70 |
private String getThread() { |
| 71 |
return "main"; //$NON-NLS-1$ |
| 72 |
} |
| 73 |
|
| 74 |
private String getCardinality() { |
| 75 |
return "singleton-global"; //$NON-NLS-1$ |
| 76 |
} |
| 77 |
|
| 78 |
private String getVisibility() { |
| 79 |
return "true"; //$NON-NLS-1$ |
| 80 |
} |
| 63 |
|
81 |
|
| 64 |
private void createPerspectivesExtension() throws CoreException { |
82 |
private void createPerspectivesExtension() throws CoreException { |
| 65 |
IPluginExtension extension |
83 |
IPluginExtension extension |