JBoss Tools SVN: r13179 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui: jbossui/org/jboss/tools/as/wst/server/ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-01-22 03:00:42 -0500 (Thu, 22 Jan 2009)
New Revision: 13179
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersDropAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersViewDropAdapterAssistant.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-3608 - add DND support to CNF servers view
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersDropAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersDropAdapter.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersDropAdapter.java 2009-01-22 08:00:42 UTC (rev 13179)
@@ -0,0 +1,325 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - initial API and implementation
+ * ken.ryall(a)nokia.com - 157506 drop from external sources does not work on Linux/Mac
+ *******************************************************************************/
+package org.jboss.tools.as.wst.server.ui;
+
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.ui.internal.navigator.NavigatorPlugin;
+import org.eclipse.ui.internal.navigator.dnd.CommonDropAdapterDescriptor;
+import org.eclipse.ui.internal.navigator.dnd.CommonDropDescriptorManager;
+import org.eclipse.ui.internal.navigator.dnd.NavigatorPluginDropAction;
+import org.eclipse.ui.navigator.CommonDragAdapter;
+import org.eclipse.ui.navigator.CommonDragAdapterAssistant;
+import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.INavigatorContentService;
+import org.eclipse.ui.navigator.INavigatorDnDService;
+import org.eclipse.ui.part.PluginDropAdapter;
+import org.eclipse.ui.part.PluginTransfer;
+
+/*
+ * THIS CLASS IS A CLONE of CommonDropAdapter.
+ * It is necessary because dragged items must be acceptable children.
+ * Stupid restriction
+ *
+ * I use a delegate and push all methods to the delegate,
+ * even the ones I override.
+ *
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=261606
+ *
+ * Maybe one day they'll fix that ;)
+ */
+
+/**
+ * Provides an implementation of {@link PluginDropAdapter} which uses the
+ * extensions provided by the associated {@link INavigatorContentService}.
+ *
+ * <p>
+ * Clients should not need to create an instance of this class unless they are
+ * creating their own custom viewer. Otherwise, {@link CommonViewer} configures
+ * its drop adapter automatically.
+ * </p>
+ *
+ *
+ * @see INavigatorDnDService
+ * @see CommonDragAdapter
+ * @see CommonDragAdapterAssistant
+ * @see CommonDropAdapterAssistant
+ * @see CommonViewer
+ * @since 3.2
+ */
+public final class ServersDropAdapter extends PluginDropAdapter {
+ private static final Transfer[] SUPPORTED_DROP_TRANSFERS = new Transfer[] {
+ LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance(),
+ PluginTransfer.getInstance() };
+ private final INavigatorContentService contentService;
+ private final INavigatorDnDService dndService;
+
+ public ServersDropAdapter(INavigatorContentService aContentService,
+ StructuredViewer aStructuredViewer) {
+ super(aStructuredViewer);
+ contentService = aContentService;
+ dndService = contentService.getDnDService();
+ }
+
+ public Transfer[] getSupportedDropTransfers() {
+ return SUPPORTED_DROP_TRANSFERS;
+ }
+
+ public void dragEnter(DropTargetEvent event) {
+ super.dragEnter(event);
+
+ for (int i = 0; i < event.dataTypes.length; i++) {
+ if (LocalSelectionTransfer.getTransfer().isSupportedType(
+ event.dataTypes[i])) {
+ event.currentDataType = event.dataTypes[i];
+ return;
+ }
+ }
+
+ for (int i = 0; i < event.dataTypes.length; i++) {
+ if (FileTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
+ event.currentDataType = event.dataTypes[i];
+ event.detail = DND.DROP_COPY;
+ return;
+ }
+ }
+
+ for (int i = 0; i < event.dataTypes.length; i++) {
+ if (PluginTransfer.getInstance()
+ .isSupportedType(event.dataTypes[i])) {
+ event.currentDataType = event.dataTypes[i];
+ return;
+ }
+ }
+
+ event.detail = DND.DROP_NONE;
+
+ }
+
+ public void dragLeave(DropTargetEvent event) {
+ super.dragLeave(event);
+ if (LocalSelectionTransfer.getTransfer().isSupportedType(
+ event.currentDataType)) {
+ event.data = NavigatorPluginDropAction
+ .createTransferData(contentService);
+ }
+ }
+
+ /*
+ * Changed from CommonDropAdapter to extract the findCommonDropAdapterAssistant section
+ * since I do not like the impl in dnd service
+ */
+ public void drop(DropTargetEvent event) {
+ // Must validate the drop here because on some platforms (Linux, Mac) the event
+ // is not populated with the correct currentDataType until the drop actually
+ // happens, and validateDrop sets the currentTransfer based on that. The
+ // call to validateDrop in dragAccept is too early.
+ validateDrop(getCurrentTarget(), getCurrentOperation(), event.currentDataType);
+ if (PluginTransfer.getInstance().isSupportedType(event.currentDataType)) {
+ super.drop(event);
+ } else {
+
+ Object target = getCurrentTarget() != null ?
+ getCurrentTarget() : getViewer().getInput();
+
+ CommonDropAdapterAssistant[] assistants =
+ findCommonDropAdapterAssistants(target, getCurrentTransfer());
+ System.out.println("got " +assistants.length + " assistants: " + assistants);
+ IStatus valid = null;
+ for (int i = 0; i < assistants.length; i++) {
+ try {
+ valid = assistants[i].validateDrop(getCurrentTarget(),
+ getCurrentOperation(), getCurrentTransfer());
+ System.out.println("assistant " + i + "=" + assistants[i] + " returns " + valid);
+ if (valid != null && valid.isOK()) {
+ assistants[i].handleDrop(null, event,
+ getCurrentTarget());
+ event.detail = DND.DROP_NONE;
+ return;
+ }
+ } catch (Throwable t) {
+ NavigatorPlugin.logError(0, t.getMessage(), t);
+ }
+ }
+ event.detail = DND.DROP_NONE;
+ }
+ }
+
+ /*
+ * Changed from CommonDropAdapter to extract the findCommonDropAdapterAssistant section
+ * since I do not like the impl in dnd service
+ */
+ public boolean validateDrop(Object aDropTarget, int theDropOperation,
+ TransferData theTransferData) {
+ boolean result = false;
+ IStatus valid = null;
+ if (super.validateDrop(aDropTarget, theDropOperation, theTransferData)) {
+ result = true;
+ } else {
+ Object target = aDropTarget != null ? aDropTarget : getViewer().getInput();
+ CommonDropAdapterAssistant[] assistants =
+ findCommonDropAdapterAssistants(target,
+ theTransferData);
+ for (int i = 0; i < assistants.length; i++) {
+ try {
+ valid = assistants[i].validateDrop(target,
+ theDropOperation, theTransferData);
+ System.out.println("assistant " + i + "=" + assistants[i] + " returns " + valid);
+ } catch (Throwable t) {
+ NavigatorPlugin.logError(0, t.getMessage(), t);
+ }
+ if (valid != null && valid.isOK()) {
+ result = true;
+ break;
+ }
+ }
+ }
+ setScrollExpandEnabled(true);
+ System.out.println("validate returns " + result);
+ return result;
+
+ }
+
+ public Rectangle getBounds(Item item) {
+ return super.getBounds(item);
+ }
+
+ public int getCurrentLocation() {
+ return super.getCurrentLocation();
+ }
+
+ public int getCurrentOperation() {
+ return super.getCurrentOperation();
+ }
+
+ public Object getCurrentTarget() {
+ return super.getCurrentTarget();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PluginDropAdapter#getCurrentTransfer()
+ */
+ public TransferData getCurrentTransfer() {
+ return super.getCurrentTransfer();
+ }
+
+ /**
+ * Returns the position of the given event's coordinates relative to its target.
+ * The position is determined to be before, after, or on the item, based on
+ * some threshold value.
+ *
+ * @param event the event
+ * @return one of the <code>LOCATION_* </code>constants defined in this class
+ */
+ protected int determineLocation(DropTargetEvent event) {
+ if (!(event.item instanceof Item)) {
+ return LOCATION_NONE;
+ }
+ return LOCATION_ON;
+ }
+
+
+ private CommonDropAdapterAssistant[] findCommonDropAdapterAssistants(
+ Object aDropTarget, TransferData theTransferType) {
+ CommonDropAdapterAssistant[] result =
+ findCommonDropAdapterAssistants2(aDropTarget, theTransferType);
+ return result;
+ }
+
+
+
+ /*
+ * Stolen from DND Service
+ */
+
+ private static final CommonDropAdapterAssistant[] NO_ASSISTANTS = new CommonDropAdapterAssistant[0];
+ private final Map dropAssistants = new HashMap();
+
+ public CommonDropAdapterAssistant[] findCommonDropAdapterAssistants2(
+ Object aDropTarget, TransferData aTransferType) {
+
+ // TODO Make sure descriptors are sorted by priority
+ CommonDropAdapterDescriptor[] descriptors = CommonDropDescriptorManager
+ .getInstance().findCommonDropAdapterAssistants(aDropTarget,
+ contentService);
+
+ if (descriptors.length == 0) {
+ return NO_ASSISTANTS;
+ }
+ if (LocalSelectionTransfer.getTransfer().isSupportedType(aTransferType)
+ && LocalSelectionTransfer.getTransfer().getSelection() instanceof IStructuredSelection) {
+ return getAssistants(descriptors);
+ }
+ return getAssistantsByTransferData(descriptors, aTransferType);
+ }
+
+ private CommonDropAdapterAssistant[] getAssistants(CommonDropAdapterDescriptor[] descriptors) {
+ Set assistants = new LinkedHashSet();
+ for (int i = 0; i < descriptors.length; i++) {
+ assistants.add(getAssistant(descriptors[i]));
+ }
+ return (CommonDropAdapterAssistant[]) assistants
+ .toArray(new CommonDropAdapterAssistant[assistants.size()]);
+ }
+
+ private CommonDropAdapterAssistant[] getAssistantsByTransferData(
+ CommonDropAdapterDescriptor[] descriptors,
+ TransferData aTransferType) {
+
+ Set assistants = new LinkedHashSet();
+ for (int i = 0; i < descriptors.length; i++) {
+ CommonDropAdapterAssistant asst = getAssistant(descriptors[i]);
+ if (asst.isSupportedType(aTransferType)) {
+ assistants.add(asst);
+ }
+ }
+ return (CommonDropAdapterAssistant[]) assistants
+ .toArray(new CommonDropAdapterAssistant[assistants.size()]);
+
+ }
+
+ private CommonDropAdapterAssistant getAssistant(
+ CommonDropAdapterDescriptor descriptor) {
+ CommonDropAdapterAssistant asst = (CommonDropAdapterAssistant) dropAssistants
+ .get(descriptor);
+ if (asst != null) {
+ return asst;
+ }
+ synchronized (dropAssistants) {
+ asst = (CommonDropAdapterAssistant) dropAssistants.get(descriptor);
+ if (asst == null) {
+ dropAssistants.put(descriptor, (asst = descriptor
+ .createDropAssistant()));
+ asst.init(contentService);
+ }
+ }
+ return asst;
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java 2009-01-22 07:05:06 UTC (rev 13178)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java 2009-01-22 08:00:42 UTC (rev 13179)
@@ -10,15 +10,69 @@
*******************************************************************************/
package org.jboss.tools.as.wst.server.ui;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.navigator.CommonDragAdapter;
+import org.eclipse.ui.navigator.CommonDropAdapter;
import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
/**
* A view of servers, their modules, and status.
*/
public class ServersView extends CommonNavigator {
+
/**
* ServersView constructor comment.
*/
public ServersView() {
super();
}
+
+ /*
+ * Stuff that shouldn't even be here but CNF is kinda lame
+ * Must override currently to overcome the bug below:
+ *
+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=261606
+ */
+ private IMemento memento;
+
+ public void init(IViewSite aSite, IMemento aMemento)
+ throws PartInitException {
+ this.memento = memento;
+ super.init(aSite, aMemento);
+ }
+
+ protected CommonViewer createCommonViewer(Composite aParent) {
+ CommonViewer aViewer = new CommonViewerExtension(getViewSite().getId(), aParent,
+ SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ initListeners(aViewer);
+ aViewer.getNavigatorContentService().restoreState(memento);
+ return aViewer;
+ }
+
+
+ public class CommonViewerExtension extends CommonViewer {
+ public CommonViewerExtension(String aViewerId, Composite aParent, int aStyle) {
+ super(aViewerId, aParent, aStyle);
+ }
+
+ protected void initDragAndDrop() {
+ /* Handle Drag and Drop */
+ int operations = DND.DROP_COPY | DND.DROP_MOVE;
+
+ CommonDragAdapter dragAdapter = new CommonDragAdapter(
+ getNavigatorContentService(), this);
+ addDragSupport(operations, dragAdapter.getSupportedDragTransfers(),
+ dragAdapter);
+
+ ServersDropAdapter dropAdapter = new ServersDropAdapter(
+ getNavigatorContentService(), this);
+ addDropSupport(operations, dropAdapter.getSupportedDropTransfers(),
+ dropAdapter);
+ }
+ }
}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersViewDropAdapterAssistant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersViewDropAdapterAssistant.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersViewDropAdapterAssistant.java 2009-01-22 08:00:42 UTC (rev 13179)
@@ -0,0 +1,193 @@
+package org.jboss.tools.as.wst.server.ui;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.activities.WorkbenchActivityHelper;
+import org.eclipse.ui.internal.Workbench;
+import org.eclipse.ui.navigator.CommonDropAdapter;
+import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
+import org.eclipse.ui.part.ResourceTransfer;
+import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IModuleType;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.ui.internal.EclipseUtil;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.actions.RunOnServerActionDelegate;
+
+public class ServersViewDropAdapterAssistant extends CommonDropAdapterAssistant {
+
+ @SuppressWarnings("unchecked") private List fElements;
+
+ public ServersViewDropAdapterAssistant() {
+ super();
+ }
+ protected void doInit() {
+ }
+
+ public IStatus validatePluginTransferDrop(
+ IStructuredSelection aDragSelection, Object aDropTarget) {
+ initializeSelection(aDragSelection);
+ return internalValidate(aDropTarget, fElements);
+ }
+
+ public IStatus validateDrop(Object target, int operation,
+ TransferData transferType) {
+ if (LocalSelectionTransfer.getInstance().isSupportedType(transferType)) {
+ ISelection s = LocalSelectionTransfer.getInstance().getSelection();
+ initializeSelection(s);
+ return internalValidate(target, fElements);
+ }
+ return Status.CANCEL_STATUS;
+ }
+
+ protected void initializeSelection(ISelection s) {
+ if (fElements != null)
+ return;
+ if (!(s instanceof IStructuredSelection)) {
+ fElements= Collections.EMPTY_LIST;
+ return;
+ }
+ fElements = ((IStructuredSelection) s).toList();
+ }
+
+ @SuppressWarnings("unchecked")
+ protected IStatus internalValidate(Object target, List elements) {
+ if( target instanceof IServer ) {
+ IServer server = (IServer)target;
+ Object next;
+ if( elements != null ) {
+ Iterator i = elements.iterator();
+ while(i.hasNext() ) {
+ next = i.next();
+ IModuleArtifact[] moduleArtifacts = ServerPlugin.getModuleArtifacts(next);
+ if (moduleArtifacts != null && moduleArtifacts.length > 0 ) {
+ for( int j = 0; j < moduleArtifacts.length; j++ ) {
+ if( moduleArtifacts[j] != null && moduleArtifacts[j].getModule() != null ) {
+ IModuleType[] moduleTypes = server.getServerType().getRuntimeType().getModuleTypes();
+ if (ServerUtil.isSupportedModule(moduleTypes, moduleArtifacts[j].getModule().getModuleType())) {
+ return Status.OK_STATUS;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ clear();
+ return Status.CANCEL_STATUS;
+ }
+
+ public IStatus handleDrop(CommonDropAdapter dropAdapter,
+ DropTargetEvent dropTargetEvent, Object target) {
+ return internalHandleDrop(target, fElements);
+ }
+
+ public IStatus handlePluginTransferDrop(
+ IStructuredSelection aDragSelection, Object aDropTarget) {
+ return internalHandleDrop(aDropTarget, fElements);
+ }
+
+ protected IStatus internalHandleDrop(Object target, List elements) {
+ boolean b = false;
+ if( target instanceof IServer ) {
+ b = true;
+ if( fElements != null ) {
+ Iterator iterator = elements.iterator();
+ while (iterator.hasNext()) {
+ Object data2 = iterator.next();
+ if (!doSel((IServer)target, data2))
+ b = false;
+ }
+ }
+ }
+ clear();
+ return b ? Status.OK_STATUS : Status.CANCEL_STATUS;
+ }
+
+ private void clear() {
+ fElements = null;
+ }
+
+ protected boolean doSel(IServer server, Object data) {
+ // check if the selection is a project (module) that we can add to the server
+ IProject project = (IProject) Platform.getAdapterManager().getAdapter(data, IProject.class);
+ if (project != null) {
+ IModule[] modules = ServerUtil.getModules(project);
+ if (modules != null && modules.length == 1) {
+ try {
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ IModule[] parents = wc.getRootModules(modules[0], null);
+ if (parents == null || parents.length == 0)
+ return false;
+
+ if (ServerUtil.containsModule(server, parents[0], null))
+ return false;
+
+ IModule[] add = new IModule[] { parents[0] };
+ if (wc.canModifyModules(add, null, null).getSeverity() != IStatus.ERROR) {
+ wc.modifyModules(modules, null, null);
+ wc.save(false, null);
+ return true;
+ }
+ } catch (final CoreException ce) {
+ final Shell shell = Workbench.getInstance().getActiveWorkbenchWindow().getShell();
+ shell.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ EclipseUtil.openError(shell, ce.getLocalizedMessage());
+ }
+ });
+ return true;
+ }
+ }
+ }
+
+ // otherwise, try Run on Server
+ final IServer finalServer = server;
+ RunOnServerActionDelegate ros = new RunOnServerActionDelegate() {
+ public IServer getServer(IModule module, IModuleArtifact moduleArtifact, IProgressMonitor monitor) throws CoreException {
+ if (!ServerUIPlugin.isCompatibleWithLaunchMode(finalServer, launchMode))
+ return null;
+
+ if (!ServerUtil.containsModule(finalServer, module, monitor)) {
+ IServerWorkingCopy wc = finalServer.createWorkingCopy();
+ try {
+ ServerUtil.modifyModules(wc, new IModule[] { module }, new IModule[0], monitor);
+ wc.save(false, monitor);
+ } catch (CoreException ce) {
+ throw ce;
+ }
+ }
+
+ return finalServer;
+ }
+ };
+ Action action = new Action() {
+ //
+ };
+ ros.selectionChanged(action, new StructuredSelection(data));
+
+ ros.run(action);
+ return true;
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2009-01-22 07:05:06 UTC (rev 13178)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2009-01-22 08:00:42 UTC (rev 13179)
@@ -347,6 +347,14 @@
</or>
</enablement>
</actionProvider>
+ <dropAssistant
+ class="org.jboss.tools.as.wst.server.ui.ServersViewDropAdapterAssistant"
+ id="org.jboss.tools.as.wst.server.ui.ServersView.DropAssistant">
+ <possibleDropTargets>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof></possibleDropTargets>
+ </dropAssistant>
</navigatorContent>
</extension>
<extension
15 years, 11 months
JBoss Tools SVN: r13178 - trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-01-22 02:05:06 -0500 (Thu, 22 Jan 2009)
New Revision: 13178
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-3399 fixed
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties 2009-01-22 07:01:20 UTC (rev 13177)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties 2009-01-22 07:05:06 UTC (rev 13178)
@@ -1,7 +1,7 @@
-source.. = src/
output.. = bin/
-bin.includes = META-INF/,\
- .,\
- resultfile/,\
- testfile/,\
- plugin.properties
+bin.includes = META-INF/,\
+ resultfile/,\
+ testfile/,\
+ plugin.properties,\
+ jbpm-convert-test.jar
+source.jbpm-convert-test.jar = src/
15 years, 11 months
JBoss Tools SVN: r13177 - trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-01-22 02:01:20 -0500 (Thu, 22 Jan 2009)
New Revision: 13177
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-3399 fixed
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2009-01-22 02:35:25 UTC (rev 13176)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2009-01-22 07:01:20 UTC (rev 13177)
@@ -17,3 +17,4 @@
Bundle-Vendor: %BundleProvider
Export-Package: org.jboss.tools.jbpm.convert,
org.jboss.tools.jbpm.convert.test
+Bundle-ClassPath: jbpm-convert-test.jar
15 years, 11 months
JBoss Tools SVN: r13176 - trunk/documentation/development/setup/launches.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-01-21 21:35:25 -0500 (Wed, 21 Jan 2009)
New Revision: 13176
Removed:
trunk/documentation/development/setup/launches/JBoss Developer Studio (en_AA).launch
trunk/documentation/development/setup/launches/JBoss Developer Studio.launch
Log:
Reverting accidental check-in of .launch files.
Deleted: trunk/documentation/development/setup/launches/JBoss Developer Studio (en_AA).launch
===================================================================
--- trunk/documentation/development/setup/launches/JBoss Developer Studio (en_AA).launch 2009-01-22 00:33:50 UTC (rev 13175)
+++ trunk/documentation/development/setup/launches/JBoss Developer Studio (en_AA).launch 2009-01-22 02:35:25 UTC (rev 13176)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="true"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="false"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/JBoss Developer Studio (en_AA)"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../runtime-New_configuration"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl en_AA"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms128m -Xmx512m -XX:MaxPermSize=128m"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="com.jboss.jbds.product.product"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<booleanAttribute key="useProduct" value="true"/>
-<booleanAttribute key="usefeatures" value="false"/>
-</launchConfiguration>
Deleted: trunk/documentation/development/setup/launches/JBoss Developer Studio.launch
===================================================================
--- trunk/documentation/development/setup/launches/JBoss Developer Studio.launch 2009-01-22 00:33:50 UTC (rev 13175)
+++ trunk/documentation/development/setup/launches/JBoss Developer Studio.launch 2009-01-22 02:35:25 UTC (rev 13176)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="true"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="false"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/JBoss Developer Studio"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../runtime-New_configuration"/>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms128m -Xmx512m -XX:MaxPermSize=128m"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="com.jboss.jbds.product.product"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<booleanAttribute key="useProduct" value="true"/>
-<booleanAttribute key="usefeatures" value="false"/>
-</launchConfiguration>
15 years, 11 months
JBoss Tools SVN: r13175 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-01-21 19:33:50 -0500 (Wed, 21 Jan 2009)
New Revision: 13175
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
Log:
GPD-287: Support preservation of unknown attributes
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-01-21 23:10:50 UTC (rev 13174)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlDeserializer.java 2009-01-22 00:33:50 UTC (rev 13175)
@@ -22,28 +22,36 @@
public class JpdlDeserializer {
- interface AttributeHandler {
- void processAttributes(Wrapper wrapper, Element element);
+ interface AttributeDeserializer {
+ void deserializeAttributes(Wrapper wrapper, Element element);
}
- interface ChildNodeHandler {
- Wrapper processChildNode(Wrapper parent, Node node);
+ interface ChildNodeDeserializer {
+ Wrapper deserializeChildNode(Wrapper parent, Node node);
}
interface PostProcessor {
void postProcess(Wrapper wrapper);
}
- class ProcessAttributeHandler implements AttributeHandler {
- public void processAttributes(Wrapper wrapper, Element element) {
+ class DefaultAttributeDeserializer implements AttributeDeserializer {
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ wrapper.getElement().setMetaData("attributes", element.getAttributes());
+ }
+ }
+
+ class ProcessAttributeHandler extends DefaultAttributeDeserializer {
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ super.deserializeAttributes(wrapper, element);
if (!(wrapper instanceof FlowWrapper)) return;
FlowWrapper flowWrapper = (FlowWrapper)wrapper;
((Flow)flowWrapper.getElement()).setName(element.getAttribute("name"));
}
}
- class NodeAttributeHandler implements AttributeHandler {
- public void processAttributes(Wrapper wrapper, Element element) {
+ class NodeAttributeHandler extends DefaultAttributeDeserializer {
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ super.deserializeAttributes(wrapper, element);
if (!(wrapper instanceof NodeWrapper)) return;
NodeWrapper nodeWrapper = (NodeWrapper)wrapper;
addGraphics(nodeWrapper, element);
@@ -51,8 +59,9 @@
}
}
- class ConnectionAttributeHandler implements AttributeHandler {
- public void processAttributes(Wrapper wrapper, Element element) {
+ class ConnectionAttributeHandler extends DefaultAttributeDeserializer {
+ public void deserializeAttributes(Wrapper wrapper, Element element) {
+ super.deserializeAttributes(wrapper, element);
if (!(wrapper instanceof ConnectionWrapper)) return;
ConnectionWrapper connectionWrapper = (ConnectionWrapper)wrapper;
addGraphics(connectionWrapper, element);
@@ -60,8 +69,8 @@
}
}
- class ProcessChildNodeHandler implements ChildNodeHandler {
- public Wrapper processChildNode(Wrapper parent, Node node) {
+ class ProcessChildNodeHandler implements ChildNodeDeserializer {
+ public Wrapper deserializeChildNode(Wrapper parent, Node node) {
Wrapper result = null;
if (!(parent instanceof FlowWrapper)) return result;
FlowWrapper flowWrapper = (FlowWrapper)parent;
@@ -75,9 +84,9 @@
}
}
- class NodeChildNodeHandler implements ChildNodeHandler {
+ class NodeChildNodeHandler implements ChildNodeDeserializer {
@SuppressWarnings("unchecked")
- public Wrapper processChildNode(Wrapper parent, Node node) {
+ public Wrapper deserializeChildNode(Wrapper parent, Node node) {
Wrapper result = null;
if (!(parent instanceof NodeWrapper)) return result;
NodeWrapper nodeWrapper = (NodeWrapper)parent;
@@ -139,16 +148,16 @@
if (elementId == null) return null;
Wrapper result = ElementRegistry.createWrapper(elementId);
if (result == null) return null;
- AttributeHandler attributeHandler = getAttributeHandler(result);
+ AttributeDeserializer attributeHandler = getAttributeHandler(result);
if (attributeHandler != null) {
- attributeHandler.processAttributes(result, element);
+ attributeHandler.deserializeAttributes(result, element);
}
- ChildNodeHandler childNodeHandler = getChildNodeHandler(result);
+ ChildNodeDeserializer childNodeHandler = getChildNodeHandler(result);
if (childNodeHandler != null) {
NodeList nodeList = element.getChildNodes();
ArrayList<Node> unknownNodeList = new ArrayList<Node>();
for (int i = 0; i < nodeList.getLength(); i++) {
- Wrapper childWrapper = childNodeHandler.processChildNode(result, nodeList.item(i));
+ Wrapper childWrapper = childNodeHandler.deserializeChildNode(result, nodeList.item(i));
if (childWrapper != null) {
childWrapper.getElement().setMetaData("leadingNodes", unknownNodeList);
unknownNodeList = new ArrayList<Node>();
@@ -172,7 +181,7 @@
return null;
}
- private AttributeHandler getAttributeHandler(Wrapper wrapper) {
+ private AttributeDeserializer getAttributeHandler(Wrapper wrapper) {
if (wrapper instanceof FlowWrapper) {
return new ProcessAttributeHandler();
} else if (wrapper instanceof NodeWrapper) {
@@ -183,7 +192,7 @@
return null;
}
- private ChildNodeHandler getChildNodeHandler(Wrapper wrapper) {
+ private ChildNodeDeserializer getChildNodeHandler(Wrapper wrapper) {
if (wrapper instanceof FlowWrapper) {
return new ProcessChildNodeHandler();
} else if (wrapper instanceof NodeWrapper) {
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-01-21 23:10:50 UTC (rev 13174)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlSerializer.java 2009-01-22 00:33:50 UTC (rev 13175)
@@ -17,11 +17,13 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
import org.jboss.tools.flow.common.wrapper.NodeWrapper;
import org.jboss.tools.flow.common.wrapper.Wrapper;
import org.jboss.tools.flow.jpdl4.Logger;
@@ -34,6 +36,7 @@
import org.jboss.tools.flow.jpdl4.model.JavaTask;
import org.jboss.tools.flow.jpdl4.model.JoinParallelGateway;
import org.jboss.tools.flow.jpdl4.model.Process;
+import org.jboss.tools.flow.jpdl4.model.ProcessNode;
import org.jboss.tools.flow.jpdl4.model.ScriptTask;
import org.jboss.tools.flow.jpdl4.model.SequenceFlow;
import org.jboss.tools.flow.jpdl4.model.ServiceTask;
@@ -42,6 +45,7 @@
import org.jboss.tools.flow.jpdl4.model.SuperState;
import org.jboss.tools.flow.jpdl4.model.TerminateEndEvent;
import org.jboss.tools.flow.jpdl4.model.WaitTask;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
public class JpdlSerializer {
@@ -77,7 +81,7 @@
buffer.append(body);
appendClosing(buffer, wrapper, level);
} else {
- buffer.append("/>");
+ buffer.append("/>");
}
}
@@ -102,245 +106,448 @@
}
}
- @SuppressWarnings("unchecked")
- private void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
- Element element = (Element)wrapper.getElement();
- ArrayList<Node> leadingNodeList = (ArrayList<Node>)element.getMetaData("leadingNodes");
- boolean appendLeadingNodes = leadingNodeList != null && !leadingNodeList.isEmpty();
- if (appendLeadingNodes) {
- appendNodeList(buffer, leadingNodeList);
+ interface WrapperSerializer {
+ void appendOpening(StringBuffer buffer, Wrapper wrapper, int level);
+ }
+
+ abstract class AbstractWrapperSerializer implements WrapperSerializer {
+ protected abstract List<String> getAttributesToSave();
+ protected abstract void appendAttributeToSave(String nodeName, StringBuffer buffer, Wrapper wrapper);
+ @SuppressWarnings("unchecked")
+ protected void appendLeadingNodes(StringBuffer buffer, Wrapper wrapper, int level) {
+ ArrayList<Node> leadingNodeList = (ArrayList<Node>)wrapper.getElement().getMetaData("leadingNodes");
+ boolean appendLeadingNodes = leadingNodeList != null && !leadingNodeList.isEmpty();
+ if (appendLeadingNodes) {
+ appendNodeList(buffer, leadingNodeList);
+ } else {
+ buffer.append("\n");
+ appendPadding(buffer, level);
+ }
}
- if (element instanceof SequenceFlow) {
- SequenceFlow transition = (SequenceFlow)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ protected void appendDefaultAttribute(StringBuffer buffer, Node node) {
+ buffer.append(" " + node.getNodeName() + "=\"" + node.getNodeValue() + "\"");
+ }
+ protected void appendAttributes(StringBuffer buffer, Wrapper wrapper, int level) {
+ Element element = wrapper.getElement();
+ if (element == null) return;
+ NamedNodeMap attributes = (NamedNodeMap)element.getMetaData("attributes");
+ List<String> attributeNames = getAttributesToSave();
+ if (attributes != null) {
+ for (int i = 0; i < attributes.getLength(); i++) {
+ String nodeName = attributes.item(i).getNodeName();
+ if (attributeNames.contains(nodeName)) {
+ appendAttributeToSave(nodeName, buffer, wrapper);
+ attributeNames.remove(nodeName);
+ } else {
+ appendDefaultAttribute(buffer, attributes.item(i));
+ }
+ }
}
- buffer.append("<flow");
- if (transition.getTo() != null) {
- buffer.append(" ");
- String value = transition.getTo().getName();
- value = value == null ? "" : value;
- buffer.append("to=\"" + value + "\"");
+ for (int i = 0; i < attributeNames.size(); i++) {
+ appendAttributeToSave(attributeNames.get(i), buffer, wrapper);
+ }
+ }
+ public void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
+ appendLeadingNodes(buffer, wrapper, level);
+ buffer.append("<" + getNodeName(wrapper.getElement()));
+ appendAttributes(buffer, wrapper, level);
+ }
+ public void appendClosing(StringBuffer buffer, Wrapper wrapper) {
+ buffer.append("</" + getNodeName(wrapper.getElement()) + ">");
+ }
+ }
+
+ private String getNodeName(Element element) {
+ IConfigurationElement configuration = (IConfigurationElement)element.getMetaData("configurationElement");
+ String elementId = configuration.getAttribute("id");
+ if ("org.jboss.tools.flow.jpdl4.process".equals(elementId)) return "process";
+ else if ("org.jboss.tools.flow.jpdl4.startEvent".equals(elementId)) return "start";
+ else if ("org.jboss.tools.flow.jpdl4.terminateEndEvent".equals(elementId)) return "end";
+ else if ("org.jboss.tools.flow.jpdl4.errorEndEvent".equals(elementId)) return "end-error";
+ else if ("org.jboss.tools.flow.jpdl4.cancelEndEvent".equals(elementId)) return "end-cancel";
+ else if ("org.jboss.tools.flow.jpdl4.waitTask".equals(elementId)) return "state";
+ else if ("org.jboss.tools.flow.jpdl4.hqlTask".equals(elementId)) return "hql";
+ else if ("org.jboss.tools.flow.jpdl4.sqlTask".equals(elementId)) return "sql";
+ else if ("org.jboss.tools.flow.jpdl4.javaTask".equals(elementId)) return "java";
+ else if ("org.jboss.tools.flow.jpdl4.scriptTask".equals(elementId)) return "script";
+ else if ("org.jboss.tools.flow.jpdl4.serviceTask".equals(elementId)) return "esb";
+ else if ("org.jboss.tools.flow.jpdl4.humanTask".equals(elementId)) return "task";
+ else if ("org.jboss.tools.flow.jpdl4.exclusiveGateway".equals(elementId)) return "exclusive";
+ else if ("org.jboss.tools.flow.jpdl4.parallelJoinGateway".equals(elementId)) return "join";
+ else if ("org.jboss.tools.flow.jpdl4.parallelForkGateway".equals(elementId)) return "fork";
+ else if ("org.jboss.tools.flow.jpdl4.sequenceFlow".equals(elementId)) return "flow";
+ else return null;
+ }
+
+ class SequenceFlowWrapperSerializer extends AbstractWrapperSerializer {
+ protected List<String> getAttributesToSave() {
+ ArrayList<String> result = new ArrayList<String>();
+ result.add("to");
+ result.add("g");
+ return result;
+ }
+ protected void appendAttributeToSave(String attributeName, StringBuffer buffer, Wrapper wrapper) {
+ if (!(wrapper instanceof ConnectionWrapper)) return;
+ Element element = wrapper.getElement();
+ if (!(element instanceof SequenceFlow)) return;
+ if ("to".equals(attributeName)) {
+ appendTo(buffer, (SequenceFlow)element);
+ } else if ("g".equals(attributeName)) {
+ appendGraphics(buffer, (ConnectionWrapper)wrapper);
}
- appendConnectionGraphics(buffer, (ConnectionWrapper)wrapper);
- } else if (element instanceof TerminateEndEvent) {
- TerminateEndEvent terminateEndEvent = (TerminateEndEvent)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
+ }
+ protected void appendTo(StringBuffer buffer, SequenceFlow sequenceFlow) {
+ if (sequenceFlow.getTo() == null) return;
+ String value = sequenceFlow.getTo().getName();
+ if (value == null || "".equals(value)) return;
+ buffer.append(" to=\"" + value + "\"");
+ }
+ protected void appendGraphics(StringBuffer buffer, ConnectionWrapper wrapper) {
+ List<Point> bendPoints = wrapper.getBendpoints();
+ if (bendPoints == null || bendPoints.size() == 0) return;
+ buffer.append(" g=\"");
+ for (int i = 0; i < bendPoints.size(); i++) {
+ buffer.append(bendPoints.get(i).x);
+ buffer.append(",");
+ buffer.append(bendPoints.get(i).y);
+ if (i < bendPoints.size() - 1) buffer.append(";");
+ }
+ buffer.append("\"");
+ }
+ }
+
+ class ProcessNodeWrapperSerializer extends AbstractWrapperSerializer {
+ protected List<String> getAttributesToSave() {
+ ArrayList<String> result = new ArrayList<String>();
+ result.add("name");
+ result.add("g");
+ return result;
+ }
+ protected void appendAttributeToSave(String attributeName, StringBuffer buffer, Wrapper wrapper) {
+ if (!(wrapper instanceof NodeWrapper)) return;
+ Element element = wrapper.getElement();
+ if (!(element instanceof ProcessNode)) return;
+ if ("name".equals(attributeName)) {
+ appendName(buffer, (ProcessNode)element);
+ } else if ("g".equals(attributeName)) {
+ appendGraphics(buffer, (NodeWrapper)wrapper);
}
- buffer.append("<end");
- if (!isEmpty(terminateEndEvent.getName())) {
- buffer.append(" ");
- String value = terminateEndEvent.getName();
- buffer.append("name=\"" + value + "\"");
+ }
+ protected void appendName(StringBuffer buffer, ProcessNode processNode) {
+ String value = processNode.getName();
+ if (value == null || "".equals(value)) return;
+ buffer.append(" name=\"" + value + "\"");
+ }
+ protected void appendGraphics(StringBuffer buffer, NodeWrapper wrapper) {
+ Rectangle constraint = wrapper.getConstraint();
+ buffer.append(" g=\"");
+ buffer.append(constraint.x);
+ buffer.append(",");
+ buffer.append(constraint.y);
+ buffer.append(",");
+ buffer.append(constraint.width);
+ buffer.append(",");
+ buffer.append(constraint.height);
+ buffer.append("\"");
+ }
+ }
+
+ class ProcessWrapperSerializer extends AbstractWrapperSerializer {
+ public void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
+ buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
+ buffer.append("<" + getNodeName(wrapper.getElement()));
+ appendAttributes(buffer, wrapper, level);
+ }
+ protected List<String> getAttributesToSave() {
+ ArrayList<String> result = new ArrayList<String>();
+ result.add("xmlns");
+ result.add("name");
+ result.add("initial");
+ return result;
+ }
+ protected void appendAttributeToSave(String attributeName, StringBuffer buffer, Wrapper wrapper) {
+ if (!(wrapper instanceof FlowWrapper)) return;
+ Element element = wrapper.getElement();
+ if (element == null || !(element instanceof Process)) return;
+ if ("xmlns".equals(attributeName)) {
+ buffer.append(" xmlns=\"http://jbpm.org/4/jpdl\"");
+ } else if ("name".equals(attributeName)) {
+ appendName(buffer, (Process)element);
+ } else if ("initial".equals(attributeName)) {
+ appendInitial(buffer, (Process)element);
}
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ }
+ protected void appendName(StringBuffer buffer, Process process) {
+ String value = process.getName();
+ if (value == null || "".equals(value)) return;
+ buffer.append(" name=\"" + value + "\"");
+ }
+ protected void appendInitial(StringBuffer buffer, Process process) {
+ if (process.getInitial() == null) return;
+ String value = process.getInitial().getName();
+ if (value == null || "".equals(value)) return;
+ buffer.append(" initial=\"" + value + "\"");
+ }
+ }
+
+ private void appendOpening(StringBuffer buffer, Wrapper wrapper, int level) {
+ Element element = (Element)wrapper.getElement();
+// ArrayList<Node> leadingNodeList = (ArrayList<Node>)element.getMetaData("leadingNodes");
+// boolean appendLeadingNodes = leadingNodeList != null && !leadingNodeList.isEmpty();
+// if (appendLeadingNodes) {
+// appendNodeList(buffer, leadingNodeList);
+// } else {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+ if (element instanceof SequenceFlow) {
+ new SequenceFlowWrapperSerializer().appendOpening(buffer, wrapper, level);
+// SequenceFlow transition = (SequenceFlow)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<flow");
+// if (transition.getTo() != null) {
+// buffer.append(" ");
+// String value = transition.getTo().getName();
+// value = value == null ? "" : value;
+// buffer.append("to=\"" + value + "\"");
+// }
+// appendConnectionGraphics(buffer, (ConnectionWrapper)wrapper);
+ } else if (element instanceof TerminateEndEvent) {
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// TerminateEndEvent terminateEndEvent = (TerminateEndEvent)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<end");
+// if (!isEmpty(terminateEndEvent.getName())) {
+// buffer.append(" ");
+// String value = terminateEndEvent.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ErrorEndEvent) {
- ErrorEndEvent errorEndEvent = (ErrorEndEvent)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<end-error");
- if (!isEmpty(errorEndEvent.getName())) {
- buffer.append(" ");
- String value = errorEndEvent.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// ErrorEndEvent errorEndEvent = (ErrorEndEvent)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<end-error");
+// if (!isEmpty(errorEndEvent.getName())) {
+// buffer.append(" ");
+// String value = errorEndEvent.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof CancelEndEvent) {
- CancelEndEvent cancelEndEvent = (CancelEndEvent)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<end-cancel");
- if (!isEmpty(cancelEndEvent.getName())) {
- buffer.append(" ");
- String value = cancelEndEvent.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// CancelEndEvent cancelEndEvent = (CancelEndEvent)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<end-cancel");
+// if (!isEmpty(cancelEndEvent.getName())) {
+// buffer.append(" ");
+// String value = cancelEndEvent.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof StartEvent) {
- StartEvent startEvent = (StartEvent)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<start");
- if (!isEmpty(startEvent.getName())) {
- buffer.append(" ");
- String value = startEvent.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// StartEvent startEvent = (StartEvent)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<start");
+// if (!isEmpty(startEvent.getName())) {
+// buffer.append(" ");
+// String value = startEvent.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof SuperState) {
- SuperState superState = (SuperState)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<super-state");
- if (!isEmpty(superState.getName())) {
- buffer.append(" ");
- String value = superState.getName();
- buffer.append("name=\"" + value + "\"");
- }
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// SuperState superState = (SuperState)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<super-state");
+// if (!isEmpty(superState.getName())) {
+// buffer.append(" ");
+// String value = superState.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
} else if (element instanceof WaitTask) {
- WaitTask waitTask = (WaitTask)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<state");
- if (!isEmpty(waitTask.getName())) {
- buffer.append(" ");
- String value = waitTask.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// WaitTask waitTask = (WaitTask)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<state");
+// if (!isEmpty(waitTask.getName())) {
+// buffer.append(" ");
+// String value = waitTask.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof HqlTask) {
- HqlTask hqlTask = (HqlTask)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<hql");
- if (!isEmpty(hqlTask.getName())) {
- buffer.append(" ");
- String value = hqlTask.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// HqlTask hqlTask = (HqlTask)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<hql");
+// if (!isEmpty(hqlTask.getName())) {
+// buffer.append(" ");
+// String value = hqlTask.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof SqlTask) {
- SqlTask sqlTask = (SqlTask)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<sql");
- if (!isEmpty(sqlTask.getName())) {
- buffer.append(" ");
- String value = sqlTask.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// SqlTask sqlTask = (SqlTask)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<sql");
+// if (!isEmpty(sqlTask.getName())) {
+// buffer.append(" ");
+// String value = sqlTask.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof JavaTask) {
- JavaTask javaTask = (JavaTask)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<java");
- if (!isEmpty(javaTask.getName())) {
- buffer.append(" ");
- String value = javaTask.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// JavaTask javaTask = (JavaTask)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<java");
+// if (!isEmpty(javaTask.getName())) {
+// buffer.append(" ");
+// String value = javaTask.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ScriptTask) {
- ScriptTask scriptTask = (ScriptTask)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<script");
- if (!isEmpty(scriptTask.getName())) {
- buffer.append(" ");
- String value = scriptTask.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// ScriptTask scriptTask = (ScriptTask)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<script");
+// if (!isEmpty(scriptTask.getName())) {
+// buffer.append(" ");
+// String value = scriptTask.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ServiceTask) {
- ServiceTask serviceTask = (ServiceTask)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<esb");
- if (!isEmpty(serviceTask.getName())) {
- buffer.append(" ");
- String value = serviceTask.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// ServiceTask serviceTask = (ServiceTask)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<esb");
+// if (!isEmpty(serviceTask.getName())) {
+// buffer.append(" ");
+// String value = serviceTask.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof HumanTask) {
- HumanTask humanTask = (HumanTask)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<task");
- if (!isEmpty(humanTask.getName())) {
- buffer.append(" ");
- String value = humanTask.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// HumanTask humanTask = (HumanTask)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<task");
+// if (!isEmpty(humanTask.getName())) {
+// buffer.append(" ");
+// String value = humanTask.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ExclusiveGateway) {
- ExclusiveGateway exclusiveGateway = (ExclusiveGateway)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<exclusive");
- if (!isEmpty(exclusiveGateway.getName())) {
- buffer.append(" ");
- String value = exclusiveGateway.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// ExclusiveGateway exclusiveGateway = (ExclusiveGateway)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<exclusive");
+// if (!isEmpty(exclusiveGateway.getName())) {
+// buffer.append(" ");
+// String value = exclusiveGateway.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof ForkParallelGateway) {
- ForkParallelGateway parallelForkGateway = (ForkParallelGateway)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<fork");
- if (!isEmpty(parallelForkGateway.getName())) {
- buffer.append(" ");
- String value = parallelForkGateway.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// ForkParallelGateway parallelForkGateway = (ForkParallelGateway)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<fork");
+// if (!isEmpty(parallelForkGateway.getName())) {
+// buffer.append(" ");
+// String value = parallelForkGateway.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof JoinParallelGateway) {
- JoinParallelGateway parallelJoinGateway = (JoinParallelGateway)element;
- if (!appendLeadingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("<join");
- if (!isEmpty(parallelJoinGateway.getName())) {
- buffer.append(" ");
- String value = parallelJoinGateway.getName();
- buffer.append("name=\"" + value + "\"");
- }
- appendNodeGraphics(buffer, (NodeWrapper)wrapper);
+ new ProcessNodeWrapperSerializer().appendOpening(buffer, wrapper, level);
+// JoinParallelGateway parallelJoinGateway = (JoinParallelGateway)element;
+// if (!appendLeadingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+// buffer.append("<join");
+// if (!isEmpty(parallelJoinGateway.getName())) {
+// buffer.append(" ");
+// String value = parallelJoinGateway.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
+// appendNodeGraphics(buffer, (NodeWrapper)wrapper);
} else if (element instanceof Process) {
- Process process = (Process)element;
- buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
- buffer.append("<process");
- buffer.append(" xmlns=\"http://jbpm.org/4/jpdl\"");
- if (process.getInitial() != null) {
- buffer.append(" ");
- String value = process.getInitial().getName();
- value = value == null ? "" : value;
- buffer.append("initial=\"" + value + "\"");
- }
- if (!isEmpty(process.getName())) {
- buffer.append(" ");
- String value = process.getName();
- buffer.append("name=\"" + value + "\"");
- }
+ new ProcessWrapperSerializer().appendOpening(buffer, wrapper, level);
+// Process process = (Process)element;
+// buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n");
+// buffer.append("<process");
+// buffer.append(" xmlns=\"http://jbpm.org/4/jpdl\"");
+// if (process.getInitial() != null) {
+// buffer.append(" ");
+// String value = process.getInitial().getName();
+// value = value == null ? "" : value;
+// buffer.append("initial=\"" + value + "\"");
+// }
+// if (!isEmpty(process.getName())) {
+// buffer.append(" ");
+// String value = process.getName();
+// buffer.append("name=\"" + value + "\"");
+// }
}
}
- private boolean isEmpty(String str) {
- return str == null || "".equals(str);
- }
+// private boolean isEmpty(String str) {
+// return str == null || "".equals(str);
+// }
private void appendPadding(StringBuffer buffer, int level) {
for (int i = 0; i < level; i++) {
@@ -348,120 +555,120 @@
}
}
- @SuppressWarnings("unchecked")
private void appendClosing(StringBuffer buffer, Wrapper wrapper, int level) {
Element element = (Element)wrapper.getElement();
- ArrayList<Node> trailingNodeList = (ArrayList<Node>)element.getMetaData("trailingNodes");
- boolean appendTrailingNodes = trailingNodeList != null && !trailingNodeList.isEmpty();
- if (appendTrailingNodes) {
- appendNodeList(buffer, trailingNodeList);
- }
+// ArrayList<Node> trailingNodeList = (ArrayList<Node>)element.getMetaData("trailingNodes");
+// boolean appendTrailingNodes = trailingNodeList != null && !trailingNodeList.isEmpty();
+// if (appendTrailingNodes) {
+// appendNodeList(buffer, trailingNodeList);
+// }
if (element instanceof SequenceFlow) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</flow>");
} else if (element instanceof TerminateEndEvent) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</end>");
} else if (element instanceof ErrorEndEvent) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</end-error>");
} else if (element instanceof CancelEndEvent) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</end-cancel>");
} else if (element instanceof StartEvent) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
- buffer.append("</start>");
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
+ buffer.append("</start>");
} else if (element instanceof SuperState) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</super-state>");
} else if (element instanceof WaitTask) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</state>");
} else if (element instanceof HqlTask) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</hql>");
} else if (element instanceof SqlTask) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</sql>");
} else if (element instanceof JavaTask) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</java>");
} else if (element instanceof ScriptTask) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</script>");
} else if (element instanceof ServiceTask) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</esb>");
} else if (element instanceof HumanTask) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</task>");
} else if (element instanceof ExclusiveGateway) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</exclusive>");
} else if (element instanceof ForkParallelGateway) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</fork>");
} else if (element instanceof JoinParallelGateway) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</join>");
} else if (element instanceof Process) {
- if (!appendTrailingNodes) {
- buffer.append("\n");
- appendPadding(buffer, level);
- }
+// if (!appendTrailingNodes) {
+// buffer.append("\n");
+// appendPadding(buffer, level);
+// }
buffer.append("</process>");
}
}
- private void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
+ @SuppressWarnings("unchecked")
+ private void appendBody(StringBuffer buffer, Wrapper wrapper, int level) {
if (wrapper instanceof ContainerWrapper) {
ContainerWrapper containerWrapper = (ContainerWrapper)wrapper;
List<NodeWrapper> children = containerWrapper.getElements();
@@ -476,32 +683,41 @@
appendToBuffer(buffer, connectionWrapper, level+1);
}
}
- }
-
- private void appendNodeGraphics(StringBuffer buffer, NodeWrapper wrapper) {
- Rectangle constraint = wrapper.getConstraint();
- buffer.append(" g=\"");
- buffer.append(constraint.x);
- buffer.append(",");
- buffer.append(constraint.y);
- buffer.append(",");
- buffer.append(constraint.width);
- buffer.append(",");
- buffer.append(constraint.height);
- buffer.append("\"");
- }
-
- private void appendConnectionGraphics(StringBuffer buffer, ConnectionWrapper wrapper) {
- List<Point> bendPoints = wrapper.getBendpoints();
- if (bendPoints.size() == 0) return;
- buffer.append(" g=\"");
- for (int i = 0; i < bendPoints.size(); i++) {
- buffer.append(bendPoints.get(i).x);
- buffer.append(",");
- buffer.append(bendPoints.get(i).y);
- if (i < bendPoints.size() - 1) buffer.append(";");
+ Element element = (Element)wrapper.getElement();
+ ArrayList<Node> trailingNodeList = (ArrayList<Node>)element.getMetaData("trailingNodes");
+ boolean appendTrailingNodes = trailingNodeList != null && !trailingNodeList.isEmpty();
+ if (appendTrailingNodes) {
+ appendNodeList(buffer, trailingNodeList);
+ } else if (buffer.length() > 0){
+ buffer.append("\n");
+ appendPadding(buffer, level);
}
- buffer.append("\"");
}
+// private void appendNodeGraphics(StringBuffer buffer, NodeWrapper wrapper) {
+// Rectangle constraint = wrapper.getConstraint();
+// buffer.append(" g=\"");
+// buffer.append(constraint.x);
+// buffer.append(",");
+// buffer.append(constraint.y);
+// buffer.append(",");
+// buffer.append(constraint.width);
+// buffer.append(",");
+// buffer.append(constraint.height);
+// buffer.append("\"");
+// }
+//
+// private void appendConnectionGraphics(StringBuffer buffer, ConnectionWrapper wrapper) {
+// List<Point> bendPoints = wrapper.getBendpoints();
+// if (bendPoints.size() == 0) return;
+// buffer.append(" g=\"");
+// for (int i = 0; i < bendPoints.size(); i++) {
+// buffer.append(bendPoints.get(i).x);
+// buffer.append(",");
+// buffer.append(bendPoints.get(i).y);
+// if (i < bendPoints.size() - 1) buffer.append(";");
+// }
+// buffer.append("\"");
+// }
+//
}
15 years, 11 months
JBoss Tools SVN: r13174 - trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-01-21 18:10:50 -0500 (Wed, 21 Jan 2009)
New Revision: 13174
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
Log:
[JBIDE-3399] try Export-Package for both o.j.t.j.convert and o.j.t.j.convert.test, based on Denis' riddle (https://jira.jboss.org/jira/browse/JBIDE-3399?focusedCommentId=12449104#a...)
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2009-01-21 20:37:22 UTC (rev 13173)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2009-01-21 23:10:50 UTC (rev 13174)
@@ -15,3 +15,5 @@
org.osgi.framework
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %BundleProvider
+Export-Package: org.jboss.tools.jbpm.convert,
+ org.jboss.tools.jbpm.convert.test
15 years, 11 months
JBoss Tools SVN: r13173 - trunk/jmx/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-01-21 15:37:22 -0500 (Wed, 21 Jan 2009)
New Revision: 13173
Modified:
trunk/jmx/docs/reference/en/master.xml
Log:
missing modules removed from master.xml for JMX documentation to fix build error
Error
Failure reading file:/home/hudson/hudson_workspace/workspace/jbosstools-docs-nightly/jmx/docs/reference/en/master.xml: /home/hudson/hudson_workspace/workspace/jbosstools-docs-nightly/jmx/docs/reference/en/modules/mbean_explorer.xml (No such file or directory)
Modified: trunk/jmx/docs/reference/en/master.xml
===================================================================
--- trunk/jmx/docs/reference/en/master.xml 2009-01-21 20:30:32 UTC (rev 13172)
+++ trunk/jmx/docs/reference/en/master.xml 2009-01-21 20:37:22 UTC (rev 13173)
@@ -62,8 +62,8 @@
<toc/>
&introduction;
&mbean_editor;
- &mbean_explorer;
+<!-- &mbean_explorer;
&connection;
&how_to;
-
+-->
</book>
15 years, 11 months
JBoss Tools SVN: r13172 - trunk/jmx/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-01-21 15:30:32 -0500 (Wed, 21 Jan 2009)
New Revision: 13172
Modified:
trunk/jmx/docs/reference/en/master.xml
Log:
missing modules removed from master.xml for JMX documentation to fix build error
Error
Failure reading file:/home/hudson/hudson_workspace/workspace/jbosstools-docs-nightly/jmx/docs/reference/en/master.xml: /home/hudson/hudson_workspace/workspace/jbosstools-docs-nightly/jmx/docs/reference/en/modules/mbean_explorer.xml (No such file or directory)
Modified: trunk/jmx/docs/reference/en/master.xml
===================================================================
--- trunk/jmx/docs/reference/en/master.xml 2009-01-21 18:35:08 UTC (rev 13171)
+++ trunk/jmx/docs/reference/en/master.xml 2009-01-21 20:30:32 UTC (rev 13172)
@@ -4,12 +4,12 @@
[<!ENTITY introduction SYSTEM "modules/introduction.xml">
<!ENTITY mbean_editor SYSTEM "modules/mbean_editor.xml">
-<!ENTITY mbean_explorer SYSTEM "modules/mbean_explorer.xml">
+<!--ENTITY mbean_explorer SYSTEM "modules/mbean_explorer.xml">
<!ENTITY connection SYSTEM "modules/connection.xml">
<!ENTITY how_to SYSTEM "modules/how_to.xml">
-<!--ENTITY runtimes_servers SYSTEM "modules/runtimes_servers.xml">
+<!ENTITY runtimes_servers SYSTEM "modules/runtimes_servers.xml">
<!ENTITY perspective SYSTEM "modules/perspective.xml">
<!ENTITY webtools SYSTEM "modules/webtools.xml">
<!ENTITY modules SYSTEM "modules/modules.xml">
15 years, 11 months
JBoss Tools SVN: r13171 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.test: src/org/jboss/tools/jsf/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-01-21 13:35:08 -0500 (Wed, 21 Jan 2009)
New Revision: 13171
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3500
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2009-01-21 18:14:46 UTC (rev 13170)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2009-01-21 18:35:08 UTC (rev 13171)
@@ -4,5 +4,13 @@
Bundle-SymbolicName: org.jboss.tools.jsf.ui.test
Bundle-Version: 1.0.0
Bundle-Vendor: %Bundle-Vendor.0
-Require-Bundle: org.junit
+Require-Bundle: org.junit,
+ org.eclipse.core.resources;bundle-version="3.4.0",
+ org.jboss.tools.tests;bundle-version="2.0.0",
+ org.eclipse.core.runtime;bundle-version="3.4.0",
+ org.eclipse.jface;bundle-version="3.4.0",
+ org.jboss.tools.common.test;bundle-version="2.0.0",
+ org.eclipse.ui.workbench;bundle-version="3.4.0",
+ org.jboss.tools.jsf.ui;bundle-version="2.0.0",
+ org.jboss.tools.jst.web.ui;bundle-version="2.0.0"
Bundle-Localization: plugin
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -0,0 +1,31 @@
+package org.jboss.tools.jsf.ui.test;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
+import junit.framework.TestCase;
+
+public class CssClassNewWizardTest extends TestCase {
+ public void testCssClassNewWizardTestIsCreated() {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.jst.web.ui.wizards.newfile.NewCSSClassWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssClassNewWizardTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java 2009-01-21 18:14:46 UTC (rev 13170)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/CssFileNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -1,7 +1,31 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
import junit.framework.TestCase;
public class CssFileNewWizardTest extends TestCase {
- // FIXME See FacesConfigNewWizardTest as example
+ public void testCssFileNewWizardTestIsCreated() {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.jst.web.ui.wizards.newfile.NewCSSFileWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java 2009-01-21 18:14:46 UTC (rev 13170)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/FacesConfigNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -2,12 +2,74 @@
import junit.framework.TestCase;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+import org.jboss.tools.test.util.ResourcesUtils;
+
public class FacesConfigNewWizardTest extends TestCase {
+ private IProject project;
+// @Override
+// protected void setUp() throws Exception {
+// super.setUp();
+//
+// project = (IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("TestWizards");
+// if(project == null) {
+// ProjectImportTestSetup setup = new ProjectImportTestSetup(
+// this,
+// "org.jboss.tools.jsf.ui.test",
+// "projects/TestWizards",
+// "TestWizards");
+// project = setup.importProject();
+// }
+// this.project = project.getProject();
+//
+// JobUtils.waitForIdle();
+// }
+
+// @Override
+// protected void tearDown() throws Exception {
+// boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+// try {
+// JobUtils.waitForIdle();
+// if(project != null){
+// project.close(new NullProgressMonitor());
+// project.delete(true, new NullProgressMonitor());
+// project = null;
+// JobUtils.waitForIdle();
+// }
+// } finally {
+// ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+// }
+//
+// }
+
public void testNewFacesConfigNewWizardIsCreated() {
- // Assert wizard is created
- // Assert it is an instance of right class
- fail("Not implemented yet");
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.jsf.ui.wizard.newfile.NewFacesConfigFileWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
}
public void testFacesConfigNewWizardValidation() {
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -0,0 +1,31 @@
+package org.jboss.tools.jsf.ui.test;
+
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
+import junit.framework.TestCase;
+
+public class HtmlFileNewWizardTest extends TestCase {
+ public void testHtmlFileNewWizardTestIsCreated() {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.common.model.ui.wizard.newfile.NewHTMLFileWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/HtmlFileNewWizardTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.jsf.ui.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class JSFUiAllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("JSF UI tests");
+
+ suite.addTestSuite(CssClassNewWizardTest.class);
+ suite.addTestSuite(CssFileNewWizardTest.class);
+ suite.addTestSuite(FacesConfigNewWizardTest.class);
+ suite.addTestSuite(FasesConfigEditorTest.class);
+ suite.addTestSuite(HtmlFileNewWizardTest.class);
+ suite.addTestSuite(JsFileNewWizardTest.class);
+ suite.addTestSuite(JspFileNewWizardTest.class);
+ suite.addTestSuite(PropertiesNewWizardTest.class);
+ suite.addTestSuite(XhtmlFileNewWizardTest.class);
+
+ return suite;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFUiAllTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java 2009-01-21 18:14:46 UTC (rev 13170)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsFileNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -1,7 +1,31 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
import junit.framework.TestCase;
public class JsFileNewWizardTest extends TestCase {
- // FIXME See FacesConfigNewWizardTest as example
+ public void testJsFileNewWizardTestIsCreated() {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.jst.web.ui.wizards.newfile.NewJSFileWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java 2009-01-21 18:14:46 UTC (rev 13170)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JspFileNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -1,7 +1,31 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
import junit.framework.TestCase;
public class JspFileNewWizardTest extends TestCase {
- // FIXME See FacesConfigNewWizardTest as example
+ public void testJspFileNewWizardTestIsCreated() {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.common.model.ui.wizard.newfile.NewJSPFileWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java 2009-01-21 18:14:46 UTC (rev 13170)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/PropertiesNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -1,7 +1,31 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
import junit.framework.TestCase;
public class PropertiesNewWizardTest extends TestCase {
- // FIXME See FacesConfigNewWizardTest as example
+ public void testPropertiesFileNewWizardTestIsCreated() {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.common.model.ui.wizard.newfile.NewPropertiesFileWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java 2009-01-21 18:14:46 UTC (rev 13170)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/XhtmlFileNewWizardTest.java 2009-01-21 18:35:08 UTC (rev 13171)
@@ -1,7 +1,31 @@
package org.jboss.tools.jsf.ui.test;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.util.WorkbenchUtils;
+
import junit.framework.TestCase;
public class XhtmlFileNewWizardTest extends TestCase {
- // FIXME See FacesConfigNewWizardTest as example
+ public void testXhtmlFileNewWizardTestIsCreated() {
+ IWizard
+ aWizard = WorkbenchUtils.findWizardByDefId("org.jboss.tools.common.model.ui.wizard.newfile.NewXHTMLFileWizard");
+
+ WizardDialog dialog = new WizardDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ aWizard);
+ dialog.setBlockOnOpen(false);
+ dialog.open();
+ try {
+ IWizardPage startPage = aWizard.getStartingPage();
+ assertNotNull(startPage);
+ }catch(Exception ex){
+ fail(ex.getMessage());
+ } finally {
+ dialog.close();
+ }
+
+ }
}
15 years, 11 months
JBoss Tools SVN: r13170 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2009-01-21 13:14:46 -0500 (Wed, 21 Jan 2009)
New Revision: 13170
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
jboss.org/jira/browse/JBDS-421
The information about the Template Designer is updated.
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-01-21 18:14:18 UTC (rev 13169)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-01-21 18:14:46 UTC (rev 13170)
@@ -1103,7 +1103,7 @@
<para>To call the <property>Template dialog</property> for a tag, right-click on it in
Visual mode and select <emphasis>
- <property>Template</property>
+ <property>Setup Template for <tag name></property>
</emphasis> option.</para>
<figure>
15 years, 11 months