diff options
author | Lars Vogel | 2012-12-04 14:42:52 +0000 |
---|---|---|
committer | Lars Vogel | 2012-12-04 14:42:52 +0000 |
commit | bcdf13b047ef504fa3006b33a32f416cf73b6f55 (patch) | |
tree | e3ae3d2bdb6151b794d59df251a453add1bdbe49 | |
parent | e2cd56776a1596e39621a4c28034c7eb097e069a (diff) | |
download | org.eclipse.e4.tools-bcdf13b047ef504fa3006b33a32f416cf73b6f55.tar.gz org.eclipse.e4.tools-bcdf13b047ef504fa3006b33a32f416cf73b6f55.tar.xz org.eclipse.e4.tools-bcdf13b047ef504fa3006b33a32f416cf73b6f55.zip |
Bug 395710 - Wizard for creating new class for a Part - Add Composite
for PostConstruct method
WindowBuilder searches for a method annotated with PostConstruct which
gets a Composite as parameter.
-rw-r--r-- | bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/templates/PartTemplate.java | 4 | ||||
-rw-r--r-- | bundles/org.eclipse.e4.tools/templates/part.txtjet | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/templates/PartTemplate.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/templates/PartTemplate.java index 5cdb9871..7a189160 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/templates/PartTemplate.java +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/templates/PartTemplate.java @@ -18,7 +18,7 @@ public class PartTemplate protected final String TEXT_2 = NL + "package "; protected final String TEXT_3 = ";"; protected final String TEXT_4 = NL + NL + "import javax.inject.Inject;"; - protected final String TEXT_5 = NL + "import javax.annotation.PostConstruct;"; + protected final String TEXT_5 = NL + "import javax.annotation.PostConstruct;" + NL + "import org.eclipse.swt.widgets.Composite;"; protected final String TEXT_6 = NL + "import javax.annotation.PreDestroy;"; protected final String TEXT_7 = NL + "import org.eclipse.e4.ui.di.Focus;"; protected final String TEXT_8 = NL + "import org.eclipse.e4.ui.di.Persist;"; @@ -26,7 +26,7 @@ public class PartTemplate protected final String TEXT_10 = " {" + NL + "\t@Inject" + NL + "\tpublic "; protected final String TEXT_11 = "() {" + NL + "\t\t//TODO Your code here" + NL + "\t}" + NL + "\t"; protected final String TEXT_12 = NL + "\t@PostConstruct" + NL + "\tpublic void "; - protected final String TEXT_13 = "() {" + NL + "\t\t//TODO Your code here" + NL + "\t}" + NL + "\t"; + protected final String TEXT_13 = "(Composite parent) {" + NL + "\t\t//TODO Your code here" + NL + "\t}" + NL + "\t"; protected final String TEXT_14 = NL + "\t"; protected final String TEXT_15 = NL + "\t@PreDestroy" + NL + "\tpublic void "; protected final String TEXT_16 = "() {" + NL + "\t\t//TODO Your code here" + NL + "\t}" + NL + "\t"; diff --git a/bundles/org.eclipse.e4.tools/templates/part.txtjet b/bundles/org.eclipse.e4.tools/templates/part.txtjet index f79efd96..a7106134 100644 --- a/bundles/org.eclipse.e4.tools/templates/part.txtjet +++ b/bundles/org.eclipse.e4.tools/templates/part.txtjet @@ -7,6 +7,7 @@ package <%= domainClass.getPackageFragment().getElementName() %>; import javax.inject.Inject; <% if( domainClass.isUsePostConstruct() ) { %> import javax.annotation.PostConstruct; +import org.eclipse.swt.widgets.Composite; <% } %> <% if( domainClass.isUsePredestroy() ) { %> import javax.annotation.PreDestroy; @@ -25,7 +26,7 @@ public class <%= domainClass.getName() %> { } <% if( domainClass.isUsePostConstruct() ) { %> @PostConstruct - public void <%= domainClass.getPostConstructMethodName() %>() { + public void <%= domainClass.getPostConstructMethodName() %>(Composite parent) { //TODO Your code here } <% } %> |