JBoss Tools SVN: r10042 - in trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common: policy and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-09-03 07:20:23 -0400 (Wed, 03 Sep 2008)
New Revision: 10042
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java
Log:
all elements are pluggable
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java 2008-09-03 10:41:33 UTC (rev 10041)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/DefaultEditPartFactory.java 2008-09-03 11:20:23 UTC (rev 10042)
@@ -4,6 +4,7 @@
import org.eclipse.gef.EditPartFactory;
import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.registry.ElementRegistry;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
public class DefaultEditPartFactory implements EditPartFactory {
@@ -14,24 +15,9 @@
Object element = ((Wrapper)model).getElement();
if (element != null && element instanceof Element) {
result = ElementRegistry.createEditPart((Element)element);
+ } else if (model instanceof ConnectionWrapper) {
+ result = new ConnectionEditPart();
}
-// result = createEditPart()
-// if (model instanceof DefaultFlowWrapper) {
-// result = new RootEditPart();
-// } else if (model instanceof DefaultContainerWrapper) {
-// result = new ContainerEditPart();
-// } else if (model instanceof DefaultConnectionWrapper) {
-// result = new ConnectionEditPart();
-// } else if (model instanceof DefaultNodeWrapper && element instanceof StartState) {
-// result = new StartStateEditPart();
-// } else if (model instanceof DefaultNodeWrapper && element instanceof State) {
-// result = new StateEditPart();
-// } else if (model instanceof DefaultNodeWrapper && element instanceof EndState) {
-// result = new EndStateEditPart();
-// } else {
-// throw new IllegalArgumentException(
-// "Unknown model object " + model);
-// }
if (result != null) {
result.setModel(model);
}
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java 2008-09-03 10:41:33 UTC (rev 10041)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java 2008-09-03 11:20:23 UTC (rev 10042)
@@ -26,6 +26,7 @@
import org.jboss.tools.flow.common.command.DeleteConnectionCommand;
import org.jboss.tools.flow.common.command.SplitConnectionCommand;
import org.jboss.tools.flow.common.editpart.ConnectionEditPart;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.AbstractConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.AbstractFlowWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
@@ -47,7 +48,7 @@
public Command getCommand(Request request) {
if (REQ_CREATE.equals(request.getType())) {
- return getSplitTransitionCommand(request);
+ return getSplitConnectionCommand(request);
}
return super.getCommand(request);
}
@@ -65,13 +66,19 @@
return cmd;
}
- protected Command getSplitTransitionCommand(Request request) {
+ protected Command getSplitConnectionCommand(Request request) {
if (elementConnectionFactory == null) {
throw new IllegalStateException("DefaultElementConnectionFactory is null");
}
SplitConnectionCommand cmd = new SplitConnectionCommand();
- cmd.setElementConnection(((AbstractConnectionWrapper) getHost().getModel()));
- cmd.setNewSecondConnection((AbstractConnectionWrapper)elementConnectionFactory.getNewObject());
+ AbstractConnectionWrapper elementConnection = (AbstractConnectionWrapper)getHost().getModel();
+ AbstractConnectionWrapper newSecondConnection = (AbstractConnectionWrapper)elementConnectionFactory.getNewObject();
+ // Copy the configurationElement from the first connection as it is empty
+ ((Element)newSecondConnection.getElement()).setMetaData(
+ "configurationElement",
+ ((Element)elementConnection.getElement()).getMetaData("configurationElement"));
+ cmd.setElementConnection(elementConnection);
+ cmd.setNewSecondConnection(newSecondConnection);
cmd.setParent(((AbstractFlowWrapper) ((ConnectionEditPart) getHost())
.getSource().getParent().getModel()));
cmd.setNewElement(((NodeWrapper) ((CreateRequest) request).getNewObject()));
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-09-03 10:41:33 UTC (rev 10041)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2008-09-03 11:20:23 UTC (rev 10042)
@@ -74,7 +74,9 @@
private static Wrapper createConnection(IConfigurationElement configurationElement)
throws CoreException {
- return new DefaultConnectionWrapper();
+ Wrapper result = new DefaultConnectionWrapper();
+ ((Element)result.getElement()).setMetaData("configurationElement", configurationElement);
+ return result;
}
private static Wrapper createNode(IConfigurationElement configurationElement)
@@ -232,9 +234,9 @@
children = figureElement.getChildren();
if (children.length < 1) {
result = new RectangleElementFigure();
- } else if ("ellipse".equals(children[0])){
+ } else if ("ellipse".equals(children[0].getName())){
result = new EllipseElementFigure();
- } else if ("rounded-rectangle".equals(children[0])) {
+ } else if ("rounded-rectangle".equals(children[0].getName())) {
result = new RoundedRectangleElementFigure();
} else {
result = new RectangleElementFigure();
@@ -251,8 +253,8 @@
}
result.setIcon(icon);
} else if (configurationElement.getAttribute("figure") != null) {
- String iconPath = configurationElement.getAttribute("icon");
- URL url = Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
+ String iconPath = configurationElement.getAttribute("figure");
+ URL url = Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
Image icon = null;
if (imageMap.containsKey(url.getPath())) {
icon = imageMap.get(url.getPath());
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java 2008-09-03 10:41:33 UTC (rev 10041)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java 2008-09-03 11:20:23 UTC (rev 10042)
@@ -11,6 +11,11 @@
public class DefaultConnectionWrapper extends AbstractConnectionWrapper {
+
+ public DefaultConnectionWrapper() {
+ // create a dummy connection in order to be able to add the metadata
+ setElement(createConnection(null, null));
+ }
public Connection getConnection() {
return (Connection)getElement();
@@ -60,6 +65,12 @@
}
protected Connection createConnection(Node from, Node to) {
- return new DefaultConnection(from, to);
+ Connection result = new DefaultConnection(from, to);
+ if (getConnection() != null) {
+ result.setMetaData(
+ "configurationElement",
+ getConnection().getMetaData("configurationElement"));
+ }
+ return result;
}
}
17 years, 7 months
JBoss Tools SVN: r10041 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-09-03 06:41:33 -0400 (Wed, 03 Sep 2008)
New Revision: 10041
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
Log:
<a4j:outputPanel> template refactoring
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-09-03 09:53:23 UTC (rev 10040)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/templates/vpe-templates-ajax4jsf.xml 2008-09-03 10:41:33 UTC (rev 10041)
@@ -119,7 +119,7 @@
<vpe:tag name="a4j:outputPanel" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <vpe:copy attrs="id,style,dir"/>
+ <div id="{@id}" style="{@style}" dir="{@dir}"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
17 years, 7 months
JBoss Tools SVN: r10040 - in workspace/grid/org.jboss.tools.bpmnTo: META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-09-03 05:53:23 -0400 (Wed, 03 Sep 2008)
New Revision: 10040
Added:
workspace/grid/org.jboss.tools.bpmnTo/schema/
workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnToAction.exsd
workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnTranslator.exsd
Modified:
workspace/grid/org.jboss.tools.bpmnTo/META-INF/MANIFEST.MF
workspace/grid/org.jboss.tools.bpmnTo/plugin.properties
workspace/grid/org.jboss.tools.bpmnTo/plugin.xml
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/action/B2JAction.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2J.properties
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2JMessages.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/action/BpmnToAction.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/dialog/GeneratedFilesLocationDialog.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java
Log:
improve codes
Modified: workspace/grid/org.jboss.tools.bpmnTo/META-INF/MANIFEST.MF
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/META-INF/MANIFEST.MF 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/META-INF/MANIFEST.MF 2008-09-03 09:53:23 UTC (rev 10040)
@@ -14,3 +14,11 @@
lib/dom4j-1.6.1.jar
Bundle-Vendor: %PLUGIN_PROVIDER
Import-Package: org.eclipse.core.resources
+Export-Package: org.jboss.tools.b2j.action,
+ org.jboss.tools.b2j.messages,
+ org.jboss.tools.b2j.translate,
+ org.jboss.tools.bpmnto,
+ org.jboss.tools.bpmnto.action,
+ org.jboss.tools.bpmnto.dialog,
+ org.jboss.tools.bpmnto.translate,
+ org.jboss.tools.bpmnto.util
Modified: workspace/grid/org.jboss.tools.bpmnTo/plugin.properties
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/plugin.properties 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/plugin.properties 2008-09-03 09:53:23 UTC (rev 10040)
@@ -1,3 +1,4 @@
b2jaction=BPMN -> JPDL
+bpmnto=BPMN TO
PLUGIN_NAME=BPMNTO
PLUGIN_PROVIDER=Red Hat, Inc.
\ No newline at end of file
Modified: workspace/grid/org.jboss.tools.bpmnTo/plugin.xml
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/plugin.xml 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/plugin.xml 2008-09-03 09:53:23 UTC (rev 10040)
@@ -1,20 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
+ <extension-point id="bpmnToAction" name="BPMN TO ACTION" schema="schema/bpmnToAction.exsd"/>
+ <extension-point id="bpmnTranslator" name="BPMN TRANSLATOR" schema="schema/bpmnTranslator.exsd"/>
<extension
point="org.eclipse.ui.popupMenus">
- <objectContribution
+
+
+ <objectContribution
id="org.jboss.tools.b2j.objectContribution.bpmnfile"
nameFilter="*.bpmn"
objectClass="org.eclipse.core.resources.IFile">
+
+ <menu
+ label="%bpmnto"
+ id="org.jboss.tools.bpmnTo.ActionSet"
+ path="additions">
+ <separator
+ name="group">
+ </separator>
+ </menu>
+
<action
label="%b2jaction"
class="org.jboss.tools.b2j.action.B2JAction"
- menubarPath="additions"
- enablesFor="1"
+ menubarPath="org.jboss.tools.bpmnTo.ActionSet/group"
+ enablesFor="+"
id="org.jboss.tools.b2j.B2JAction">
- </action>
- </objectContribution>
+ </action>
+ </objectContribution>
</extension>
</plugin>
Added: workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnToAction.exsd
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnToAction.exsd (rev 0)
+++ workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnToAction.exsd 2008-09-03 09:53:23 UTC (rev 10040)
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.bpmnTo" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.bpmnTo" id="bpmnToAction" name="BPMN TO ACTION"/>
+ </appinfo>
+ <documentation>
+ a translator action for bpmn to be added to popup menu
+ </documentation>
+ </annotation>
+
+ <element name="bpmnToAction">
+ <complexType>
+ <attribute name="action" type="string" use="required">
+ <annotation>
+ <documentation>
+ a action for translating bpmn to something
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.jboss.tools.bpmnto.action.BpmnToAction:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="bpmnToAction"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Added: workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnTranslator.exsd
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnTranslator.exsd (rev 0)
+++ workspace/grid/org.jboss.tools.bpmnTo/schema/bpmnTranslator.exsd 2008-09-03 09:53:23 UTC (rev 10040)
@@ -0,0 +1,84 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.bpmnTo" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.bpmnTo" id="bpmnTranslator" name="BPMN TRANSLATOR"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/action/B2JAction.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/action/B2JAction.java 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/action/B2JAction.java 2008-09-03 09:53:23 UTC (rev 10040)
@@ -15,118 +15,63 @@
import java.util.List;
import org.dom4j.Document;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.dialogs.ListDialog;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.b2j.messages.B2JMessages;
import org.jboss.tools.b2j.translate.BPMN2JPDL;
import org.jboss.tools.b2j.translate.GraphicalFileGenerator;
import org.jboss.tools.b2j.translate.TranslateHelper;
-import org.jboss.tools.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.bpmnto.action.BpmnToAction;
/**
* @author Grid Qian
*
* the popup menu action for bpmn ->jpdl
*/
-public class B2JAction implements IObjectActionDelegate {
+public class B2JAction extends BpmnToAction {
- private IFile bpmnFile;
+ public List<String> translateBpmn(String bpmnFileParentPath,
+ String bpmnFileName, List<String> poolIdList, String location) {
- public void setActivePart(IAction arg0, IWorkbenchPart part) {
- // myPart = part;
- }
+ List<String> warningList = new ArrayList<String>();
+ List<String> errorList = new ArrayList<String>();
- public void run(IAction arg0) {
- String bpmnFileName = bpmnFile.getName();
- String bpmnFileParentPath = bpmnFile.getParent().getLocation()
- .toOSString();
- translateBpmn(bpmnFileParentPath, bpmnFileName);
- }
+ Document bpmnDocument = null;
+ try {
+ bpmnDocument = getDocument(bpmnFileParentPath, bpmnFileName);
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ }
- public void translateBpmn(String bpmnFileParentPath, String bpmnFileName) {
- Document bpmnDocument = getDocument(bpmnFileParentPath, bpmnFileName);
+ BPMN2JPDL translator = new BPMN2JPDL(bpmnFileName, bpmnFileParentPath,
+ poolIdList, bpmnDocument);
- List<String> warningList = new ArrayList<String>();
- List<String> errorList = new ArrayList<String>();
-
- List<String> poolIdList = BPMNToUtil.selectElement(BPMNToUtil.getPoolIDsFromDocument(bpmnDocument));
- BPMN2JPDL translator = new BPMN2JPDL(bpmnFileName, bpmnFileParentPath,poolIdList, bpmnDocument);
-
- translator.translateToFiles(BPMNToUtil.getGeneratedFileLocation() == null ? bpmnFileParentPath:BPMNToUtil.getGeneratedFileLocation());
-
+ translator.translateToFiles(location);
+
warningList.addAll(translator.getWarnings());
errorList.addAll(translator.getErrors());
// generate jpdl gpd file from *.bpmn_diagram
- Document bpmnDiagramDocument = getDocument(bpmnFileParentPath,
- TranslateHelper.getBpmnDiagramName(bpmnFileName));
+ Document bpmnDiagramDocument = null;
+ try {
+ bpmnDiagramDocument = getDocument(bpmnFileParentPath,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName));
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName)));
+ }
GraphicalFileGenerator generator = new GraphicalFileGenerator(
bpmnDiagramDocument, translator.getMap(), bpmnFileParentPath,
- bpmnFileName);
- generator.translateToFiles();
-
+ bpmnFileName);
+ generator.translateToFiles(location);
+
warningList.addAll(generator.getWarnings());
errorList.addAll(generator.getErrors());
-
- showErrors(warningList,errorList);
- refreshWorkspace();
- }
- private void showErrors(List<String> warningList, List<String> errorList) {
List<String> list = new ArrayList<String>();
- list.addAll(errorList);
- list.addAll(warningList);
- if(list.size() == 0){
- return;
- }
-
- ListDialog dialog = new ListDialog(Display.getCurrent().getActiveShell());
- dialog.setTitle(B2JMessages.Bpmn_Translate_Message_Dialog_Title);
- dialog.setMessage(B2JMessages.Bpmn_Translate_Message_Dialog_Message);
-
- dialog.setInput(list);
- ILabelProvider labelProvider = new LabelProvider();
- ArrayContentProvider contentProvider = new ArrayContentProvider();
- dialog.setContentProvider(contentProvider);
- dialog.setLabelProvider(labelProvider);
- dialog.open();
- dialog.getResult();
- }
+ list.addAll(errorList);
+ list.addAll(warningList);
- public Document getDocument(String bpmnFileParentPath, String bpmnFileName) {
- Document bpmnDocument = null;
- try {
- bpmnDocument = BPMNToUtil.parse(bpmnFileParentPath, bpmnFileName);
- } catch (Exception e1) {
- System.out.println(B2JMessages.Translate_Error_BpmnFile_CanNotRead
- + e1.getMessage());
- }
- return bpmnDocument;
+ return list;
}
-
- public void refreshWorkspace() {
- try {
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
- IResource.DEPTH_INFINITE, null);
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- public void selectionChanged(IAction arg0, ISelection selection) {
- bpmnFile = (IFile) ((IStructuredSelection) selection).getFirstElement();
- }
-
}
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2J.properties
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2J.properties 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2J.properties 2008-09-03 09:53:23 UTC (rev 10040)
@@ -52,7 +52,6 @@
Translate_Error_JpdlProcess_Definition_Null=Errror: The JPDL process definition is null.
Translate_Error_JpdlFile_CanNotGenerate=Errror: Couldn't write process definition xml:
Translate_Error_JpdlFile_CanNotWrite=Errror: Couldn't write process definition to a jpdl file:
-Translate_Error_BpmnFile_CanNotRead=Errror: Couldn't read or parse bpmn file to a DOM document:
-Translate_Error_BpmnDiagramFile_CanNotRead=Couldn't read or parse bpmn_diagram file to a DOM document:
+Translate_Error_File_CanNotRead=Error: Couldn't read or parse {0} file to a DOM document:
Translate_Warning_Bpmn_Element_Name=Warning: The bpmn element's name is null or same to another element's name:
Translate_Warning_Bpmn_Element_Type=Warning: The type of this bpmn element is not translated to corresponding jpdl element:
\ No newline at end of file
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2JMessages.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2JMessages.java 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/messages/B2JMessages.java 2008-09-03 09:53:23 UTC (rev 10040)
@@ -78,8 +78,7 @@
public static String Translate_Error_JpdlFile_CanNotGenerate;
public static String Translate_Error_GpdFile_CanNotGenerate;
public static String Translate_Error_GpdFile_CanNotWrite;
- public static String Translate_Error_BpmnFile_CanNotRead;
- public static String Translate_Error_BpmnDiagramFile_CanNotRead;
+ public static String Translate_Error_File_CanNotRead;
public static String Translate_Warning_Bpmn_Element_Name;
public static String Translate_Warning_Bpmn_Element_Type;
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java 2008-09-03 09:53:23 UTC (rev 10040)
@@ -71,7 +71,7 @@
/*
* translate every gpd document string to a gpd file
*/
- public void translateToFiles() {
+ public void translateToFiles(String fileLocation) {
String[] strForGpdDefs = translateToStrings();
String[] gpdFileNames = new String[gpdDefs.size()];
int i = 0;
@@ -82,7 +82,7 @@
}
try {
- TranslateHelper.createFiles(rootLocation, bpmnFileName,
+ TranslateHelper.createFiles(fileLocation, bpmnFileName,
strForGpdDefs, gpdFileNames,
B2JMessages.Gpd_Definition_Name);
} catch (Exception e) {
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/action/BpmnToAction.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/action/BpmnToAction.java 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/action/BpmnToAction.java 2008-09-03 09:53:23 UTC (rev 10040)
@@ -1,5 +1,149 @@
package org.jboss.tools.bpmnto.action;
-public class BpmnToAction {
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+import org.dom4j.Document;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.dialogs.ListDialog;
+import org.eclipse.ui.dialogs.ListSelectionDialog;
+import org.jboss.tools.b2j.messages.B2JMessages;
+import org.jboss.tools.bpmnto.util.BPMNToUtil;
+
+public abstract class BpmnToAction implements IObjectActionDelegate {
+
+ public IFile bpmnFile;
+
+ public void setActivePart(IAction arg0, IWorkbenchPart part) {
+ // myPart = part;
+ }
+
+ public void run(IAction arg0) {
+ String bpmnFileName = bpmnFile.getName();
+ String bpmnFileParentPath = bpmnFile.getParent().getLocation()
+ .toOSString();
+
+ List<String> list = new ArrayList<String>();
+ List<String> poolIdList = null;
+ try {
+ poolIdList = selectPoolElement(BPMNToUtil
+ .getPoolIDsFromDocument(getDocument(bpmnFileParentPath,
+ bpmnFileName)));
+ } catch (Exception e) {
+ list.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ }
+
+ if (poolIdList.size() == 0) {
+ return;
+ }
+ String location = getGeneratedFileLocation();
+ if (location == null) {
+ location = bpmnFileParentPath;
+ }
+
+ list.addAll(translateBpmn(bpmnFileParentPath, bpmnFileName, poolIdList,
+ location));
+
+ showErrors(list);
+ refreshWorkspace();
+ }
+
+ public abstract List<String> translateBpmn(String bpmnFileParentPath,
+ String bpmnFileName, List<String> poolIdList, String location);
+
+ public void showErrors(List<String> list) {
+ if (list.size() == 0) {
+ return;
+ }
+
+ ListDialog dialog = new ListDialog(Display.getCurrent()
+ .getActiveShell());
+ dialog.setTitle(B2JMessages.Bpmn_Translate_Message_Dialog_Title);
+ dialog.setMessage(B2JMessages.Bpmn_Translate_Message_Dialog_Message);
+
+ dialog.setInput(list);
+ ILabelProvider labelProvider = new LabelProvider();
+ ArrayContentProvider contentProvider = new ArrayContentProvider();
+ dialog.setContentProvider(contentProvider);
+ dialog.setLabelProvider(labelProvider);
+ dialog.open();
+ }
+
+ public String getGeneratedFileLocation() {
+ DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent()
+ .getActiveShell());
+ dialog.setText(B2JMessages.Bpmn_GeneratedFile_Location_Dialog_Title);
+ dialog
+ .setMessage(B2JMessages.Bpmn_GeneratedFile_Location_Dialog_Message);
+ String path = dialog.open();
+ return path;
+ }
+
+ /*
+ * choose some bpmn pool ids from a ids array
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> selectPoolElement(Set<Map.Entry<String, String>> idSet) {
+ Shell shell = Display.getCurrent().getActiveShell();
+ ILabelProvider labelProvider = new LabelProvider();
+ ArrayContentProvider contentProvider = new ArrayContentProvider();
+ ListSelectionDialog dialog = new ListSelectionDialog(shell, idSet,
+ contentProvider, labelProvider, null);
+ dialog.setMessage(B2JMessages.Bpmn_Pool_Choose_Dialog_Message);
+ dialog.setTitle(B2JMessages.Bpmn_Pool_Choose_Dialog_Title);
+ Object[] selected = null;
+ if (dialog.open() == Window.OK) {
+ selected = dialog.getResult();
+ }
+ List<String> list = new LinkedList<String>();
+ if (selected == null) {
+ return list;
+ }
+ for (Object entry : selected) {
+ list.add(((Entry<String, String>) entry).getKey());
+ }
+ return list;
+ }
+
+ public Document getDocument(String bpmnFileParentPath, String bpmnFileName)
+ throws Exception {
+ Document bpmnDocument = null;
+ bpmnDocument = BPMNToUtil.parse(bpmnFileParentPath, bpmnFileName);
+ return bpmnDocument;
+ }
+
+ public void refreshWorkspace() {
+ try {
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
+ IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void selectionChanged(IAction arg0, ISelection selection) {
+ bpmnFile = (IFile) ((IStructuredSelection) selection).getFirstElement();
+ }
+
}
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/dialog/GeneratedFilesLocationDialog.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/dialog/GeneratedFilesLocationDialog.java 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/dialog/GeneratedFilesLocationDialog.java 2008-09-03 09:53:23 UTC (rev 10040)
@@ -1,6 +1,5 @@
package org.jboss.tools.bpmnto.dialog;
-import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.TitleAreaDialog;
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java 2008-09-03 07:52:03 UTC (rev 10039)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java 2008-09-03 09:53:23 UTC (rev 10040)
@@ -19,11 +19,8 @@
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.Map.Entry;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
@@ -31,14 +28,6 @@
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
import org.jboss.tools.b2j.messages.B2JMessages;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
@@ -161,39 +150,4 @@
}
return poolIDMap.entrySet();
}
-
- /*
- * choose some bpmn pool ids from a ids array
- */
- @SuppressWarnings("unchecked")
- public static List<String> selectElement(
- Set<Map.Entry<String, String>> idSet) {
- Shell shell = Display.getCurrent().getActiveShell();
- ILabelProvider labelProvider = new LabelProvider();
- ArrayContentProvider contentProvider = new ArrayContentProvider();
- ListSelectionDialog dialog = new ListSelectionDialog(shell, idSet,
- contentProvider, labelProvider, null);
- dialog.setMessage(B2JMessages.Bpmn_Pool_Choose_Dialog_Message);
- dialog.setTitle(B2JMessages.Bpmn_Pool_Choose_Dialog_Title);
- Object[] selected = null;
- if (dialog.open() == Window.OK) {
- selected = dialog.getResult();
- }
- List<String> list = new LinkedList<String>();
- for (Object entry : selected) {
- list.add(((Entry<String, String>) entry).getKey());
- }
- return list;
- }
-
- public static String getGeneratedFileLocation() {
- DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent()
- .getActiveShell());
- dialog.setText(B2JMessages.Bpmn_GeneratedFile_Location_Dialog_Title);
- dialog
- .setMessage(B2JMessages.Bpmn_GeneratedFile_Location_Dialog_Message);
- String path = dialog.open();
- return path;
- }
-
}
17 years, 7 months
JBoss Tools SVN: r10039 - in trunk/esb/plugins: org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-09-03 03:52:03 -0400 (Wed, 03 Sep 2008)
New Revision: 10039
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboBoxField.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ITaggedFieldEditor.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUIMessages.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBIDE-2384: filter esb runtimes by esb facet version when show available esb runtimes in esb project creation wizard
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-09-02 20:53:46 UTC (rev 10038)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-09-03 07:52:03 UTC (rev 10039)
@@ -40,6 +40,10 @@
facet="jst.jboss.esb">
</fixed>
</template>
+ <project-facet-version
+ facet="jst.jboss.esb"
+ version="4.4">
+ </project-facet-version>
</extension>
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2008-09-02 20:53:46 UTC (rev 10038)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2008-09-03 07:52:03 UTC (rev 10039)
@@ -137,6 +137,19 @@
return null;
}
+ public JBossRuntime[] findRuntimeByVersion(String version) {
+ if(version == null || "".equals(version)){
+ return getRuntimes();
+ }
+ List<JBossRuntime> rts = new ArrayList<JBossRuntime>();
+ for (JBossRuntime jbossWSRuntime : runtimes.values()) {
+ if (jbossWSRuntime.getVersion().equals(version)) {
+ rts.add(jbossWSRuntime);
+ }
+ }
+ return rts.toArray(new JBossRuntime[]{});
+ }
+
public List<String> getAllRuntimeJars(JBossRuntime rt){
List<String> jarList = new ArrayList<String>();
if (rt != null) {
Added: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboBoxField.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboBoxField.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboBoxField.java 2008-09-03 07:52:03 UTC (rev 10039)
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.project.ui.preference.controls;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author eskimo
+ *
+ */
+public class ComboBoxField extends BaseField implements ISelectionChangedListener {
+
+ ComboViewer comboControl = null;
+ List values = new ArrayList();
+
+ public ComboBoxField(Composite parent,List values, ILabelProvider labelProvider,
+ Object value, boolean flatStyle) {
+ this(parent, values, value, flatStyle);
+ comboControl.setLabelProvider(labelProvider);
+ }
+
+ public ComboBoxField(Composite parent,List values, Object value, boolean editable) {
+ this.values = values;
+ /*
+ * Used combo box instead of custom combobox(CCombo),
+ * CCombo looks ugly under MAC OS X
+ */
+ Combo combo;
+ if(editable==true) {
+
+ combo = new Combo(parent, SWT.DROP_DOWN);
+ } else {
+ combo = new Combo(parent, SWT.READ_ONLY);
+ }
+ combo.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ comboControl = new ComboViewer(combo);
+ comboControl.setContentProvider(new IStructuredContentProvider() {
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return ComboBoxField.this.values.toArray();
+ }
+ });
+
+ comboControl.addSelectionChangedListener(this);
+ comboControl.getCombo().addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ firePropertyChange(new Object(), comboControl.getCombo().getText());
+ }});
+ comboControl.setLabelProvider(new ILabelProvider() {
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ public String getText(Object element) {
+ return element.toString();
+ }
+ });
+ comboControl.setInput(values);
+ comboControl.setSelection(new StructuredSelection(value), true);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ firePropertyChange("", ((StructuredSelection)event.getSelection()).getFirstElement()); //$NON-NLS-1$
+ }
+
+ public Combo getComboControl() {
+ return comboControl.getCombo();
+ }
+
+ @Override
+ public Control getControl() {
+ return getComboControl();
+ }
+
+ public void setValue(Object newValue) {
+ comboControl.setSelection(new StructuredSelection(newValue));
+ comboControl.getCombo().setText(newValue.toString());
+ }
+
+ public void setTags(String[] tags,String value) {
+ values = Arrays.asList(tags);
+ comboControl.removeSelectionChangedListener(this);
+ comboControl.refresh(true);
+ comboControl.addPostSelectionChangedListener(this);
+ comboControl.setSelection(new StructuredSelection(value));
+ }
+ /*
+ * We can't modify combo, change style of this object,
+ * if we such functionality please use CCombo
+ *
+ */
+ public void setEditable(
+ boolean ediatble) {
+ //comboControl.getCCombo().setEditable(false);
+ }
+}
\ No newline at end of file
Added: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboFieldEditor.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ComboFieldEditor.java 2008-09-03 07:52:03 UTC (rev 10039)
@@ -0,0 +1,121 @@
+
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.project.ui.preference.controls;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class ComboFieldEditor extends BaseFieldEditor implements ITaggedFieldEditor,PropertyChangeListener{
+
+ List values = null;
+
+ boolean editable = false;
+
+ public ComboFieldEditor(String name, String label, List values,Object defaultValue,boolean editableSelection) {
+ super(name, label, defaultValue);
+ this.values = Collections.unmodifiableList(values);
+ this.editable = editableSelection;
+ }
+
+ private ComboBoxField comboField;
+
+ @Override
+ public Object[] getEditorControls(Object composite) {
+ return new Control[] {getComboControl((Composite)composite)};
+ }
+
+ @Override
+ public void doFillIntoGrid(Object parent) {
+ }
+
+ public Control getComboControl(Composite composite) {
+ if(comboField == null) {
+ comboField = new ComboBoxField(composite,values,getValue(),editable);
+ comboField.addPropertyChangeListener(this);
+ final Combo combo =comboField.getComboControl();
+ combo.addDisposeListener(new DisposeListener(){
+ public void widgetDisposed(DisposeEvent e) {
+ dispose(e);
+ combo.removeDisposeListener(this);
+ }
+ });
+ } else if(composite!=null) {
+ Assert.isTrue(comboField.getControl().getParent()==composite);
+ }
+ return comboField.getControl();
+ }
+
+ @Override
+ public Object[] getEditorControls() {
+ return new Control[]{comboField.getControl()};
+ }
+
+ public void save(Object object) {
+ }
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ setValue(evt.getNewValue());
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#getTags()
+ */
+ public String[] getTags() {
+ return comboField.getComboControl().getItems();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#setTags(java.lang.String[])
+ */
+ public void setTags(String[] tags) {
+ comboField.setTags(tags,getValueAsString());
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.BaseFieldEditor#getNumberOfControls()
+ */
+ @Override
+ public int getNumberOfControls() {
+ return 1;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.CompositeEditor#setEditable(boolean)
+ */
+ @Override
+ public void setEditable(boolean ediatble) {
+ super.setEditable(ediatble);
+ comboField.setEditable(ediatble);
+ }
+
+ public void setValue(Object newValue) {
+ if(newValue==null) {
+ return;
+ }
+ super.setValue(newValue);
+ if(comboField!=null) {
+ comboField.removePropertyChangeListener(this);
+ comboField.setValue(newValue.toString());
+ comboField.addPropertyChangeListener(this);
+ }
+ }
+}
\ No newline at end of file
Added: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ITaggedFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ITaggedFieldEditor.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ITaggedFieldEditor.java 2008-09-03 07:52:03 UTC (rev 10039)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.project.ui.preference.controls;
+
+public interface ITaggedFieldEditor extends IFieldEditor {
+
+ /**
+ *
+ * @return
+ */
+ public String[] getTags();
+
+ /**
+ *
+ * @param tags
+ */
+ public void setTags(String[] tags);
+}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2008-09-02 20:53:46 UTC (rev 10038)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2008-09-03 07:52:03 UTC (rev 10039)
@@ -57,6 +57,10 @@
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.esb.core.ESBProjectUtilities;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
@@ -419,8 +423,8 @@
IFieldEditor name = createTextEditor(SRT_NAME,
JBossESBUIMessages.JBossWS_Runtime_List_Field_Editor_Name2, ""); //$NON-NLS-1$
- IFieldEditor version = createTextEditor(SRT_VERSION,
- JBossESBUIMessages.JBossWS_Runtime_List_Field_Editor_Version, ""); //$NON-NLS-1$
+ IFieldEditor version = createComboEditor(SRT_VERSION,
+ JBossESBUIMessages.JBossWS_Runtime_List_Field_Editor_Version, getESBFacetVersions(), ""); //$NON-NLS-1$
IFieldEditor homeDir = createBrowseFolderEditor(
SRT_HOMEDIR,
@@ -496,6 +500,12 @@
setPageComplete(false);
return;
}
+
+ if(version.getValueAsString() == null || "".equals(version.getValueAsString())){
+ setErrorMessage(JBossESBUIMessages.Error_JBossWS_Runtime_List_Field_Editor_Version_Cannot_Be_Empty);
+ setPageComplete(false);
+ return;
+ }
if (!name.getValueAsString().matches(
"[a-zA-Z_][a-zA-Z0-9_\\-\\. ]*")) { //$NON-NLS-1$
@@ -566,6 +576,15 @@
return true;
}
+ private List<String> getESBFacetVersions(){
+ List<String> versions = new ArrayList<String>();
+ IProjectFacet esbfacet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+ for(IProjectFacetVersion version: esbfacet.getVersions()){
+ versions.add(version.getVersionString());
+ }
+
+ return versions;
+ }
/**
* Return JBossWS Runtime instance initialized by user input
*
@@ -592,6 +611,16 @@
return editor;
}
+ public IFieldEditor createComboEditor(String name, String label,
+ List<String> values, String defaultValue) {
+ CompositeEditor editor = new CompositeEditor(name, label,
+ defaultValue);
+ editor.addFieldEditors(new IFieldEditor[] {
+ new LabelFieldEditor(name, label),
+ new ComboFieldEditor(name, label, values, defaultValue, false) });
+ return editor;
+ }
+
public IFieldEditor createBrowseFolderEditor(String name, String label,
String defaultValue) {
CompositeEditor editor = new CompositeEditor(name, label,
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUI.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUI.properties 2008-09-02 20:53:46 UTC (rev 10038)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUI.properties 2008-09-03 07:52:03 UTC (rev 10039)
@@ -25,6 +25,7 @@
JBossWS_Runtime_List_Field_Editor_Runtime=JBoss ESB Runtime
Error_JBossWS_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct=Runtime name is not correct
Error_JBossWS_Runtime_List_Field_Editor_Name_Cannot_Be_Empty=Name cannot be empty
+Error_JBossWS_Runtime_List_Field_Editor_Version_Cannot_Be_Empty=Version cannot be empty
JBossWS_Runtime_List_Field_Editor_Create_A_Runtime=Create a JBoss ESB Runtime
JBossWS_Runtime_List_Field_Editor_Home_Folder=Home Folder:
JBossWS_Composite_Editor_This_Method_Can_Be_Invoked=This metod can be invoked after getEditorControls(parent) only
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUIMessages.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUIMessages.java 2008-09-02 20:53:46 UTC (rev 10038)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUIMessages.java 2008-09-03 07:52:03 UTC (rev 10039)
@@ -52,6 +52,7 @@
public static String JBossWS_Runtime_List_Field_Editor_Runtime;
public static String Error_JBossWS_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct;
public static String Error_JBossWS_Runtime_List_Field_Editor_Name_Cannot_Be_Empty;
+ public static String Error_JBossWS_Runtime_List_Field_Editor_Version_Cannot_Be_Empty;
public static String JBossWS_Runtime_List_Field_Editor_Create_A_Runtime;
public static String JBossWS_Runtime_List_Field_Editor_Home_Folder;
public static String JBossWS_Composite_Editor_This_Method_Can_Be_Invoked;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-09-02 20:53:46 UTC (rev 10038)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-09-03 07:52:03 UTC (rev 10039)
@@ -25,9 +25,16 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+import org.eclipse.wst.common.project.facet.core.internal.ValidationProblem.Type;
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
import org.jboss.tools.esb.core.ESBProjectUtilities;
@@ -73,8 +80,23 @@
//synchHelper.synchText(configFolder, CONTENT_DIR, null);
Dialog.applyDialogFont(parent);
-
+ // add listener to listen the changes on the project facet
+ final IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
+ fpwc.addListener(new IFacetedProjectListener(){
+
+ public void handleEvent(IFacetedProjectEvent event) {
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+ IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
+ if(version != null){
+ initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
+ }else{
+ initializeRuntimesCombo(cmbRuntimes, null);
+ }
+
+ }
+ }, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
+
return composite;
}
@@ -131,13 +153,16 @@
}
- private JavaFacetInstallConfig findJavaFacetInstallConfig()
- {
+ private IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy(){
ESBProjectWizard wizard = (ESBProjectWizard)this.getWizard();
IDataModel wModel = wizard.getDataModel();
final IFacetedProjectWorkingCopy fpjwc
= (IFacetedProjectWorkingCopy) wModel.getProperty( FACETED_PROJECT_WORKING_COPY );
-
+ return fpjwc;
+ }
+ private JavaFacetInstallConfig findJavaFacetInstallConfig()
+ {
+ final IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
if( fpjwc != null )
{
final IFacetedProject.Action javaInstallAction
@@ -230,18 +255,21 @@
.getActiveShell(), newRtwizard);
if (dialog.open() == WizardDialog.OK) {
initializeRuntimesCombo(cmbRuntimes, null);
- //cmbRuntimes.select(0);
}
}
- protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName) {
+ protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName, String version) {
JBossRuntime selectedJbws = null;
JBossRuntime defaultJbws = null;
int selectIndex = 0;
int defaultIndex = 0;
+
cmRuntime.removeAll();
+ if(runtimeName == null || "".equals(runtimeName)){
+ runtimeName = model.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
+ }
JBossRuntime[] runtimes = JBossRuntimeManager.getInstance()
- .getRuntimes();
+ .findRuntimeByVersion(version);
for (int i = 0; i < runtimes.length; i++) {
JBossRuntime jr = runtimes[i];
cmRuntime.add(jr.getName());
@@ -259,14 +287,33 @@
}
if(selectedJbws != null){
- cmRuntime.select(selectIndex);
- saveJBosswsRuntimeToModel(selectedJbws);
+ cmRuntime.select(selectIndex);
+ saveJBosswsRuntimeToModel(selectedJbws);
}else if(defaultJbws != null){
cmRuntime.select(defaultIndex);
saveJBosswsRuntimeToModel(defaultJbws);
}
}
+
+ protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName) {
+ IProjectFacetVersion version = getSelectedESBVersion();
+ if(version != null){
+ initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
+
+ }else{
+ initializeRuntimesCombo(cmbRuntimes, null, "");
+
+ }
+ }
+ private IProjectFacetVersion getSelectedESBVersion(){
+ IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+
+ return fpwc.getProjectFacetVersion(facet);
+
+ }
+
protected void saveJBosswsRuntimeToModel(JBossRuntime jbws) {
/* String duplicateMsg = "";
try {
17 years, 7 months
JBoss Tools SVN: r10038 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui: jbossui/org/jboss/ide/eclipse/as/ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-09-02 16:53:46 -0400 (Tue, 02 Sep 2008)
New Revision: 10038
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/schema/ServerEditorPortSection.exsd
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-2235 - fixing server editor / port section
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-09-02 18:45:08 UTC (rev 10037)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-09-02 20:53:46 UTC (rev 10038)
@@ -232,7 +232,22 @@
public static String EditorChangeWebCommandName;
public static String EditorChangeUsernameCommandName;
public static String EditorChangePasswordCommandName;
+ public static String EditorCPD_Name;
+ public static String EditorCPD_XPath;
+ public static String EditorCPD_Attribute;
+ public static String EditorCPD_Count;
+ public static String EditorCPD_Value;
+ public static String EditorCPD_Location;
+ public static String EditorCPD_Default;
+ public static String EditorCPD_NoDefault;
+ public static String EditorCPD_SelectionDetails;
+ public static String EditorCPD_DefaultShellTitle;
+ public static String EditorCPD_DefaultDescription;
+
+
+ public static String Customize;
+
// misc
public static String ServerSaveFailed;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-09-02 18:45:08 UTC (rev 10037)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-09-02 20:53:46 UTC (rev 10038)
@@ -205,13 +205,25 @@
EditorChangeStopPollerCommandName=Change Shutdown Poller
EditorServerPorts=Server Ports
EditorServerPortsDescription=The ports entered here are which ports the tools\nwill poll the server on. Changing these fields\nwill not change the ports the server itself listens on.
-EditorJNDIPort=JNDI Port:
-EditorWebPort=Web Port:
+EditorJNDIPort=JNDI Port
+EditorWebPort=Web Port
EditorAutomaticallyDetectPort=Automatically detect
EditorChangeJNDICommandName=Change JNDI Port Details
EditorChangeWebCommandName=Change Web Port Details
EditorChangeUsernameCommandName=Change Username
EditorChangePasswordCommandName=Change Password
+EditorCPD_Name=Name
+EditorCPD_XPath=XPath Pattern
+EditorCPD_Attribute=Attribute Name
+EditorCPD_Count=Number of Matches
+EditorCPD_Value=First Value
+EditorCPD_Location=File of first match
+EditorCPD_Default=The default xpath for {0} is "{1}".
+EditorCPD_NoDefault=There is no default xpath for {0}.
+EditorCPD_SelectionDetails=Selection Details
+EditorCPD_DefaultShellTitle=Edit Port
+EditorCPD_DefaultDescription=This wizard allows you to edit which xpath is used to locate a port used by the tooling.\nThis will not change any server files, only what ports are used to interact with it.
+Customize=Customize...
# misc
ServerSaveFailed=Server save failed
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java 2008-09-02 20:53:46 UTC (rev 10038)
@@ -0,0 +1,244 @@
+package org.jboss.ide.eclipse.as.ui.dialogs;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.ui.Messages;
+
+public class ChangePortDialog extends TitleAreaDialog {
+
+ public static class ChangePortDialogInfo {
+ public String port;
+ public String defaultValue;
+ public String shellTitle;
+ public String description;
+ public IServer server;
+ public String currentXPath;
+ }
+
+ private ChangePortDialogInfo info;
+ private String selected;
+ private XPathQuery currentQuery;
+ private boolean queriesLoaded = false;
+ private List listWidget;
+ private Group group;
+ private Label nameLabel; private Text nameValueLabel;
+ private Label xpathLabel; private Text xpathValueLabel;
+ private Label attributeLabel; private Text attributeValueLabel;
+ private Label locationLabel; private Text locationValueLabel;
+ private Label countLabel; private Text countValueLabel;
+ private Label valueLabel; private Text valueValueLabel;
+
+
+ public ChangePortDialog(Shell parentShell, ChangePortDialogInfo info) {
+ super(parentShell);
+ this.info = info;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite c = (Composite)super.createDialogArea(parent);
+ Composite main = new Composite(c, SWT.BORDER);
+ main.setLayoutData(new GridData(GridData.FILL_BOTH));
+ main.setLayout(new FormLayout());
+ createUI(main);
+ fillWidgets();
+ addListeners();
+ setTitle(info.port);
+ setMessage(info.description != null ? info.description
+ : Messages.EditorCPD_DefaultDescription);
+ getShell().setText(info.shellTitle != null ? info.shellTitle
+ : Messages.EditorCPD_DefaultShellTitle);
+ return c;
+ }
+
+ protected void createUI(Composite main) {
+ listWidget = new List(main, SWT.DEFAULT);
+ FormData d = new FormData();
+ d.top = new FormAttachment(0,5);
+ d.left = new FormAttachment(0,5);
+ d.bottom = new FormAttachment(100,-5);
+ d.right = new FormAttachment(0,150);
+ listWidget.setLayoutData(d);
+
+ Label defaultLabel = new Label(main, SWT.NONE);
+ d = new FormData();
+ d.right = new FormAttachment(100,-5);
+ d.left = new FormAttachment(listWidget,5);
+ d.bottom = new FormAttachment(100,-5);
+ defaultLabel.setLayoutData(d);
+
+ group = new Group(main, SWT.DEFAULT);
+ d = new FormData();
+ d.right = new FormAttachment(100,-5);
+ d.left = new FormAttachment(listWidget,5);
+ d.bottom = new FormAttachment(defaultLabel,-5);
+ d.top = new FormAttachment(0,5);
+ group.setLayoutData(d);
+
+ GridLayout gl = new GridLayout(2, false);
+ gl.marginRight = 5;
+ group.setLayout(gl);
+ GridData common = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
+ nameLabel = new Label(group, SWT.NONE);
+ nameValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
+ xpathLabel = new Label(group, SWT.NONE);
+ xpathValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
+ attributeLabel = new Label(group, SWT.NONE);
+ attributeValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
+ countLabel = new Label(group, SWT.NONE);
+ countValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
+ valueLabel = new Label(group, SWT.NONE);
+ valueValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
+ locationLabel = new Label(group, SWT.NONE);
+ locationValueLabel = new Text(group, SWT.DEFAULT | SWT.H_SCROLL);
+
+ nameValueLabel.setLayoutData(common);
+ xpathValueLabel.setLayoutData(common);
+ attributeValueLabel.setLayoutData(common);
+ countValueLabel.setLayoutData(common);
+ valueValueLabel.setLayoutData(common);
+ locationValueLabel.setLayoutData(common);
+
+ nameLabel.setText(Messages.EditorCPD_Name);
+ xpathLabel.setText(Messages.EditorCPD_XPath);
+ attributeLabel.setText(Messages.EditorCPD_Attribute);
+ countLabel.setText(Messages.EditorCPD_Count);
+ valueLabel.setText(Messages.EditorCPD_Value);
+ locationLabel.setText(Messages.EditorCPD_Location);
+ String defaultLabelText;
+ if( info.defaultValue != null )
+ defaultLabelText = NLS.bind(Messages.EditorCPD_Default, info.port, info.defaultValue);
+ else
+ defaultLabelText = NLS.bind(Messages.EditorCPD_NoDefault, info.port);
+ defaultLabel.setText(defaultLabelText);
+ group.setText(Messages.EditorCPD_SelectionDetails);
+ }
+
+ protected void fillWidgets() {
+ ArrayList<String> list = new ArrayList<String>();
+ XPathCategory[] categories = XPathModel.getDefault().getCategories(info.server);
+ for( int i = 0; i < categories.length; i++ ) {
+ XPathQuery[] queries = categories[i].getQueries();
+ for( int j = 0; j < queries.length; j++ ) {
+ list.add(categories[i].getName() + IPath.SEPARATOR + queries[j].getName());
+ }
+ }
+ String[] stuff = (String[]) list.toArray(new String[list.size()]);
+ listWidget.setItems(stuff);
+ for( int i = 0; i < stuff.length; i++ )
+ if( stuff[i] == info.currentXPath)
+ listWidget.select(i);
+ }
+
+ protected void addListeners() {
+ listWidget.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ selectionChanged();
+ } });
+ }
+
+ protected synchronized void selectionChanged() {
+ if( !queriesLoaded ) {
+ try {
+ final String[] items = listWidget.getItems();
+ ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
+ dialog.run(true, false, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask("Loading...", items.length);
+ for( int i = 0; i < items.length; i++ ) {
+ countMatches(currentQuery);
+ monitor.worked(1);
+ }
+ monitor.done();
+ queriesLoaded = true;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ selectionChanged2();
+ }
+ });
+ } });
+ } catch( InvocationTargetException ite) {
+ ite.printStackTrace();
+ } catch(InterruptedException ie ) {
+ ie.printStackTrace();
+ }
+ } else {
+ selectionChanged2();
+ }
+ }
+
+ private void selectionChanged2() {
+ currentQuery = null;
+ int s = listWidget.getSelectionIndex();
+ if( s != -1 ) {
+ selected = listWidget.getItem(s);
+ currentQuery = XPathModel.getDefault().getQuery(info.server, new Path(selected));
+ }
+ if(currentQuery != null) {
+ nameValueLabel.setText(safeString(currentQuery.getName()));
+ xpathValueLabel.setText(safeString(currentQuery.getXpathPattern()));
+ attributeValueLabel.setText(safeString(currentQuery.getAttribute()));
+ locationValueLabel.setText(safeString(currentQuery.getBaseDir()));
+ countValueLabel.setText(countMatches(currentQuery));
+ valueValueLabel.setText(safeString(currentQuery.getFirstResult()));
+ } else {
+ nameValueLabel.setText(safeString(null));
+ xpathValueLabel.setText(safeString(null));
+ attributeValueLabel.setText(safeString(null));
+ locationValueLabel.setText(safeString(null));
+ countValueLabel.setText(safeString(null));
+ valueValueLabel.setText(safeString(null));
+ }
+ }
+
+ private String countMatches(XPathQuery query) {
+ if( query == null )
+ return new Integer(-1).toString();
+
+ int count = 0;
+ XPathFileResult[] fResults = query.getResults();
+ for( int i = 0; i < fResults.length; i++ ) {
+ count += fResults[i].getChildren().length;
+ }
+ return new Integer(count).toString();
+ }
+ private String safeString(String s) {
+ return s == null ? "" : s;
+ }
+
+ public String getSelection() {
+ return selected;
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2008-09-02 18:45:08 UTC (rev 10037)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2008-09-02 20:53:46 UTC (rev 10038)
@@ -1,19 +1,26 @@
package org.jboss.ide.eclipse.as.ui.editor;
import java.util.ArrayList;
+import java.util.HashMap;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorInput;
@@ -29,7 +36,10 @@
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.dialogs.ChangePortDialog;
+import org.jboss.ide.eclipse.as.ui.dialogs.ChangePortDialog.ChangePortDialogInfo;
/**
*
@@ -37,11 +47,23 @@
*
*/
public class PortSection extends ServerEditorSection {
+
+ /* Load the various port editor pieces */
+ private static ArrayList<IPortEditorExtension> sectionList = new ArrayList<IPortEditorExtension>();
+ static {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerUIPlugin.PLUGIN_ID, "ServerEditorPortSection");
+ for( int i = 0; i < cf.length; i++ ) {
+ try {
+ Object o = cf[i].createExecutableExtension("class");
+ if( o != null && o instanceof IPortEditorExtension)
+ sectionList.add((IPortEditorExtension)o);
+ } catch( CoreException ce) { /* ignore */ }
+ }
+ }
+
+
protected ServerAttributeHelper helper;
- protected Label jndiLabel, webLabel;
- protected Text jndiText, webText;
- protected Button jndiDetect, webDetect;
- protected Combo jndiDetectCombo, webDetectCombo;
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
@@ -51,53 +73,177 @@
public void createSection(Composite parent) {
super.createSection(parent);
createUI(parent);
- initializeState();
- addListeners();
}
+
+ public static interface IPortEditorExtension {
+ public void setServerAttributeHelper(ServerAttributeHelper helper);
+ public void setSection(ServerEditorSection section);
+ public Control createControl(Composite parent);
+ }
- protected void initializeState() {
- boolean detectJNDI = helper.getAttribute(IJBossServerConstants.JNDI_PORT_DETECT, true);
- jndiDetect.setSelection(detectJNDI);
- jndiDetectCombo.setEnabled(detectJNDI);
- jndiText.setEnabled(!detectJNDI);
- jndiText.setEditable(!detectJNDI);
- String jndiXPath = helper.getAttribute(IJBossServerConstants.JNDI_PORT_DETECT_XPATH, IJBossServerConstants.JNDI_PORT_DEFAULT_XPATH.toString());
- int index = jndiDetectCombo.indexOf(jndiXPath);
- if( index != -1 ) {
- jndiDetectCombo.select(index);
- if( detectJNDI )
- jndiText.setText(findPort(new Path(jndiXPath)));
- else
- jndiText.setText(helper.getAttribute(IJBossServerConstants.JNDI_PORT, ""));
+ public static class JNDIPortEditorExtension extends PortEditorExtension {
+ public JNDIPortEditorExtension() {
+ super(Messages.EditorJNDIPort, IJBossServerConstants.JNDI_PORT_DETECT_XPATH,
+ IJBossServerConstants.JNDI_PORT_DETECT,
+ IJBossServerConstants.JNDI_PORT_DEFAULT_XPATH);
}
+ public ServerCommand getCommand() {
+ return new SetPortCommand(helper.getWorkingCopy(), helper, Messages.EditorChangeJNDICommandName,
+ IJBossServerConstants.JNDI_PORT, IJBossServerConstants.JNDI_PORT_DETECT,
+ IJBossServerConstants.JNDI_PORT_DETECT_XPATH, IJBossServerConstants.JNDI_PORT_DEFAULT_XPATH,
+ text, detect, currentXPath, listener);
+ }
+ protected ChangePortDialogInfo getDialogInfo() {
+ ChangePortDialogInfo info = new ChangePortDialogInfo();
+ info.port = Messages.EditorJNDIPort;
+ info.defaultValue = IJBossServerConstants.JNDI_PORT_DEFAULT_XPATH;
+ info.server = helper.getWorkingCopy().getOriginal();
+ info.currentXPath = currentXPath;
+ return info;
+ }
+ }
+
+ public static class WebPortEditorExtension extends PortEditorExtension {
+ public WebPortEditorExtension() {
+ super(Messages.EditorWebPort, IJBossServerConstants.WEB_PORT_DETECT_XPATH,
+ IJBossServerConstants.WEB_PORT_DETECT,
+ IJBossServerConstants.WEB_PORT_DEFAULT_XPATH);
+ }
+
+ public ServerCommand getCommand() {
+ return new SetPortCommand(helper.getWorkingCopy(), helper, Messages.EditorChangeWebCommandName,
+ IJBossServerConstants.WEB_PORT, IJBossServerConstants.WEB_PORT_DETECT,
+ IJBossServerConstants.WEB_PORT_DETECT_XPATH, IJBossServerConstants.WEB_PORT_DEFAULT_XPATH,
+ text, detect, currentXPath, listener);
+ }
+ protected ChangePortDialogInfo getDialogInfo() {
+ ChangePortDialogInfo info = new ChangePortDialogInfo();
+ info.port = Messages.EditorWebPort;
+ info.defaultValue = IJBossServerConstants.WEB_PORT_DEFAULT_XPATH;
+ info.server = helper.getWorkingCopy().getOriginal();
+ info.currentXPath = currentXPath;
+ return info;
+ }
+ }
+
+ public static abstract class PortEditorExtension implements IPortEditorExtension {
+ protected Button detect;
+ protected Text text;
+ protected Label label;
+ protected Link link;
+ protected String labelText, currentXPathKey, detectXPathKey, defaultXPath;
+ protected String currentXPath;
+ protected ServerAttributeHelper helper;
+ protected Listener listener;
+ protected ServerEditorSection section;
+ public PortEditorExtension(String labelText, String currentXPathKey, String detectXPathKey, String defaultXPath) {
+ this.labelText = labelText;
+ this.currentXPathKey = currentXPathKey;
+ this.detectXPathKey = detectXPathKey;
+ this.defaultXPath = defaultXPath;
+ }
+ public void setServerAttributeHelper(ServerAttributeHelper helper) {
+ this.helper = helper;
+ }
+ public void setSection(ServerEditorSection section) {
+ this.section = section;
+ }
+ public Control createControl(Composite parent) {
+ Control c = createUI(parent);
+ initialize();
+ addListeners();
+ return c;
+ }
- boolean detectWeb = helper.getAttribute(IJBossServerConstants.WEB_PORT_DETECT, true);
- webDetect.setSelection(detectWeb);
- webDetectCombo.setEnabled(detectWeb);
- webText.setEnabled(!detectWeb);
- webText.setEditable(!detectWeb);
- String webXPath = helper.getAttribute(IJBossServerConstants.WEB_PORT_DETECT_XPATH, IJBossServerConstants.WEB_PORT_DEFAULT_XPATH.toString());
- int index2 = webDetectCombo.indexOf(webXPath);
- if( index2 != -1 ) {
- webDetectCombo.select(index2);
- if( detectWeb )
- webText.setText(findPort(new Path(webXPath)));
+ protected Control createUI(Composite parent) {
+ Composite child = new Composite(parent, SWT.NONE);
+ child.setLayout(new FormLayout());
+ label = new Label(child, SWT.NONE);
+ text = new Text(child, SWT.DEFAULT);
+ detect = new Button(child, SWT.CHECK);
+ link = new Link(child, SWT.DEFAULT);
+
+ FormData data;
+ data = new FormData();
+ data.top = new FormAttachment(0,8);
+ data.right = new FormAttachment(100,-5);
+ link.setLayoutData(data);
+
+ data = new FormData();
+ data.right = new FormAttachment(link, -5);
+ data.top = new FormAttachment(0,5);
+ detect.setLayoutData(data);
+
+ data = new FormData();
+ data.left = new FormAttachment(detect, -200);
+ data.right = new FormAttachment(detect, -5);
+ data.top = new FormAttachment(0,5);
+ text.setLayoutData(data);
+
+ data = new FormData();
+ data.right = new FormAttachment(text,-5);
+ data.top = new FormAttachment(0,8);
+ label.setLayoutData(data);
+
+ label.setText(labelText);
+ detect.setText(Messages.EditorAutomaticallyDetectPort);
+ link.setText("<a href=\"\">" + Messages.Customize + "</a>");
+ return child;
+ }
+ protected void initialize() {
+ boolean shouldDetect = helper.getAttribute(detectXPathKey, true);
+ detect.setSelection(shouldDetect);
+ text.setEnabled(!shouldDetect);
+ text.setEditable(!shouldDetect);
+ currentXPath = helper.getAttribute(currentXPathKey, defaultXPath);
+ if( shouldDetect )
+ text.setText(findPort(new Path(currentXPath)));
else
- webText.setText(helper.getAttribute(IJBossServerConstants.WEB_PORT, ""));
+ text.setText(helper.getAttribute(IJBossServerConstants.JNDI_PORT, ""));
}
- }
-
- protected String findPort(IPath path) {
- XPathQuery query = XPathModel.getDefault().getQuery(server.getOriginal(), path);
- if(query!=null) {
- String result = query.getFirstResult();
- if( result != null ) {
- return result;
+ protected void addListeners() {
+ listener = new Listener() {
+ public void handleEvent(Event event) {
+ section.execute(getCommand());
+ }
+ };
+ text.addListener(SWT.Modify, listener);
+ detect.addListener(SWT.Selection, listener);
+ link.addListener(SWT.Selection, createLinkListener());
+ }
+
+ protected Listener createLinkListener() {
+ return new Listener() {
+ public void handleEvent(Event event) {
+ ChangePortDialog dialog = getDialog();
+ int result = dialog.open();
+ if( result == Dialog.OK) {
+ currentXPath = dialog.getSelection();
+ section.execute(getCommand());
+ text.setFocus();
+ }
+ }
+ };
+ }
+ public ChangePortDialog getDialog() {
+ return new ChangePortDialog(section.getShell(), getDialogInfo());
+ }
+ protected abstract ChangePortDialogInfo getDialogInfo();
+
+ protected String findPort(IPath path) {
+ XPathQuery query = XPathModel.getDefault().getQuery(helper.getServer(), path);
+ if(query!=null) {
+ String result = query.getFirstResult();
+ if( result != null ) {
+ return result;
+ }
}
+ return "-1";
}
- return "-1";
-}
-
+ protected /* abstract */ ServerCommand getCommand() {
+ return null;
+ }
+ }
protected void createUI(Composite parent) {
@@ -110,96 +256,44 @@
composite.setLayout(new FormLayout());
Label description = new Label(composite, SWT.NONE);
description.setText(Messages.EditorServerPortsDescription);
-
- Composite jndiChild = createJNDIUI(composite);
- Composite webChild = createWebUI(composite);
-
FormData data = new FormData();
data.top = new FormAttachment(0,5);
+ data.left = new FormAttachment(0,5);
description.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(description, 5);
- jndiChild.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(jndiChild, 5);
- webChild.setLayoutData(data);
+ addUIAdditions(composite, description);
toolkit.paintBordersFor(composite);
section.setClient(composite);
}
- protected Composite createJNDIUI(Composite composite) {
- Composite child = new Composite(composite, SWT.NONE);
- child.setLayout(new FormLayout());
- jndiLabel = new Label(child, SWT.NONE);
- jndiText = new Text(child, SWT.DEFAULT);
- jndiDetect = new Button(child, SWT.CHECK);
- jndiDetectCombo = new Combo(child, SWT.DEFAULT);
+ private void addUIAdditions(Composite parent, Control top) {
+ IPortEditorExtension[] extensions = (IPortEditorExtension[]) sectionList.toArray(new IPortEditorExtension[sectionList.size()]);
- FormData data = new FormData();
- data.left = new FormAttachment(0,5);
- data.top = new FormAttachment(0,5);
- jndiLabel.setLayoutData(data);
-
+ FormData data;
+ Control c;
+ Composite wrapper = new Composite(parent, SWT.NONE);
+ wrapper.setLayout(new FormLayout());
data = new FormData();
- data.left = new FormAttachment(jndiLabel,5);
- data.right = new FormAttachment(jndiLabel, 150);
- data.top = new FormAttachment(0,5);
- jndiText.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(jndiText,5);
- data.top = new FormAttachment(0,5);
- jndiDetect.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(jndiDetect,5);
- data.top = new FormAttachment(0,5);
- jndiDetectCombo.setLayoutData(data);
-
- jndiLabel.setText(Messages.EditorJNDIPort);
- jndiDetect.setText(Messages.EditorAutomaticallyDetectPort);
- jndiDetectCombo.setItems(getXPathStrings());
- return child;
+ data.top = new FormAttachment(top,0);
+ data.left = new FormAttachment(0,0);
+ wrapper.setLayoutData(data);
+ top = null;
+ for( int i = 0; i < extensions.length; i++ ) {
+ extensions[i].setServerAttributeHelper(helper);
+ extensions[i].setSection(this);
+ c = extensions[i].createControl(wrapper);
+ data = new FormData();
+ if( top == null )
+ data.top = new FormAttachment(0, 5);
+ else
+ data.top = new FormAttachment(top, 5);
+ data.left = new FormAttachment(0,5);
+ data.right = new FormAttachment(100,-5);
+ c.setLayoutData(data);
+ top = c;
+ }
}
- protected Composite createWebUI(Composite composite) {
- Composite child = new Composite(composite, SWT.NONE);
- child.setLayout(new FormLayout());
- webLabel = new Label(child, SWT.NONE);
- webText = new Text(child, SWT.DEFAULT);
- webDetect = new Button(child, SWT.CHECK);
- webDetectCombo = new Combo(child, SWT.DEFAULT);
-
- FormData data = new FormData();
- data.left = new FormAttachment(0,5);
- data.top = new FormAttachment(0,5);
- webLabel.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(webLabel,5);
- data.right = new FormAttachment(webLabel, 150);
- data.top = new FormAttachment(0,5);
- webText.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(webText,5);
- data.top = new FormAttachment(0,5);
- webDetect.setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(webDetect,5);
- data.top = new FormAttachment(0,5);
- webDetectCombo.setLayoutData(data);
-
- webLabel.setText(Messages.EditorWebPort);
- webDetect.setText(Messages.EditorAutomaticallyDetectPort);
- webDetectCombo.setItems(getXPathStrings());
- return child;
- }
-
protected String[] getXPathStrings() {
ArrayList<String> list = new ArrayList<String>();
XPathCategory[] categories = XPathModel.getDefault().getCategories(server.getOriginal());
@@ -212,84 +306,45 @@
return (String[]) list.toArray(new String[list.size()]);
}
- protected Listener jndiListener, webListener;
-
- protected void addListeners() {
- jndiListener = new Listener() {
- public void handleEvent(Event event) {
- execute(new ChangeJNDICommand(server));
- }
- };
- jndiText.addListener(SWT.Modify, jndiListener);
- jndiDetect.addListener(SWT.Selection, jndiListener);
- jndiDetectCombo.addListener(SWT.Modify, jndiListener);
-
- webListener = new Listener() {
- public void handleEvent(Event event) {
- execute(new ChangeWebCommand(server));
- }
- };
- webText.addListener(SWT.Modify, webListener);
- webDetect.addListener(SWT.Selection, webListener);
- webDetectCombo.addListener(SWT.Modify, webListener);
-
- }
-
- public class ChangeJNDICommand extends SetPortCommand {
- public ChangeJNDICommand(IServerWorkingCopy server) {
- super(server, Messages.EditorChangeJNDICommandName,
- IJBossServerConstants.JNDI_PORT, IJBossServerConstants.JNDI_PORT_DETECT,
- IJBossServerConstants.JNDI_PORT_DETECT_XPATH, IJBossServerConstants.JNDI_PORT_DEFAULT_XPATH,
- jndiText, jndiDetect, jndiDetectCombo, jndiListener);
- }
- }
-
- public class ChangeWebCommand extends SetPortCommand {
- public ChangeWebCommand(IServerWorkingCopy server) {
- super(server, Messages.EditorChangeWebCommandName,
- IJBossServerConstants.WEB_PORT, IJBossServerConstants.WEB_PORT_DETECT,
- IJBossServerConstants.WEB_PORT_DETECT_XPATH, IJBossServerConstants.WEB_PORT_DEFAULT_XPATH,
- webText, webDetect, webDetectCombo, webListener);
- }
- }
-
-
- public class SetPortCommand extends ServerCommand {
+ public static class SetPortCommand extends ServerCommand {
+ ServerAttributeHelper helper;
String textAttribute, overrideAttribute, overridePathAttribute;
String preText, prePath, defaultPath;
boolean preOverride;
Text text;
Button button;
- Combo combo;
Listener listener;
- public SetPortCommand(IServerWorkingCopy server, String name,
+ String xpath;
+ public SetPortCommand(IServerWorkingCopy server, ServerAttributeHelper helper, String name,
String textAttribute, String overrideAttribute, String overridePathAttribute,
- String pathDefault, Text text, Button button, Combo xpath, Listener listener) {
+ String pathDefault, Text text, Button button, String xpath, Listener listener) {
super(server, name);
+ this.helper = helper;
this.textAttribute = textAttribute;
this.overrideAttribute = overrideAttribute;
this.overridePathAttribute = overridePathAttribute;
this.defaultPath = pathDefault;
this.text = text;
this.button = button;
- this.combo = xpath;
this.listener = listener;
+ this.xpath = xpath;
}
public void execute() {
preText = helper.getAttribute(textAttribute, (String)null);
+ if( preText == null )
+ preText = findPort(new Path(defaultPath));
prePath = helper.getAttribute(overridePathAttribute, (String)defaultPath);
- preOverride = helper.getAttribute(overrideAttribute, false);
+ preOverride = helper.getAttribute(overrideAttribute, true);
helper.setAttribute(textAttribute, text.getText());
helper.setAttribute(overrideAttribute, button.getSelection());
- helper.setAttribute(overridePathAttribute, combo.getText());
+ helper.setAttribute(overridePathAttribute, xpath);
text.setEnabled(!button.getSelection());
text.setEditable(!button.getSelection());
- combo.setEnabled(button.getSelection());
if( button.getSelection() ) {
text.removeListener(SWT.Modify, listener);
- text.setText(findPort(new Path(combo.getText())));
+ text.setText(findPort(new Path(xpath)));
text.addListener(SWT.Modify, listener);
}
}
@@ -301,26 +356,27 @@
helper.setAttribute(overridePathAttribute, prePath);
// update ui
- combo.removeListener(SWT.Modify, listener);
text.removeListener(SWT.Modify, listener);
button.removeListener(SWT.Selection, listener);
button.setSelection(preOverride);
text.setText(preText == null ? "" : preText);
- int ind = combo.indexOf(prePath);
- if( ind == -1 )
- combo.clearSelection();
- else
- combo.select(ind);
-
text.setEnabled(!preOverride);
text.setEditable(!preOverride);
- combo.setEnabled(preOverride);
-
- combo.addListener(SWT.Modify, listener);
button.addListener(SWT.Selection, listener);
text.addListener(SWT.Modify, listener);
}
+
+ protected String findPort(IPath path) {
+ XPathQuery query = XPathModel.getDefault().getQuery(helper.getServer(), path);
+ if(query!=null) {
+ String result = query.getFirstResult();
+ if( result != null ) {
+ return result;
+ }
+ }
+ return "-1";
+ }
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-09-02 18:45:08 UTC (rev 10037)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-09-02 20:53:46 UTC (rev 10038)
@@ -4,6 +4,7 @@
<extension-point id="ServerViewExtension" name="org.jboss.ide.eclipse.as.ui.serverViewExtension" schema="schema/ServerViewExtension.exsd"/>
<extension-point id="EventLogLabelProvider" name="org.jboss.ide.as.ui.eventLogLabelProvider" schema="schema/EventLogLabelProvider.exsd"/>
<extension-point id="EventLogMajorType" name="org.jboss.ide.eclipse.as.ui.eventLogMajorType" schema="schema/EventLogMajorType.exsd"/>
+ <extension-point id="ServerEditorPortSection" name="org.jboss.ide.as.ui.editor.portSection" schema="schema/ServerEditorPortSection.exsd"/>
<extension
point="org.eclipse.wst.server.ui.serverImages">
@@ -339,6 +340,15 @@
</action>
</actionSet>
</extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.ui.ServerEditorPortSection">
+ <section
+ class="org.jboss.ide.eclipse.as.ui.editor.PortSection$JNDIPortEditorExtension">
+ </section>
+ <section
+ class="org.jboss.ide.eclipse.as.ui.editor.PortSection$WebPortEditorExtension">
+ </section>
+ </extension>
</plugin>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/schema/ServerEditorPortSection.exsd
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/schema/ServerEditorPortSection.exsd (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/schema/ServerEditorPortSection.exsd 2008-09-02 20:53:46 UTC (rev 10038)
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.ide.eclipse.as.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.ide.eclipse.as.ui" id="ServerEditorPortSection" name="org.jboss.ide.as.ui.editor.portSection"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="section"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="section">
+ <complexType>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.as.ui.editor.PortSection$IPortEditorExtension"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
17 years, 7 months
JBoss Tools SVN: r10037 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-09-02 14:45:08 -0400 (Tue, 02 Sep 2008)
New Revision: 10037
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
Log:
JBIDE-2697 - Stopping servers is buggy. a "for now" fix which works.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2008-09-02 17:43:03 UTC (rev 10036)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2008-09-02 18:45:08 UTC (rev 10037)
@@ -26,6 +26,8 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerListener;
+import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
@@ -129,20 +131,44 @@
/*
* Change the state of the server
+ * Also, cache the state we think we're setting it to.
+ *
+ * Much of this can be changed once eclipse bug 231956 is fixed
*/
+ protected int serverStateVal;
+ protected int getServerStateVal() {
+ return serverStateVal;
+ }
public void setServerStarted() {
+ serverStateVal = IServer.STATE_STARTED;
setServerState(IServer.STATE_STARTED);
}
public void setServerStarting() {
+ serverStateVal = IServer.STATE_STARTING;
setServerState(IServer.STATE_STARTING);
}
public void setServerStopped() {
+ serverStateVal = IServer.STATE_STOPPED;
setServerState(IServer.STATE_STOPPED);
}
public void setServerStopping() {
+ serverStateVal = IServer.STATE_STOPPING;
setServerState(IServer.STATE_STOPPING);
}
+ protected void initialize(IProgressMonitor monitor) {
+ serverStateVal = getServer().getServerState();
+ getServer().addServerListener(new IServerListener() {
+ public void serverChanged(ServerEvent event) {
+ if( event.getState() != serverStateVal ) {
+ // something's been changed by the framework and NOT by us.
+ if( serverStateVal == IServer.STATE_STARTING && event.getState() == IServer.STATE_STOPPED) {
+ stop(true);
+ }
+ }
+ }
+ } );
+ }
}
17 years, 7 months
JBoss Tools SVN: r10036 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core/publishers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-09-02 13:43:03 -0400 (Tue, 02 Sep 2008)
New Revision: 10036
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-2717 - committing denny's patch
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2008-09-02 16:14:44 UTC (rev 10035)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2008-09-02 17:43:03 UTC (rev 10036)
@@ -200,7 +200,9 @@
root = root.append("WEB-INF").append("lib").append(name + ".jar");
else if( "jst.connector".equals(type)) {
root = root.append(name + ".rar");
- } else
+ } else if( "jst.jboss.esb".equals(type)){
+ root = root.append(name + ".esb");
+ }else
root = root.append(name + ".jar");
}
return root;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2008-09-02 16:14:44 UTC (rev 10035)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2008-09-02 17:43:03 UTC (rev 10036)
@@ -148,7 +148,11 @@
versions="1.0"/>
<moduleType
types="jboss.singlefile"
- versions="1.0"/>
+ versions="1.0"/>
+ <moduleType
+ types="jst.jboss.esb"
+ versions="4.2,4.3,4.4,5.0">
+ </moduleType>
</runtimeType>
<runtimeType
vendor="%providerName"
@@ -178,6 +182,10 @@
<moduleType
types="jboss.singlefile"
versions="1.0"/>
+ <moduleType
+ types="jst.jboss.esb"
+ versions="4.2,4.3,4.4,5.0">
+ </moduleType>
</runtimeType>
<runtimeType
vendor="%providerName"
@@ -207,6 +215,10 @@
<moduleType
types="jboss.singlefile"
versions="1.0"/>
+ <moduleType
+ types="jst.jboss.esb"
+ versions="4.2,4.3,4.4,5.0">
+ </moduleType>
</runtimeType>
@@ -239,6 +251,10 @@
<moduleType
types="jboss.singlefile"
versions="1.0"/>
+ <moduleType
+ types="jst.jboss.esb"
+ versions="4.2,4.3,4.4,5.0">
+ </moduleType>
</runtimeType>
</extension>
17 years, 7 months
JBoss Tools SVN: r10035 - trunk/ws/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-09-02 12:14:44 -0400 (Tue, 02 Sep 2008)
New Revision: 10035
Modified:
trunk/ws/docs/reference/en/modules/preference.xml
Log:
content revised
Modified: trunk/ws/docs/reference/en/modules/preference.xml
===================================================================
--- trunk/ws/docs/reference/en/modules/preference.xml 2008-09-02 15:32:58 UTC (rev 10034)
+++ trunk/ws/docs/reference/en/modules/preference.xml 2008-09-02 16:14:44 UTC (rev 10035)
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<chapter id="preference" revisionflag="added">
+<chapter id="preference" revisionflag="added">
<title>JBoss WS and development environment</title>
<section id="jbosswspreference">
<title>JBossWS Preferences</title>
-<para>In this section you get to know how JBossWS preferences can be modified during the development process.</para>
+<para>In this section you will know how JBossWS preferences can be modified during the development process.</para>
- <para>JBossWS preferences can be set using the JBossWS preference page. Click on <emphasis><property>Window > Preferences > JBoss Tools > Web > JBossWS Preference</property>.</emphasis></para>
+ <para>JBossWS preferences can be set on the JBossWS preference page. Click on <emphasis><property>Window > Preferences > JBoss Tools > Web > JBossWS Preferences</property>.</emphasis></para>
<para>On this page you can manage the JBossWS Runtime. Use the appropriate buttons to <property>Add</property> more runtimes or to <property>Remove</property> those that are not needed.</para>
@@ -19,8 +19,8 @@
</mediaobject>
</figure>
- <para>Clicking on <emphasis><property>Add</property></emphasis> or <emphasis><property>Edit</property></emphasis> button you will get the form where you can configure a new JbossWS runtime and change the path of JBossWS runtime home folder,
- modify name and version of a existing JBossWS runtime settings. Press <property>Finish</property> to apply the changes.</para>
+ <para>Clicking on <emphasis><property>Add</property></emphasis> or <emphasis><property>Edit</property></emphasis> button will open the form where you can configure a new JbossWS runtime and change the path to JBossWS runtime home folder,
+ modify the name and version of the existing JBossWS runtime settings. Press <property>Finish</property> to apply the changes.</para>
<figure>
<title>Edit JBossWS Runtime</title>
@@ -29,21 +29,21 @@
<imagedata fileref="images/Jbossws_preference_new.png"/>
</imageobject>
</mediaobject>
- </figure>
- </section>
- <section id="serverruntime">
- <title>Default Server and Runtime</title>
- <para>Open
- <emphasis><property>Window > Preferences > Web Services > Server and Runtime</property></emphasis>. In this page, you can set default server and runtime.</para>
- <para>For ease of use, the better way is to set runtime = JBoss WS.</para>
- <para>After set server and runtime, click <property>Aplly</property> button to save the value.</para>
- <figure>
- <title></title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_server_runtime.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ </figure>
</section>
+ <section id="serverruntime">
+ <title>Default Server and Runtime</title>
+ <para>Open
+ <emphasis><property>Window > Preferences > Web Services > Server and Runtime</property></emphasis>. On this page, you can specify a default server and runtime.</para>
+ <para>For ease of use, the better way is to set runtime to JBoss WS.</para>
+ <para>After server and runtime are specified, click on the <property>Aply</property> button to save the values.</para>
+ <figure>
+ <title></title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_server_runtime.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
</chapter>
17 years, 7 months
JBoss Tools SVN: r10034 - in trunk: flow/plugins/org.jboss.tools.flow.common and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-09-02 11:32:58 -0400 (Tue, 02 Sep 2008)
New Revision: 10034
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.webtools/
trunk/flow/plugins/org.jboss.tools.flow.common/
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/
Log:
svn ignore bin
Property changes on: trunk/core/plugins/org.jboss.ide.eclipse.archives.webtools
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/flow/plugins/org.jboss.tools.flow.common
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4
___________________________________________________________________
Name: svn:ignore
+ bin
17 years, 7 months
JBoss Tools SVN: r10033 - trunk/ws/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-09-02 10:36:22 -0400 (Tue, 02 Sep 2008)
New Revision: 10033
Modified:
trunk/ws/docs/reference/en/modules/topdown.xml
Log:
content revised
Modified: trunk/ws/docs/reference/en/modules/topdown.xml
===================================================================
--- trunk/ws/docs/reference/en/modules/topdown.xml 2008-09-02 14:35:53 UTC (rev 10032)
+++ trunk/ws/docs/reference/en/modules/topdown.xml 2008-09-02 14:36:22 UTC (rev 10033)
@@ -201,7 +201,7 @@
</figure>
</listitem>
<listitem>
- <para>On the first Web Service wizard page: select <property>Bottom up Java bean Web service</property> as your Web service type, and select the Java bean from which the service will be created.</para>
+ <para>On the first Web Service wizard page: select <property>Bottom up Java bean Web service</property> as your Web service type, and select the Java bean from which the service will be created:</para>
<figure>
<title>Set Web Service Common values</title>
<mediaobject>
@@ -215,7 +215,7 @@
<para>Select the stages of Web service development that you want to complete using the slider: </para>
<itemizedlist>
<listitem>
- <para>Develop: this will develop the WSDL definition and implementation of the Web service. This includes such tasks as creating the modules which will contain the generated code, WSDL files, deployment descriptors, and Java files when appropriate.</para>>
+ <para>Develop: this will develop the WSDL definition and implementation of the Web service. This includes such tasks as creating modules that will contain generated code, WSDL files, deployment descriptors, and Java files when appropriate.</para>>
</listitem>
<listitem>
<para>Assemble: this ensures the project that will host the Web service or client gets associated to an EAR when required by the target application server.</para>>
@@ -230,21 +230,21 @@
<para>Start: this will start the server once the service has been installed on it. The server-config.wsdd file will be generated.</para>>
</listitem>
<listitem>
- <para>Test: this will provide various options for testing the service, such as using the Web Service Explorer or sample JSPs</para>>
+ <para>Test: this will provide various options for testing the service, such as using the Web Service Explorer or sample JSPs.</para>>
</listitem>
</itemizedlist>
</listitem>
<listitem>Select your server: the default server is displayed. If you want to deploy your service to a different server click the link to specify a different server.</listitem>
<listitem>Select your runtime: ensure the JBoss WS runtime is selected.</listitem>
<listitem>Select the service project: the project selected in your workspace is displayed. To select a different project click on the project link. If you are deploying to JBoss Application Server you will also be asked to select the EAR associated with the project. Ensure that the project selected as the Client Web Project is different from the Service Web Project, or the service will be overwritten by the client's generated artifacts.</listitem>
- <listitem>If you want to create a client, select the type of proxy to be generated and repeat the above steps for the client. The better way is to create a web service client project seperately.</listitem>
+ <listitem>If you want to create a client, select the type of proxy to be generated and repeat the above steps for the client. The better way is to create a web service client project separately.</listitem>
</itemizedlist>
- <para>Click <property>Next</property> button.</para>
+ <para>Click on the <property>Next</property> button.</para>
</listitem>
<listitem>
- <para>In the JBoss Web Service Code Generation Configuration page, you set values:</para>
+ <para>On the JBoss Web Service Code Generation Configuration page, set the following values:</para>
<figure>
- <title>Set Web Service values about Code Generation</title>
+ <title>Set Web Service values for Code Generation</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/jbossws_bottomup_3.png"></imagedata>
@@ -253,16 +253,16 @@
</figure>
<itemizedlist>
<listitem>
- <para>Generate WSDL file: select it, you will get a generated WSDL file in your project. But this wsdl's services' address location values are not real address. </para>
+ <para>Generate WSDL file: select it, you will get a generated WSDL file in your project. But this wsdl's services' address location values are not a real address. </para>
</listitem>
- <listitem>After the Web service has been created, the following may occur depending on the options you selected:
- <para>Update the default web.xml: select it, you may test the web service by Explorer.</para>
+ <listitem>After the Web service has been created, the following option can become available depending on the options you selected:
+ <para>Update the default web.xm file: if selected, you may test the web service by Explorer.</para>
</listitem>
</itemizedlist>
- <para>Click <property>Next</property> button.</para>
+ <para>Click on the <property>Next</property> button.</para>
</listitem>
<listitem>
- <para>In this page, the project is deployed to the server. you can start server and test the web service. If you want to publish the web service to a UDDI registry, you may click <property>Next</property> button to publish it. If not, you may click <property>Finish</property> button.</para>
+ <para>On this page, the project is deployed to the server. You can start the server and test the web service. If you want to publish the web service to a UDDI registry, you may click the <property>Next</property> button to publish it. If not, you may click the <property>Finish</property> button.</para>
<figure>
<title>Start a Server</title>
<mediaobject>
@@ -273,29 +273,29 @@
</figure>
</listitem>
</itemizedlist>
- <para>After the Web Service has been created, the following may occur depending on the options you selected:</para>
+ <para>After the Web Service has been created, the following options may become available depending on the options selected:</para>
<itemizedlist>
<listitem>
- <para> the generated web services codes</para>
+ <para>the generated web services code</para>
</listitem>
<listitem>
- <para>If have selected to generate WSDL file, you will get the file in your project's WebContent > wsdl folder.</para>
+ <para>If you selected to generate a WSDL file, you will get the file in your project's WebContent > wsdl folder.</para>
<figure>
<title>The generated WSDL file</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/jbossws_bottomup_6.png"></imagedata>
+ <imagedata scale="80" fileref="images/jbossws_bottomup_6.png"></imagedata>
</imageobject>
</mediaobject>
</figure>
</listitem>
<listitem>
- <para>If have selected to update the default web.xml, you will test the web service in browser.Open the Explorer, input the url for the web service according to web.xml plus <property>?wsdl.</property>, you will get the WSDL file from Explorer. </para>
+ <para>If you selected to update the default web.xml, you will test the web service in the browser. Open the Explorer, input the url for the web service according to web.xml plus <property>?wsdl.</property>, you will get the WSDL file from Explorer. </para>
<figure>
- <title>The Updated web.xml</title>
+ <title>The Updated web.xml file</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/jbossws_bottomup_5.png"></imagedata>
+ <imagedata scale="80" fileref="images/jbossws_bottomup_5.png"></imagedata>
</imageobject>
</mediaobject>
</figure>
17 years, 7 months