Author: scabanovich
Date: 2010-11-08 08:19:04 -0500 (Mon, 08 Nov 2010)
New Revision: 26328
Added:
trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml
trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml
Modified:
trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java
Log:
JBIDE-7500
https://jira.jboss.org/browse/JBIDE-7500
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2010-11-08 13:16:34 UTC (rev
26327)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2010-11-08 13:19:04 UTC (rev
26328)
@@ -188,10 +188,14 @@
</include>
<include file="templates/esb_1_2.xml"
translations="templates/esb_1_1.properties">
</include>
+ <include file="templates/esb_1_3.xml"
translations="templates/esb_1_1.properties">
+ </include>
<include file="templates/esb_1_1a.xml"
translations="templates/esb_1_1.properties">
</include>
<include file="templates/esb_1_2a.xml"
translations="templates/esb_1_1.properties">
</include>
+ <include file="templates/esb_1_3a.xml"
translations="templates/esb_1_1.properties">
+ </include>
</extension>
Modified:
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java 2010-11-08
13:16:34 UTC (rev 26327)
+++
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/wizard/NewActionWizardPage.java 2010-11-08
13:19:04 UTC (rev 26328)
@@ -17,15 +17,15 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.ui.CodeGeneration;
-import org.eclipse.jdt.ui.wizards.NewTypeWizardPage.ImportsManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
@@ -98,7 +98,7 @@
List<String> labels = new ArrayList<String>();
labels.add("As AbstractActionPipelineProcessor implementation");
labels.add("As annotated POJO");
- List values = new ArrayList();
+ List<String> values = new ArrayList<String>();
values.add("false");
values.add("true");
RadioFieldEditor radio = new RadioFieldEditor(name, "", labels, values,
defaultValue);
@@ -181,8 +181,38 @@
}
void modifyJavaSourceForPOJO(IType type, ImportsManager imports) {
+ StringBuffer buf = new StringBuffer();
+
+ IMethod process = null;
try {
- StringBuffer buf= new StringBuffer();
+ IMethod[] ms = type.getMethods();
+ for (int i = 0; i < ms.length; i++) {
+ if(ms[i].getElementName().equals("process")) { //$NON-NLS-1$
+ process = ms[i];
+ }
+ }
+ } catch (JavaModelException e) {
+ //
+ }
+
+ if(process != null) {
+ try {
+ ICompilationUnit w = type.getCompilationUnit();
+ IBuffer b = w.getBuffer();
+ String lineDelimiter = StubUtility.getLineDelimiterUsed(type.getJavaProject());
+ int offset = process.getSourceRange().getOffset();
+ String tab = "\t"; //$NON-NLS-1$
+ imports.addImport(PROCESS); //$NON-NLS-1$
+ buf.append(tab).append("(a)Process").append(lineDelimiter); //$NON-NLS-1$
+ b.replace(offset, 0, buf.toString());
+ } catch (JavaModelException e) {
+ ESBCorePlugin.log(e);
+ }
+ return;
+ }
+
+
+ try {
final String lineDelim= "\n"; // OK, since content is formatted afterwards
//$NON-NLS-1$
String comment= CodeGeneration.getMethodComment(type.getCompilationUnit(),
type.getTypeQualifiedName('.'), "process", new String[]
{"message"}, new String[0], Signature.createTypeSignature("void",
true), null, lineDelim); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (comment != null) {
Added: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml
(rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml 2010-11-08 13:19:04 UTC
(rev 26328)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE meta-template PUBLIC "-//Red Hat Inc.//DTD Meta Templates
1.0//EN"
+
"http://www.redhat.com/templates/dtds/meta-template_1_0.dtd">
+
+<meta-templates
uri="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/s...
http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml...
+
+ <meta-template axis="action@class" displayName="Action Class"
xEntity="NONE">
+ <super-class
name="org.jboss.soa.esb.actions.AbstractActionPipelineProcessor"/>
+ </meta-template>
+
+</meta-templates>
\ No newline at end of file
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml
(rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml 2010-11-08 13:19:04
UTC (rev 26328)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE meta-template PUBLIC "-//Red Hat Inc.//DTD Meta Templates
1.0//EN"
+
"http://www.redhat.com/templates/dtds/meta-template_1_0.dtd">
+
+<meta-templates
uri="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/s...
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schem...
+
+ <meta-template axis="action@class" displayName="Action Class"
xEntity="NONE">
+ <super-class
name="org.jboss.soa.esb.actions.AbstractActionPipelineProcessor"/>
+ </meta-template>
+
+</meta-templates>
\ No newline at end of file
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/templates/esb_1_3a.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain