X Tutup
Skip to content

Commit 63b719d

Browse files
committed
Added a sample where a perspective is contributes via a modelfragment
and a part is attached to this percpection via a different plugin. Change-Id: I40258e98736ef63b146514f55ef1ce31260662c4 Signed-off-by: Simon Scholz <simon.scholz@vogella.com>
1 parent cbce2ef commit 63b719d

File tree

19 files changed

+241
-0
lines changed

19 files changed

+241
-0
lines changed

com.vogella.rcp.jface.translation.feature/feature.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,18 @@
4040
fragment="true"
4141
unpack="false"/>
4242

43+
<plugin
44+
id="com.vogella.rcp.perspective.addpart"
45+
download-size="0"
46+
install-size="0"
47+
version="0.0.0"
48+
unpack="false"/>
49+
50+
<plugin
51+
id="com.vogella.rcp.perspective.plugin"
52+
download-size="0"
53+
install-size="0"
54+
version="0.0.0"
55+
unpack="false"/>
56+
4357
</feature>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.vogella.rcp.perspective.addpart</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.pde.PluginNature</nature>
26+
<nature>org.eclipse.jdt.core.javanature</nature>
27+
</natures>
28+
</projectDescription>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.compliance=1.7
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.source=1.7
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
eclipse.preferences.version=1
2+
pluginProject.extensions=false
3+
resolve.requirebundle=false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: Addpart
4+
Bundle-SymbolicName: com.vogella.rcp.perspective.addpart;singleton:=true
5+
Bundle-Version: 1.0.0.qualifier
6+
Bundle-Vendor: VOGELLA
7+
Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="1.1.0.v20140512-1820",
8+
javax.annotation,
9+
javax.inject,
10+
org.eclipse.swt
11+
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
output.. = bin/
2+
bin.includes = META-INF/,\
3+
.,\
4+
fragment.e4xmi,\
5+
plugin.xml
6+
source.. = src/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="ASCII"?>
2+
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmi:id="_4AFUkHBHEeSUOKH6e4Re4Q">
3+
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_onzBsHCkEeSa385pQWkASw" featurename="children" parentElementId="com.vogella.rcp.perspective.plugin.partstack.additional">
4+
<elements xsi:type="basic:Part" xmi:id="_tDKZwHCkEeSa385pQWkASw" elementId="com.vogella.rcp.perspective.addpart.part.partAddedByDifferentPlugin" contributionURI="bundleclass://com.vogella.rcp.perspective.addpart/com.vogella.rcp.perspective.addpart.parts.ContributePerspective" label="Part added by different plugin" closeable="true"/>
5+
</fragments>
6+
</fragment:ModelFragments>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<plugin>
3+
4+
<extension
5+
id="com.vogella.rcp.perspective.addpart.fragment"
6+
point="org.eclipse.e4.workbench.model">
7+
<fragment
8+
uri="fragment.e4xmi">
9+
</fragment>
10+
</extension>
11+
12+
</plugin>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
package com.vogella.rcp.perspective.addpart.parts;
3+
4+
import javax.annotation.PostConstruct;
5+
import javax.inject.Inject;
6+
7+
import org.eclipse.swt.SWT;
8+
import org.eclipse.swt.layout.GridData;
9+
import org.eclipse.swt.widgets.Composite;
10+
import org.eclipse.swt.widgets.Label;
11+
12+
public class ContributePerspective {
13+
@Inject
14+
public ContributePerspective() {
15+
16+
}
17+
18+
@PostConstruct
19+
public void postConstruct(Composite parent) {
20+
Label label = new Label(parent, SWT.NONE);
21+
label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false,
22+
false));
23+
label.setText("This MPart has been contributed by an different model fragment from a different plguin.");
24+
25+
}
26+
27+
28+
29+
30+
}

0 commit comments

Comments
 (0)
X Tutup