diff options
author | Bob Brodt | 2015-02-05 06:57:39 +0000 |
---|---|---|
committer | Bob Brodt | 2015-02-05 06:57:39 +0000 |
commit | 5fff7f216e9665cd3f1b4b4a3870cd592b7312df (patch) | |
tree | 38d7e8ed2e945a59e82d8af65cb8ad6520813a09 | |
parent | 86f98e4f509a596aff654a6d9d0d5bdf5f74f7a0 (diff) | |
download | org.eclipse.bpmn2-modeler-5fff7f216e9665cd3f1b4b4a3870cd592b7312df.tar.gz org.eclipse.bpmn2-modeler-5fff7f216e9665cd3f1b4b4a3870cd592b7312df.tar.xz org.eclipse.bpmn2-modeler-5fff7f216e9665cd3f1b4b4a3870cd592b7312df.zip |
All this stuff backported from Luna:
https://bugzilla.redhat.com/show_bug.cgi?id=1134711 - Using JBDS process
designer, user can set boundary error event without validation error,
but the process will throw Exception at runtime
Bug 454749 - Wrong Target Runtime is selected if a project does not
define one. This was STILL not working.
Bug 459185 - Problem messages are duplicated if WST Validation Builder
is installed
https://bugzilla.redhat.com/show_bug.cgi?id=1188165 - Call Activity -
Wait For Completion Attribute should be validate before running the
process in BPMN 2 Diagram Editor
https://bugzilla.redhat.com/show_bug.cgi?id=1188870 - BPMN2 files
created with Web Designer can not be saved from Eclipse editor
https://bugzilla.redhat.com/show_bug.cgi?id=1179075 - Modeler
automatically change an input charactor to '_'. Handle the case of
invalid character(s) pasted into field.
https://bugzilla.redhat.com/show_bug.cgi?id=1188909 - Interface Details
Implementation Attribute should be validated by Java package naming rule
in BPMN2 Diagram Editor
https://bugzilla.redhat.com/show_bug.cgi?id=1168413 - BPMN2 process
designed in Eclipse tooling plug-in/jBPM Web Designer does not generate
the Assignment in dataInputAssociation for Skippable property for a User
Task by default
48 files changed, 628 insertions, 190 deletions
diff --git a/org.eclipse.bpmn2.modeler.core/OSGI-INF/l10n/bundle.properties b/org.eclipse.bpmn2.modeler.core/OSGI-INF/l10n/bundle.properties index fa083402..6cc7da51 100644 --- a/org.eclipse.bpmn2.modeler.core/OSGI-INF/l10n/bundle.properties +++ b/org.eclipse.bpmn2.modeler.core/OSGI-INF/l10n/bundle.properties @@ -8,9 +8,9 @@ constraint.message.live = {0} constraint.name.batch = Batch Validation Error constraint.description.batch = Batch Validation Errors constraint.message.batch = {0} -extension.name = BPMN 2.0 Project Validator -extension.name.0 = Core BPMN 2.0 Problem -extension.name.1 = BPMN2 Validation Builder -extension.name.2 = BPMN2 Project Nature -extension.name.3 = XML Problem +BPMN2Validator.name = BPMN 2.0 Validator +BPMN2ProblemMarker.name = Core BPMN 2.0 Problem +BPMN2Builder.name = BPMN2 Builder +BPMN2Nature.name = BPMN2 Project Nature +XMLProblem.name = XML Problem extension-point.name = BPMN2 Modeler Runtime Specialization
\ No newline at end of file diff --git a/org.eclipse.bpmn2.modeler.core/plugin.xml b/org.eclipse.bpmn2.modeler.core/plugin.xml index 52cedbd1..838fe461 100644 --- a/org.eclipse.bpmn2.modeler.core/plugin.xml +++ b/org.eclipse.bpmn2.modeler.core/plugin.xml @@ -103,11 +103,14 @@ <extension id="org.eclipse.bpmn2.modeler.core.projectValidator" - name="%extension.name" + name="%BPMN2Validator.name" point="org.eclipse.wst.validation.validatorV2"> <validator class="org.eclipse.bpmn2.modeler.core.validation.BPMN2ProjectValidator" markerId="org.eclipse.bpmn2.modeler.core.problemMarker"> + <projectNature + id="org.eclipse.bpmn2.modeler.core.bpmn2Nature"> + </projectNature> <include> <rules> <contentType @@ -135,7 +138,7 @@ <extension id="org.eclipse.bpmn2.modeler.core.problemMarker" - name="%extension.name.0" + name="%BPMN2ProblemMarker.name" point="org.eclipse.core.resources.markers"> <persistent value="true"> @@ -147,7 +150,7 @@ <extension id="org.eclipse.bpmn2.modeler.core.bpmn2Builder" - name="%extension.name.1" + name="%BPMN2Builder.name" point="org.eclipse.core.resources.builders"> <builder hasNature="true"> @@ -158,7 +161,7 @@ </extension> <extension id="org.eclipse.bpmn2.modeler.core.bpmn2Nature" - name="%extension.name.2" + name="%BPMN2Nature.name" point="org.eclipse.core.resources.natures"> <runtime> <run @@ -171,7 +174,7 @@ </extension> <extension id="xmlProblem" - name="%extension.name.3" + name="%XMLProblem.name" point="org.eclipse.core.resources.markers"> <super type="org.eclipse.core.resources.problemmarker"> diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/LifecycleEvent.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/LifecycleEvent.java index 13bef17e..bd5aa3c3 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/LifecycleEvent.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/LifecycleEvent.java @@ -13,6 +13,7 @@ package org.eclipse.bpmn2.modeler.core; +import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime; import org.eclipse.bpmn2.modeler.core.utils.BusinessObjectUtil; import org.eclipse.emf.ecore.EObject; import org.eclipse.graphiti.features.IFeatureProvider; @@ -443,6 +444,20 @@ public class LifecycleEvent { this.target = target; } + public static void notify(EventType eventType, Object target) { + if (target!=null) { + notify(new LifecycleEvent(eventType, target)); + } + } + + /** + * @param lifecycleEvent + */ + public static void notify(LifecycleEvent lifecycleEvent) { + TargetRuntime rt = TargetRuntime.getCurrentRuntime(); + rt.notify(lifecycleEvent); + } + @Override public String toString() { String s = "Event: "+eventType; diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Builder.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Builder.java index b251c379..415898ea 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Builder.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Builder.java @@ -113,11 +113,14 @@ public class BPMN2Builder extends IncrementalProjectBuilder { } void validate(IResourceDelta delta, IProgressMonitor monitor) { - BPMN2ProjectValidator.validate(delta, monitor); + // This project builder should not be doing validation. + // Validation is being handled by the Eclipse Validation Builder + // and can be enabled/disabled from the User Preferences -> Validation page. +// BPMN2ProjectValidator.validate(delta, monitor); } void validate(IResource resource, IProgressMonitor monitor) { - BPMN2ProjectValidator.validate(resource, monitor); +// BPMN2ProjectValidator.validate(resource, monitor); } protected void fullBuild(final IProgressMonitor monitor) diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Nature.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Nature.java index a6aeaf2c..1f13cda2 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Nature.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/builder/BPMN2Nature.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; public class BPMN2Nature implements IProjectNature { - /** - * ID of this project nature - */ + /** BPMN2 Project Nature ID **/ public static final String NATURE_ID = "org.eclipse.bpmn2.modeler.core.bpmn2Nature"; //$NON-NLS-1$ + /** WST Validation Builder ID **/ + public static final String WST_VALIDATION_BUILDER_ID = "org.eclipse.wst.validation.validationbuilder"; //$NON-NLS-1$ private IProject project; @@ -31,34 +31,85 @@ public class BPMN2Nature implements IProjectNature { * @see org.eclipse.core.resources.IProjectNature#configure() */ public void configure() throws CoreException { - IProjectDescription desc = project.getDescription(); - ICommand[] commands = desc.getBuildSpec(); + if (!project.hasNature(BPMN2Nature.NATURE_ID)) { + // Add the nature + IProjectDescription description = project.getDescription(); + String[] natures = description.getNatureIds(); + String[] newNatures = new String[natures.length + 1]; + System.arraycopy(natures, 0, newNatures, 0, natures.length); + newNatures[natures.length] = BPMN2Nature.NATURE_ID; + description.setNatureIds(newNatures); + project.setDescription(description, null); + } + configureBuilder(BPMN2Builder.BUILDER_ID); + // We need the WST validation builder as well + configureBuilder(WST_VALIDATION_BUILDER_ID); + } - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(BPMN2Builder.BUILDER_ID)) { - return; + public static boolean hasBuilder(IProject project, String builderId) { + try { + IProjectDescription desc = project.getDescription(); + ICommand[] commands = desc.getBuildSpec(); + + for (int i = 0; i < commands.length; ++i) { + if (commands[i].getBuilderName().equals(builderId)) { + return true; + } } } - - ICommand[] newCommands = new ICommand[commands.length + 1]; - System.arraycopy(commands, 0, newCommands, 0, commands.length); - ICommand command = desc.newCommand(); - command.setBuilderName(BPMN2Builder.BUILDER_ID); - newCommands[newCommands.length - 1] = command; - desc.setBuildSpec(newCommands); - project.setDescription(desc, null); + catch (CoreException e) { + } + return false; } - + + private void configureBuilder(String builderId) throws CoreException { + if (!hasBuilder(project, builderId)) { + IProjectDescription desc = project.getDescription(); + ICommand[] commands = desc.getBuildSpec(); + ICommand[] newCommands = new ICommand[commands.length + 1]; + System.arraycopy(commands, 0, newCommands, 0, commands.length); + ICommand command = desc.newCommand(); + command.setBuilderName(builderId); + newCommands[newCommands.length - 1] = command; + desc.setBuildSpec(newCommands); + project.setDescription(desc, null); + project.refreshLocal(IProject.DEPTH_INFINITE, null); + } + } + /* * (non-Javadoc) * * @see org.eclipse.core.resources.IProjectNature#deconfigure() */ public void deconfigure() throws CoreException { + if (project.hasNature(BPMN2Nature.NATURE_ID)) { + IProjectDescription description = project.getDescription(); + String[] natures = description.getNatureIds(); + for (int i = 0; i < natures.length; ++i) { + if (BPMN2Nature.NATURE_ID.equals(natures[i])) { + // Remove the nature + String[] newNatures = new String[natures.length - 1]; + System.arraycopy(natures, 0, newNatures, 0, i); + System.arraycopy(natures, i + 1, newNatures, i, + natures.length - i - 1); + description.setNatureIds(newNatures); + project.setDescription(description, null); + return; + } + } + } + deconfigureBuilder(BPMN2Builder.BUILDER_ID); + // Don't remove WST validation builder. + // Validation is enabled/disabled by the Project or Global + // User Preferences UI. + } + + private void deconfigureBuilder(String builderId) throws CoreException { IProjectDescription description = getProject().getDescription(); ICommand[] commands = description.getBuildSpec(); for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(BPMN2Builder.BUILDER_ID)) { + if (commands[i].getBuilderName().equals(builderId)) { ICommand[] newCommands = new ICommand[commands.length - 1]; System.arraycopy(commands, 0, newCommands, 0, i); System.arraycopy(commands, i + 1, newCommands, i, @@ -69,7 +120,6 @@ public class BPMN2Nature implements IProjectNature { } } } - /* * (non-Javadoc) * @@ -87,5 +137,16 @@ public class BPMN2Nature implements IProjectNature { public void setProject(IProject project) { this.project = project; } - + + public static void setBPMN2Nature(IProject project, boolean enable) { + try { + BPMN2Nature nature = new BPMN2Nature(); + nature.setProject(project); + if (enable) + nature.configure(); + else + nature.deconfigure(); + } catch (CoreException e) { + } + } } diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java index 437d5b25..ec13e045 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/clad/AbstractDetailComposite.java @@ -423,7 +423,7 @@ public abstract class AbstractDetailComposite extends ListAndDetailCompositeBase } protected void bindAttribute(Composite parent, EObject object, EAttribute attribute) { - bindAttribute(parent,object,attribute,null); + bindAttribute(parent,object,attribute,ModelUtil.getLabel(object, attribute)); } protected void bindAttribute(Composite parent, EObject object, EAttribute attribute, String label) { diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/BooleanObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/BooleanObjectEditor.java index a254cce0..66eb779a 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/BooleanObjectEditor.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/BooleanObjectEditor.java @@ -96,7 +96,7 @@ public class BooleanObjectEditor extends ObjectEditor { super.notifyChanged(notification); if ( notification.getEventType() == -1 || (object == notification.getNotifier() && feature == notification.getFeature())) { - Object value = object.eGet(feature); + Object value = getValue(); if (value==null) { value = Boolean.FALSE; } diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ComboObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ComboObjectEditor.java index 2716d141..502141bd 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ComboObjectEditor.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ComboObjectEditor.java @@ -255,7 +255,7 @@ public class ComboObjectEditor extends MultivalueObjectEditor { } @Override - protected boolean setValue(Object result) { + public boolean setValue(Object result) { keyPressed = false; return super.setValue(result); } diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/JavaPackageNameObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/JavaPackageNameObjectEditor.java new file mode 100644 index 00000000..700c196a --- /dev/null +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/JavaPackageNameObjectEditor.java @@ -0,0 +1,94 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 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 + * + * @author Bob Brodt + ******************************************************************************/ + +package org.eclipse.bpmn2.modeler.core.merrimac.dialogs; + +import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite; +import org.eclipse.bpmn2.modeler.core.validation.SyntaxCheckerUtils; +import org.eclipse.core.databinding.observable.value.IObservableValue; +import org.eclipse.core.databinding.observable.value.IValueChangeListener; +import org.eclipse.core.databinding.observable.value.ValueChangeEvent; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.jface.databinding.swt.SWTObservables; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.VerifyEvent; +import org.eclipse.swt.events.VerifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; + +/** + * @author Bob Brodt + * + */ +public class JavaPackageNameObjectEditor extends TextObjectEditor { + + /** + * @param parent + * @param object + * @param feature + */ + public JavaPackageNameObjectEditor(AbstractDetailComposite parent, EObject object, EStructuralFeature feature) { + super(parent, object, feature); + } + + /* (non-Javadoc) + * @see org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor#createControl(org.eclipse.swt.widgets.Composite, java.lang.String) + */ + @Override + protected Control createControl(Composite composite, String label, int style) { + createLabel(composite,label); + + text = getToolkit().createText(composite, ""); //$NON-NLS-1$ + text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); + text.addVerifyListener(new VerifyListener() { + + /** + * taken from + * http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets + * /Snippet19.java?view=co + */ + @Override + public void verifyText(VerifyEvent e) { + if (Character.isISOControl(e.character)) { + if (e.text==null || e.text.isEmpty()) + return; + } + String s = getValue() + e.text; + e.doit = SyntaxCheckerUtils.isJavaPackageName(s); + if (!e.doit) { + showErrorMessage(NLS.bind(Messages.JavaPackageNameObjectEditor_Invalid_Character, e.text)); + } + } + }); + + updateText(); + + IObservableValue textObserveTextObserveWidget = SWTObservables.observeText(text, SWT.Modify); + textObserveTextObserveWidget.addValueChangeListener(new IValueChangeListener() { + @Override + public void handleValueChange(ValueChangeEvent event) { + + String s = text.getText(); + if (!getValue().equals(s)) { + setValue(s); + } + } + }); + + + return text; + } +} diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/JavaVariableNameObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/JavaVariableNameObjectEditor.java index b5c3bdb4..4eab8f38 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/JavaVariableNameObjectEditor.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/JavaVariableNameObjectEditor.java @@ -21,6 +21,7 @@ import org.eclipse.core.databinding.observable.value.ValueChangeEvent; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.jface.databinding.swt.SWTObservables; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.events.VerifyListener; @@ -62,12 +63,13 @@ public class JavaVariableNameObjectEditor extends TextObjectEditor { @Override public void verifyText(VerifyEvent e) { if (Character.isISOControl(e.character)) { - return; + if (e.text==null || e.text.isEmpty()) + return; } String s = getValue() + e.text; e.doit = SyntaxCheckerUtils.isJavaIdentifier(s); if (!e.doit) { - showErrorMessage("The character '"+e.text+"' is not valid"); + showErrorMessage(NLS.bind(Messages.JavaVariableNameObjectEditor_Invalid_Character, e.text)); } } }); diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/Messages.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/Messages.java index d825cace..ce7661e9 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/Messages.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/Messages.java @@ -19,7 +19,10 @@ public class Messages extends NLS { public static String FeatureEditingDialog_Create; public static String FeatureEditingDialog_Edit; public static String FeatureListObjectEditor_Title; + public static String JavaVariableNameObjectEditor_Invalid_Character; + public static String JavaPackageNameObjectEditor_Invalid_Character; public static String ModelSubclassSelectionDialog_Title; + public static String NCNameObjectEditor_Invalid_Character; public static String ObjectEditingDialog_Create; public static String ObjectEditingDialog_Edit; public static String ObjectEditor_No_Description; diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/NCNameObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/NCNameObjectEditor.java index 587d4d6d..bb8dd2fa 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/NCNameObjectEditor.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/NCNameObjectEditor.java @@ -13,10 +13,7 @@ package org.eclipse.bpmn2.modeler.core.merrimac.dialogs; -import java.math.BigInteger; - import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite; -import org.eclipse.bpmn2.modeler.core.utils.ErrorUtils; import org.eclipse.bpmn2.modeler.core.validation.SyntaxCheckerUtils; import org.eclipse.core.databinding.observable.value.IObservableValue; import org.eclipse.core.databinding.observable.value.IValueChangeListener; @@ -24,9 +21,8 @@ import org.eclipse.core.databinding.observable.value.ValueChangeEvent; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.jface.databinding.swt.SWTObservables; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.events.VerifyListener; import org.eclipse.swt.layout.GridData; @@ -66,12 +62,14 @@ public class NCNameObjectEditor extends TextObjectEditor { */ @Override public void verifyText(VerifyEvent e) { - if (Character.isISOControl(e.character)) - return; + if (Character.isISOControl(e.character)) { + if (e.text==null || e.text.isEmpty()) + return; + } String s = getValue() + e.text; e.doit = SyntaxCheckerUtils.isNCName(s); if (!e.doit) { - showErrorMessage("The character '"+e.text+"' is not valid"); + showErrorMessage(NLS.bind(Messages.NCNameObjectEditor_Invalid_Character, e.text)); } } }); diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ObjectEditor.java index 87e745f4..d2a97a90 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ObjectEditor.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/ObjectEditor.java @@ -286,7 +286,7 @@ public abstract class ObjectEditor implements INotifyChangedListener { } } - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain(); boolean success = ModelUtil.setValue(domain, object, feature, result); if (!success) { diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextObjectEditor.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextObjectEditor.java index d6f8cce6..9e4b9ed7 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextObjectEditor.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/TextObjectEditor.java @@ -121,7 +121,7 @@ public class TextObjectEditor extends ObjectEditor { * @see org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor#setValue(java.lang.Object) */ @Override - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { if (super.setValue(result)) { updateText(); diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/messages.properties b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/messages.properties index 76af09b8..460aa635 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/messages.properties +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/merrimac/dialogs/messages.properties @@ -13,7 +13,10 @@ AbstractObjectEditingDialog_Commit_Error_Title=An error occurred while trying to FeatureEditingDialog_Create=Create New {0} FeatureEditingDialog_Edit=Edit {0} FeatureListObjectEditor_Title=Select elements +JavaVariableNameObjectEditor_Invalid_Character=The characters "{0}" are not valid +JavaPackageNameObjectEditor_Invalid_Character=The characters "{0}" are not valid ModelSubclassSelectionDialog_Title=Select a type of {0} +NCNameObjectEditor_Invalid_Character=The characters "{0}" are not valid ObjectEditingDialog_Create=Create New {0} ObjectEditingDialog_Edit=Edit {0} ObjectEditor_No_Description=No description for {0} diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/Bpmn2Preferences.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/Bpmn2Preferences.java index 70c96120..c57abb67 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/Bpmn2Preferences.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/Bpmn2Preferences.java @@ -316,9 +316,7 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang //////////////////////////////////////////////////////////////////////////////// private void loadDefaults() { - if (defaultPreferences.get(PREF_TARGET_RUNTIME, null)==null) { - String rid = TargetRuntime.getFirstNonDefaultId(); - defaultPreferences.put(PREF_TARGET_RUNTIME, rid); + if (!keyExists(defaultPreferences,PREF_SHOW_ADVANCED_PROPERTIES)) { defaultPreferences.putBoolean(PREF_SHOW_ADVANCED_PROPERTIES, false); defaultPreferences.putBoolean(PREF_CHECK_PROJECT_NATURE, true); defaultPreferences.putBoolean(PREF_SIMPLIFY_LISTS, true); @@ -405,6 +403,11 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang projectPreferences.node(key); return true; } + if (PREF_CHECK_PROJECT_NATURE.equals(key)) + return true; + if (PREF_TARGET_RUNTIME.equals(key)) + return true; + // otherwise only save to project preferences if the key already exists. try { return projectPreferences.nodeExists(key); @@ -425,9 +428,9 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang private void cache() { if (!cached) { // cache all preferences as Bpmn2Preferences instance variables for faster access - String id = get(PREF_TARGET_RUNTIME,TargetRuntime.getDefaultRuntime().getId()); + String id = get(PREF_TARGET_RUNTIME,null); if (id==null || id.isEmpty()) - id = TargetRuntime.getFirstNonDefaultId(); + id = TargetRuntime.getCurrentRuntime().getId(); targetRuntime = TargetRuntime.getRuntime(id); showAdvancedPropertiesTab = getBoolean(PREF_SHOW_ADVANCED_PROPERTIES, false); showDescriptions = getBoolean(PREF_SHOW_DESCRIPTIONS, false); @@ -465,7 +468,6 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang } } else { - put(PREF_TARGET_RUNTIME,getRuntime().getId()); putBoolean(PREF_SHOW_ADVANCED_PROPERTIES, showAdvancedPropertiesTab); putBoolean(PREF_SHOW_DESCRIPTIONS, showDescriptions); putBoolean(PREF_SHOW_ID_ATTRIBUTE, showIdAttribute); @@ -841,7 +843,7 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang Display.getDefault().asyncExec( new Runnable() { @Override public void run() { - String id = get(PREF_TARGET_RUNTIME,TargetRuntime.getFirstNonDefaultId()); + String id = get(PREF_TARGET_RUNTIME,null); if (id==null || id.isEmpty()) id = TargetRuntime.getFirstNonDefaultId(); @@ -867,6 +869,12 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang Assert.isTrue(rt!=null); put(PREF_TARGET_RUNTIME, rt.getId()); targetRuntime = rt; + try { + projectPreferences.flush(); + } catch (BackingStoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } public boolean getShowAdvancedPropertiesTab() { @@ -897,12 +905,19 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang } public boolean getCheckProjectNature() { + checkProjectNature = getBoolean(PREF_CHECK_PROJECT_NATURE, false); return checkProjectNature; } public void setCheckProjectNature(boolean show) { putBoolean(PREF_CHECK_PROJECT_NATURE, show); checkProjectNature = show; + try { + projectPreferences.flush(); + } catch (BackingStoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } public boolean getSimplifyLists() { @@ -1517,21 +1532,21 @@ public class Bpmn2Preferences implements IResourceChangeListener, IPropertyChang public void putInt(int value) { put(Integer.toString(value)); } - - private boolean keyExists(Preferences prefs, String key) { - try { - for (String k : prefs.keys()) { - if (k.equals(key)) { - return true; - } + } + + public boolean keyExists(Preferences prefs, String key) { + try { + for (String k : prefs.keys()) { + if (k.equals(key)) { + return true; } } - catch (BackingStoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return false; } + catch (BackingStoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return false; } public boolean getBoolean(String key, boolean defaultValue) { diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java index 43425f6d..6e10a29d 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java @@ -42,6 +42,7 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; import org.eclipse.graphiti.ui.editor.DiagramEditor; +import org.eclipse.ui.IEditorInput; public class TargetRuntime extends AbstractPropertyChangeListenerProvider { @@ -95,22 +96,64 @@ public class TargetRuntime extends AbstractPropertyChangeListenerProvider { return null; } - public static TargetRuntime getCurrentRuntime() { - return currentRuntime; - } - + public static TargetRuntime getRuntime(IEditorInput input) { + TargetRuntime runtime = null; + if (input!=null) { + // If the project has not been configured for a specific runtime through the "BPMN2" + // project properties page (i.e. the target is "None") then allow the runtime extension + // plug-ins an opportunity to identify the given process file contents as their own. + // If none of the plug-ins respond with "yes, this file is targeted for my runtime", + // then use the "None" as the extension. This will configure the BPMN2 Modeler with + // generic property sheets and other default behavior. + runtime = null; + for (TargetRuntime rt : TargetRuntime.getAllRuntimes()) { + if (rt.getRuntimeExtension().isContentForRuntime(input)) { + runtime = rt; + break; + } + } + if (runtime==null) + runtime = getDefaultRuntime(); + } + return runtime; + } + + /** + * Set the current TargetRuntime. + * This is called by a BPMN2 Editor when it becomes the active editor. + * + * @param rt + */ public static void setCurrentRuntime(TargetRuntime rt) { currentRuntime = rt; } + /** + * Return the current TargetRuntime. + * This can be used by any UI component that belongs to the currently active BPMN2 Editor + * + * @return + */ + public static TargetRuntime getCurrentRuntime() { + if (currentRuntime==null) + return getDefaultRuntime(); + return currentRuntime; + } + + /** + * Returns the "None" TargetRuntime definition. + * + * @return + */ public static TargetRuntime getDefaultRuntime() { return getRuntime(DEFAULT_RUNTIME_ID); } /** + * Returns the first TargetRuntime which is not the "None", or "default" runtime. + * If there are no other TargetRuntime extension plugins loaded, this returns the default runtime. * - * @return the first runtime which is non default, if there are more than on runtime or if there is only the default runtime - * return the DEFAULT_RUNTIME_ID + * @return */ public static String getFirstNonDefaultId(){ String runtimeId = null; diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java index 87da2f25..b99fd36e 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/utils/ModelUtil.java @@ -1036,6 +1036,7 @@ public class ModelUtil { } }; + value = SyntaxCheckerUtils.toXMLString(value); de.eSetClass(EcorePackage.eINSTANCE.getEObject()); de.eSetProxyURI(URI.createURI(value)); return de; diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/BPMN2ProjectValidator.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/BPMN2ProjectValidator.java index 736fa5db..1e6ad6c5 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/BPMN2ProjectValidator.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/BPMN2ProjectValidator.java @@ -15,17 +15,16 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.bpmn2.modeler.core.Activator; +import org.eclipse.bpmn2.modeler.core.ProxyURIConverterImplExtension; import org.eclipse.bpmn2.modeler.core.adapters.ExtendedPropertiesAdapter; import org.eclipse.bpmn2.modeler.core.builder.BPMN2Nature; import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceImpl; import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceSetImpl; -import org.eclipse.bpmn2.modeler.core.ProxyURIConverterImplExtension; import org.eclipse.bpmn2.modeler.core.preferences.Bpmn2Preferences; import org.eclipse.bpmn2.modeler.core.runtime.TargetRuntime; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IProjectNature; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceDelta; @@ -57,7 +56,9 @@ import org.eclipse.jface.dialogs.MessageDialogWithToggle; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorInput; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.FileEditorInput; import org.eclipse.wst.validation.AbstractValidator; import org.eclipse.wst.validation.ValidationEvent; import org.eclipse.wst.validation.ValidationFramework; @@ -68,12 +69,10 @@ import org.eclipse.wst.validation.ValidatorMessage; public class BPMN2ProjectValidator extends AbstractValidator { - private Bpmn2Preferences preferences; - private TargetRuntime targetRuntime; private IFile modelFile; @Override - public ValidationResult validate(ValidationEvent event, ValidationState state, IProgressMonitor monitor) { + public synchronized ValidationResult validate(ValidationEvent event, ValidationState state, IProgressMonitor monitor) { IResource file = event.getResource(); if ((event.getKind() & IResourceDelta.REMOVED) != 0 || file.isDerived(IResource.CHECK_ANCESTORS) @@ -187,14 +186,16 @@ public class BPMN2ProjectValidator extends AbstractValidator { if (project!=null) { try { - IProjectNature nature = project.getNature(BPMN2Nature.NATURE_ID); - if (nature==null) { - Bpmn2Preferences preferences = Bpmn2Preferences.getInstance(project); + // The BPMN2 Project Nature will allow the editor to dynamically + // reload configuration files (a.k.a. extensions) from ".bpmn2config" + IProjectNature bpmn2Nature = project.getNature(BPMN2Nature.NATURE_ID); + Bpmn2Preferences preferences = Bpmn2Preferences.getInstance(project); + if (bpmn2Nature==null) { if (preferences.getCheckProjectNature()) { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); String title = Messages.BPMN2ProjectValidator_Title; String message = NLS.bind( - Messages.BPMN2ProjectValidator_No_Project_Nature, + Messages.BPMN2ProjectValidator_No_BPMN2_Project_Nature, project.getName() ); MessageDialogWithToggle result = MessageDialogWithToggle.open( @@ -208,13 +209,7 @@ public class BPMN2ProjectValidator extends AbstractValidator { null, // pref key SWT.NONE); if (result.getReturnCode() == IDialogConstants.YES_ID) { - IProjectDescription description = project.getDescription(); - String[] natures = description.getNatureIds(); - String[] newNatures = new String[natures.length + 1]; - System.arraycopy(natures, 0, newNatures, 0, natures.length); - newNatures[natures.length] = BPMN2Nature.NATURE_ID; - description.setNatureIds(newNatures); - project.setDescription(description, null); + BPMN2Nature.setBPMN2Nature(project, true); needValidation = true; } if (result.getToggleState()) { @@ -223,21 +218,38 @@ public class BPMN2ProjectValidator extends AbstractValidator { } } } - else - needValidation = true; + + // The WST Validation Builder is required to do BPMN2 model validation + boolean hasWSTBuilder = BPMN2Nature.hasBuilder(project, BPMN2Nature.WST_VALIDATION_BUILDER_ID); + if (!hasWSTBuilder) { +// if (preferences.getCheckProjectNature()) + { + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); + String title = Messages.BPMN2ProjectValidator_Title; + String message = NLS.bind( + Messages.BPMN2ProjectValidator_No_WST_Project_Builder, + project.getName() + ); + boolean result = MessageDialog.open( + MessageDialog.QUESTION, + shell, + title, + message, + SWT.NONE); + if (result) { + BPMN2Nature.setBPMN2Nature(project, true); + needValidation = true; + } + } + } } catch (CoreException e) { e.printStackTrace(); } } - - if (needValidation) { - // validation will be done by the Project Validation builder - return true; - } } - return false; + return needValidation; } public void processStatus(IStatus status, IResource resource, ValidationResult result) { @@ -305,22 +317,8 @@ public class BPMN2ProjectValidator extends AbstractValidator { } protected TargetRuntime getTargetRuntime() { -// if (targetRuntime==null) - targetRuntime = getPreferences().getRuntime(); - return targetRuntime; - } - - protected Bpmn2Preferences getPreferences() { -// if (preferences==null) - { - Assert.isTrue(modelFile!=null); - IProject project = modelFile.getProject(); - loadPreferences(project); - } - return preferences; - } - - protected void loadPreferences(IProject project) { - preferences = Bpmn2Preferences.getInstance(project); + Assert.isTrue(modelFile!=null); + IEditorInput input = new FileEditorInput(modelFile); + return TargetRuntime.getRuntime(input); } } diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/Messages.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/Messages.java index a3a665b4..ee962d96 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/Messages.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/Messages.java @@ -14,11 +14,11 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.bpmn2.modeler.core.validation.messages"; //$NON-NLS-1$ - public static String BPMN2ProjectValidator_No_Project_Nature; + public static String BPMN2ProjectValidator_No_BPMN2_Project_Nature; + public static String BPMN2ProjectValidator_No_WST_Project_Builder; public static String BPMN2ProjectValidator_Dont_Ask_Again; public static String BPMN2ProjectValidator_Invalid_File; public static String BPMN2ProjectValidator_Title; - public static String LiveValidationListener_Title; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/SyntaxCheckerUtils.java b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/SyntaxCheckerUtils.java index 12a998b4..1f3e1dd0 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/SyntaxCheckerUtils.java +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/SyntaxCheckerUtils.java @@ -121,7 +121,7 @@ public class SyntaxCheckerUtils { public static boolean isJavaPackageName(String name) { if (name==null || name.isEmpty()) return false; - for (String part : name.split("\\.")) { + for (String part : name.split("\\.")) { //$NON-NLS-1$ if (!isJavaIdentifier(part)) return false; } diff --git a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/messages.properties b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/messages.properties index b86fd1c1..06bbc983 100644 --- a/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/messages.properties +++ b/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/validation/messages.properties @@ -8,8 +8,14 @@ # Contributors: # Red Hat, Inc. - initial API and implementation #------------------------------------------------------------------------------- -BPMN2ProjectValidator_No_Project_Nature=The project "{0}" has not been configured with the BPMN2 Project Nature.\n\nAdding the BPMN2 Project Nature will cause all BPMN2 files in this project to be validated automatically whenever the project is built.\n\nDo you want to add this Nature to the Project now? +BPMN2ProjectValidator_No_BPMN2_Project_Nature=The project "{0}" has not been configured with the BPMN2 Project Nature.\n\n\ + Adding the BPMN2 Project Nature will cause the BPMN2 Diagram Editor to dynamically reload configuration files from your Project\'s ".bpmn2config" folder.\n\n\ + Do you want to add this Nature to the Project now? +BPMN2ProjectValidator_No_WST_Project_Builder=The project "{0}" has not been configured for BPMN2 Validation.\n\n\ + Adding Validation will cause all BPMN2 files in this project to be validated automatically whenever the project is built. \ + Validation can be disabled from the Project Properties page:\n\n\ + \ Project -> Properties -> Validation -> BPMN 2.0 Validator.\n\n\ + Do you want to add the validator to the Project now? BPMN2ProjectValidator_Dont_Ask_Again=Don't ask me again BPMN2ProjectValidator_Invalid_File=Invalid bpmn2 file -BPMN2ProjectValidator_Title=Configure BPMN2 Project Nature -LiveValidationListener_Title=OCL validation errors found +BPMN2ProjectValidator_Title=Configure BPMN2 Project diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml index 24acb54e..9ea87007 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/plugin.xml @@ -1327,6 +1327,17 @@ <message>{0}</message> <target class="DataOutputAssociation"/> </constraint> + <constraint + lang="Java" + class="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.JbpmModelConstraint" + severity="ERROR" + mode="Batch" + name="Interface" + id="org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.Interface" + statusCode="1"> + <message>{0}</message> + <target class="Interface"/> + </constraint> </constraints> </constraintProvider> diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityDetailComposite.java index e00f7edf..09916564 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmCallActivityDetailComposite.java @@ -17,21 +17,24 @@ import org.eclipse.bpmn2.CallableElement; import org.eclipse.bpmn2.Definitions; import org.eclipse.bpmn2.RootElement; import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection; +import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.BooleanObjectEditor; import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor; import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.TextAndButtonObjectEditor; -import org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerFactory; import org.eclipse.bpmn2.modeler.core.utils.ModelUtil; -import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess; +import org.eclipse.bpmn2.modeler.core.validation.SyntaxCheckerUtils; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsFactory; -import org.eclipse.emf.common.util.URI; +import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ExternalProcess; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.jface.dialogs.IInputValidator; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.window.Window; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; /** @@ -40,6 +43,10 @@ import org.eclipse.swt.widgets.Composite; */ public class JbpmCallActivityDetailComposite extends JbpmActivityDetailComposite { + BooleanObjectEditor independentEditor; + Button independentCheckbox; + Button waitForCompletionCheckbox; + public JbpmCallActivityDetailComposite(AbstractBpmn2PropertySection section) { super(section); } @@ -49,6 +56,45 @@ public class JbpmCallActivityDetailComposite extends JbpmActivityDetailComposite } @Override + protected void bindAttribute(Composite parent, EObject object, EAttribute attribute, String label) { + if ("independent".equals(attribute.getName())) { + independentEditor = new BooleanObjectEditor(this,object,attribute); + independentCheckbox = (Button) independentEditor.createControl(parent,label); + if (waitForCompletionCheckbox!=null && waitForCompletionCheckbox.getSelection()==false) { + independentCheckbox.setEnabled(false); + } + } + else if ("waitForCompletion".equals(attribute.getName())) { + ObjectEditor editor = new BooleanObjectEditor(this,object,attribute); + waitForCompletionCheckbox = (Button) editor.createControl(parent,label); + waitForCompletionCheckbox.addSelectionListener( new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + boolean checked = waitForCompletionCheckbox.getSelection(); + if (!checked) { + independentCheckbox.setEnabled(false); + independentEditor.setValue(Boolean.TRUE); + } + else { + independentCheckbox.setEnabled(true); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + if (waitForCompletionCheckbox.getSelection()==false) { + if (independentCheckbox!=null) + independentCheckbox.setEnabled(false); + } + } + else + super.bindAttribute(parent, object, attribute, label); + } + + @Override protected void bindReference(Composite parent, EObject object, EReference reference) { if ("calledElementRef".equals(reference.getName())) { //$NON-NLS-1$ if (isModelObjectEnabled(object.eClass(), reference)) { @@ -64,8 +110,10 @@ public class JbpmCallActivityDetailComposite extends JbpmActivityDetailComposite @Override public String isValid(String newText) { - if (newText==null || newText.isEmpty()) - return Messages.JbpmCallActivityDetailComposite_Invalid_Empty; + if (newText==null ||newText.isEmpty()) + return Messages.JbpmCallActivityDetailComposite_Error_Empty; + if (!SyntaxCheckerUtils.isJavaPackageName(newText)) + return Messages.JbpmCallActivityDetailComposite_Error_Invalid; return null; } @@ -85,7 +133,7 @@ public class JbpmCallActivityDetailComposite extends JbpmActivityDetailComposite @Override - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { if (result != object.eGet(feature)) { TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain(); domain.getCommandStack().execute(new RecordingCommand(domain) { diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmItemDefinitionDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmItemDefinitionDetailComposite.java index 86e6fa4e..afc75872 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmItemDefinitionDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmItemDefinitionDetailComposite.java @@ -52,7 +52,7 @@ public class JbpmItemDefinitionDetailComposite extends else { ObjectEditor editor = new TextObjectEditor(this,object,reference) { @Override - protected boolean setValue(Object result) { + public boolean setValue(Object result) { return super.setValue(ModelUtil.createStringWrapper((String)result)); } }; diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmProcessDiagramPropertySection.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmProcessDiagramPropertySection.java index 110c33af..0b7b39e2 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmProcessDiagramPropertySection.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmProcessDiagramPropertySection.java @@ -15,7 +15,7 @@ package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.property; import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection; import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite; -import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.NCNameObjectEditor; +import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.JavaPackageNameObjectEditor; import org.eclipse.bpmn2.modeler.core.merrimac.dialogs.ObjectEditor; import org.eclipse.bpmn2.modeler.ui.property.diagrams.ProcessDiagramDetailComposite; import org.eclipse.bpmn2.modeler.ui.property.diagrams.ProcessDiagramPropertySection; @@ -62,7 +62,7 @@ public class JbpmProcessDiagramPropertySection extends ProcessDiagramPropertySec label = getPropertiesProvider().getLabel(object, attribute); if ("id".equals(attribute.getName())) { - ObjectEditor editor = new NCNameObjectEditor(this,object,attribute); + ObjectEditor editor = new JavaPackageNameObjectEditor(this,object,attribute); editor.createControl(parent,label); } else diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java index 152d734a..088efd70 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/JbpmTaskDetailComposite.java @@ -28,6 +28,7 @@ import org.eclipse.bpmn2.PotentialOwner; import org.eclipse.bpmn2.ResourceAssignmentExpression; import org.eclipse.bpmn2.ResourceRole; import org.eclipse.bpmn2.Task; +import org.eclipse.bpmn2.UserTask; import org.eclipse.bpmn2.modeler.core.adapters.InsertionAdapter; import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractBpmn2PropertySection; import org.eclipse.bpmn2.modeler.core.merrimac.clad.AbstractDetailComposite; @@ -98,7 +99,7 @@ public class JbpmTaskDetailComposite extends JbpmActivityDetailComposite { * * @param task */ - protected void createInputParameterBindings(Task task) { + protected void createInputParameterBindings(final Task task) { ModelExtensionAdapter adapter = ModelExtensionDescriptor.getModelExtensionAdapter(task); if (adapter != null) { @@ -118,7 +119,7 @@ public class JbpmTaskDetailComposite extends JbpmActivityDetailComposite { for (Property property : props) { // this will become the label for the Object Editor - String name = property.getFirstStringValue(); + final String name = property.getFirstStringValue(); // the input parameter DataInput parameter = null; // the DataInputAssociation @@ -200,7 +201,28 @@ public class JbpmTaskDetailComposite extends JbpmActivityDetailComposite { editor = new IntObjectEditor(this,fromExpression,attribute); } else if ("EBoolean".equals(dataType)) { //$NON-NLS-1$ - editor = new BooleanObjectEditor(this,fromExpression,attribute); + editor = new BooleanObjectEditor(this,fromExpression,attribute) { + @Override + public Boolean getValue() { + if (task instanceof UserTask && "Skippable".equals(name)) { + // Sheesh! All this just to set the default value of + // the User Task "Skippable" Data Input to true by default! + UserTask ut = (UserTask) task; + for (DataInput di : ut.getIoSpecification().getDataInputs()) { + if ("Skippable".equals(di.getName())) { + for (DataInputAssociation dia : ut.getDataInputAssociations()) { + if (dia.getTargetRef() == di) { + if (dia.getAssignment().size()==0) { + return Boolean.TRUE; + } + } + } + } + } + } + return super.getValue(); + } + }; } else if ("ID".equals(dataType)) { //$NON-NLS-1$ editor = new NCNameObjectEditor(this,fromExpression,attribute); @@ -284,7 +306,7 @@ public class JbpmTaskDetailComposite extends JbpmActivityDetailComposite { @Override protected Composite bindFeature(EObject be, EStructuralFeature feature, EClass eItemClass) { Composite composite = null; - if (feature!=null && "body".equals(feature.getName())) { + if (feature!=null && "body".equals(feature.getName())) { //$NON-NLS-1$ super.bindFeature(be, feature, eItemClass); } return composite; diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/Messages.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/Messages.java index a9fa7436..3db5a28b 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/Messages.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/Messages.java @@ -17,7 +17,8 @@ public class Messages extends NLS { public static String JbpmActivityDetailComposite_On_Entry_Script; public static String JbpmActivityDetailComposite_On_Exit_Script; public static String JbpmActivityDetailComposite_Script_Details; - public static String JbpmCallActivityDetailComposite_Invalid_Empty; + public static String JbpmCallActivityDetailComposite_Error_Empty; + public static String JbpmCallActivityDetailComposite_Error_Invalid; public static String JbpmCallActivityDetailComposite_Message; public static String JbpmCallActivityDetailComposite_Title; public static String JbpmCommonEventDetailComposite_TimerScriptLanguage; diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/SimulationDetailComposite.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/SimulationDetailComposite.java index 0a51d8e7..26bca8f9 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/SimulationDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/SimulationDetailComposite.java @@ -194,7 +194,7 @@ public class SimulationDetailComposite extends DefaultDetailComposite { editor = new FloatObjectEditor(this,decimalValue,BpsimPackage.eINSTANCE.getFloatingParameterType_Value()) { @Override - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain(); domain.getCommandStack().execute(new RecordingCommand(domain) { @Override @@ -235,7 +235,7 @@ public class SimulationDetailComposite extends DefaultDetailComposite { } @Override - protected boolean setValue(Object result) { + public boolean setValue(Object result) { final DistributionType dt = (DistributionType)result; ParameterValue value = timeParams.getProcessingTime().getParameterValue().get(0); boolean changed = true; diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/Messages.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/Messages.java index c5e01659..13d6cdf6 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/Messages.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/adapters/Messages.java @@ -17,8 +17,6 @@ public class Messages extends NLS { public static String JbpmGlobalTypePropertiesAdapter_Data_Type_Label; public static String JbpmGlobalTypePropertiesAdapter_Label; public static String JbpmGlobalTypePropertiesAdapter_Name; - public static String JbpmFormalExpressionPropertiesAdapter_Actor; - public static String JbpmFormalExpressionPropertiesAdapter_Expression; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/messages.properties b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/messages.properties index 56ab42a0..bb88dae8 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/messages.properties +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/property/messages.properties @@ -11,7 +11,8 @@ JbpmActivityDetailComposite_On_Entry_Script=On Entry Script JbpmActivityDetailComposite_On_Exit_Script=On Exit Script JbpmActivityDetailComposite_Script_Details=Script Details -JbpmCallActivityDetailComposite_Invalid_Empty=Please enter the ID of a callable activity +JbpmCallActivityDetailComposite_Error_Empty=Please enter the ID of a callable activity +JbpmCallActivityDetailComposite_Error_Invalid=The activity ID is not valid JbpmCallActivityDetailComposite_Message=Enter the ID of a callable activity JbpmCallActivityDetailComposite_Title=Called Element JbpmCommonEventDetailComposite_TimerScriptLanguage=Language diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/JbpmModelConstraint.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/JbpmModelConstraint.java index 40fb361f..eba9cc39 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/JbpmModelConstraint.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/JbpmModelConstraint.java @@ -15,6 +15,7 @@ import org.eclipse.bpmn2.CallActivity; import org.eclipse.bpmn2.DataAssociation; import org.eclipse.bpmn2.Definitions; import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.Interface; import org.eclipse.bpmn2.Process; import org.eclipse.bpmn2.Signal; import org.eclipse.bpmn2.UserTask; @@ -25,6 +26,7 @@ import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.DataA import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.DefinitionsValidator; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.EscalationValidator; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.GlobalTypeValidator; +import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.InterfaceValidator; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.ProcessValidator; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.SignalValidator; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators.UserTaskValidator; @@ -65,6 +67,9 @@ public class JbpmModelConstraint extends AbstractModelConstraint { if (object instanceof Definitions) { return new DefinitionsValidator(ctx).validate((Definitions)object); } + if (object instanceof Interface) { + return new InterfaceValidator(ctx).validate((Interface)object); + } return ctx.createSuccessStatus(); } diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/Messages.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/Messages.java index 010cb930..86ca3b09 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/Messages.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/Messages.java @@ -14,15 +14,16 @@ import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.messages"; //$NON-NLS-1$ - public static String BusinessRuleTaskConstraint_No_Ruleflow_Group; - public static String CallActivityConstraint_No_Called_Element; public static String CallActivityConstraint_No_Process; + public static String CallActivityConstraint_Independent_And_WaitForCompletion_False; public static String ProcessConstraint_No_Package_Name; public static String ProcessConstraint_No_Process_Name; public static String ProcessVariableNameConstraint_Duplicate_ID; - public static String UserTaskConstraint_Internal_Error; + public static String ProcessVariableNameValidator_ID_Empty; + public static String ProcessVariableNameValidator_ID_Invalid; public static String UserTaskConstraint_No_Form; public static String UserTaskConstraint_No_Name; + public static String InterfaceValidator_Implementation_Invalid; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/messages.properties b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/messages.properties index 4790576d..6ee722eb 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/messages.properties +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/messages.properties @@ -8,12 +8,13 @@ # Contributors: # Red Hat, Inc. - initial API and implementation #------------------------------------------------------------------------------- -BusinessRuleTaskConstraint_No_Ruleflow_Group=Business Rule Task has no ruleflow group -CallActivityConstraint_No_Called_Element=Reusable Subprocess has no called element specified. CallActivityConstraint_No_Process=No existing process exists with ID {0} +CallActivityConstraint_Independent_And_WaitForCompletion_False=\"Independent\" can only be FALSE if \"Wait For Completion\" is TRUE ProcessConstraint_No_Package_Name=Process {0} (ID={1}) has no package name ProcessConstraint_No_Process_Name=Process with ID={1} has no name ProcessVariableNameConstraint_Duplicate_ID={0} and {1} have the same ID -UserTaskConstraint_Internal_Error=Internal Validation Error for User Task: {0} +ProcessVariableNameValidator_ID_Empty=The {0} ID can not be empty +ProcessVariableNameValidator_ID_Invalid=The {0} ID is invalid: {1} UserTaskConstraint_No_Form=User Task has no task form defined UserTaskConstraint_No_Name=User Task has no task name +InterfaceValidator_Implementation_Invalid=The implementation for Interface {0} must be a valid Java Type diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/CallActivityValidator.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/CallActivityValidator.java index cb0ede37..6a85c0ac 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/CallActivityValidator.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/CallActivityValidator.java @@ -18,12 +18,14 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.eclipse.bpmn2.CallActivity; +import org.eclipse.bpmn2.modeler.core.utils.ModelUtil; import org.eclipse.bpmn2.modeler.core.validation.validators.AbstractBpmn2ElementValidator; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.IDiagramProfile; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.Messages; import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.ServletUtil; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.validation.IValidationContext; public class CallActivityValidator extends AbstractBpmn2ElementValidator<CallActivity> { @@ -42,9 +44,7 @@ public class CallActivityValidator extends AbstractBpmn2ElementValidator<CallAct @Override public IStatus validate(CallActivity object) { - if (object.getCalledElementRef() == null) { - addStatus(object, Status.ERROR, Messages.CallActivityConstraint_No_Called_Element); - } else { + if (object.getCalledElementRef() != null) { String[] packageAssetInfo = ServletUtil.findPackageAndAssetInfo(uuid, profile); String packageName = packageAssetInfo[0]; List<String> allProcessesInPackage = ServletUtil.getAllProcessesInPackage(packageName, profile); @@ -64,6 +64,18 @@ public class CallActivityValidator extends AbstractBpmn2ElementValidator<CallAct addStatus(object, Status.ERROR, Messages.CallActivityConstraint_No_Process, object.getCalledElementRef()); } } + Boolean independent = false; + Boolean waitForCompletion = false; + EStructuralFeature feature; + feature = ModelUtil.getAnyAttribute(object, "independent"); //$NON-NLS-1$ + if (feature!=null) + independent = (Boolean) object.eGet(feature); + feature = ModelUtil.getAnyAttribute(object, "waitForCompletion"); //$NON-NLS-1$ + if (feature!=null) + waitForCompletion = (Boolean) object.eGet(feature); + if (independent==false && waitForCompletion==false) { + addStatus(object, Status.ERROR, Messages.CallActivityConstraint_Independent_And_WaitForCompletion_False); + } return getResult(); } }
\ No newline at end of file diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/InterfaceValidator.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/InterfaceValidator.java new file mode 100644 index 00000000..6bc906d0 --- /dev/null +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/InterfaceValidator.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012, 2013, 2014 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 + * + * @author Bob Brodt + ******************************************************************************/ + +package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators; + +import org.eclipse.bpmn2.Interface; +import org.eclipse.bpmn2.modeler.core.utils.ModelUtil; +import org.eclipse.bpmn2.modeler.core.validation.SyntaxCheckerUtils; +import org.eclipse.bpmn2.modeler.core.validation.validators.AbstractBpmn2ElementValidator; +import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.Messages; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.validation.IValidationContext; + +/** + * + */ +public class InterfaceValidator extends org.eclipse.bpmn2.modeler.core.validation.validators.InterfaceValidator { + + /** + * Construct a BPMN2 Element Validator from a Validation Context. + * + * @param ctx + */ + public InterfaceValidator(IValidationContext ctx) { + super(ctx); + } + + /** + * Construct a BPMN2 Element Validator with the given Validator as the parent. + * The parent is responsible for collecting all of the validation Status objects + * and reporting them back to the Validation Constraint. + * + * @param parent a parent Validator class + */ + @SuppressWarnings("rawtypes") + public InterfaceValidator(AbstractBpmn2ElementValidator parent) { + super(parent); + } + + /* (non-Javadoc) + * @see org.eclipse.bpmn2.modeler.core.validation.validators.AbstractBpmn2ElementValidator#validate(org.eclipse.bpmn2.BaseElement) + */ + @Override + public IStatus validate(Interface object) { + super.validate(object); + String implementation = ModelUtil.getStringWrapperTextValue(object.getImplementationRef()); + if (!SyntaxCheckerUtils.isJavaPackageName(implementation)) { + addStatus(object, "implementationRef", Status.ERROR, Messages.InterfaceValidator_Implementation_Invalid, getName(object)); + } + return getResult(); + } + +} + diff --git a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/ProcessVariableNameValidator.java b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/ProcessVariableNameValidator.java index 69513d36..508376f6 100644 --- a/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/ProcessVariableNameValidator.java +++ b/org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5/src/org/eclipse/bpmn2/modeler/runtime/jboss/jbpm5/validation/validators/ProcessVariableNameValidator.java @@ -14,8 +14,14 @@ package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.validation.validators; import org.eclipse.bpmn2.BaseElement; +import org.eclipse.bpmn2.DataInput; +import org.eclipse.bpmn2.DataObject; import org.eclipse.bpmn2.Definitions; +import org.eclipse.bpmn2.Error; +import org.eclipse.bpmn2.Escalation; +import org.eclipse.bpmn2.Message; import org.eclipse.bpmn2.Process; +import org.eclipse.bpmn2.Signal; import org.eclipse.bpmn2.modeler.core.utils.ModelUtil; import org.eclipse.bpmn2.modeler.core.validation.SyntaxCheckerUtils; import org.eclipse.bpmn2.modeler.core.validation.validators.AbstractBpmn2ElementValidator; @@ -60,25 +66,37 @@ public class ProcessVariableNameValidator extends AbstractBpmn2ElementValidator< String featureName = null; if (object instanceof GlobalType) { id = ((GlobalType) object).getIdentifier(); - featureName = "identifier"; + featureName = "identifier"; //$NON-NLS-1$ } else if (object instanceof BaseElement) { id = ((BaseElement) object).getId(); - featureName = "id"; + featureName = "id"; //$NON-NLS-1$ } if (isEmpty(id)) { - addStatus(object, featureName, Status.ERROR, "The {0} ID can not be empty", object.eClass().getName()); + addStatus(object, featureName, Status.ERROR, Messages.ProcessVariableNameValidator_ID_Empty, object.eClass().getName()); } else { if (object instanceof Process || object instanceof ExternalProcess) { if (!SyntaxCheckerUtils.isJavaPackageName(id)) { - addStatus(object, featureName, Status.ERROR, "The {0} ID is invalid: {1}", object.eClass().getName(), id); + addStatus(object, featureName, Status.ERROR, Messages.ProcessVariableNameValidator_ID_Invalid, object.eClass().getName(), id); } } - else { + else if (object instanceof org.eclipse.bpmn2.Property || + object instanceof DataObject || + object instanceof Message || + object instanceof Signal || + object instanceof Error || + object instanceof Escalation || + object instanceof GlobalType || + object instanceof DataInput) { if (!SyntaxCheckerUtils.isJavaIdentifier(id)) { - addStatus(object, featureName, Status.ERROR, "The {0} ID is invalid: {1}", object.eClass().getName(), id); + addStatus(object, featureName, Status.ERROR, Messages.ProcessVariableNameValidator_ID_Invalid, object.eClass().getName(), id); + } + } + else { + if (!SyntaxCheckerUtils.isNCName(id)) { + addStatus(object, featureName, Status.ERROR, Messages.ProcessVariableNameValidator_ID_Invalid, object.eClass().getName(), id); } } } diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNToolBehaviorProvider.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNToolBehaviorProvider.java index c62d1809..79fac751 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNToolBehaviorProvider.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/diagram/BPMNToolBehaviorProvider.java @@ -209,20 +209,34 @@ public class BPMNToolBehaviorProvider extends DefaultToolBehaviorProvider implem continue; } - category = getRealCategory(targetRuntime, category); - compartmentEntry = categories.get(category.getName()); - for (ToolDescriptor tool : category.getTools()) { + CategoryDescriptor realCategory = getRealCategory(targetRuntime, category); + compartmentEntry = categories.get(realCategory.getName()); + for (ToolDescriptor tool : realCategory.getTools()) { tool = getRealTool(targetRuntime, tool); IFeature feature = getCreateFeature(tool); if (feature!=null) { if (compartmentEntry==null) { - compartmentEntry = new PaletteCompartmentEntry(category.getName(), category.getIcon()); + compartmentEntry = new PaletteCompartmentEntry(realCategory.getName(), realCategory.getIcon()); compartmentEntry.setInitiallyOpen(false); - categories.put(category.getName(), compartmentEntry); + categories.put(realCategory.getName(), compartmentEntry); } createEntry(feature, compartmentEntry); } } + if (category != realCategory) { + for (ToolDescriptor tool : category.getTools()) { + tool = getRealTool(targetRuntime, tool); + IFeature feature = getCreateFeature(tool); + if (feature!=null) { + if (compartmentEntry==null) { + compartmentEntry = new PaletteCompartmentEntry(category.getName(), category.getIcon()); + compartmentEntry.setInitiallyOpen(false); + categories.put(category.getName(), compartmentEntry); + } + createEntry(feature, compartmentEntry); + } + } + } // if there are no tools defined for this category, check if it will be // used for only Custom Tasks. If so, create the category anyway. if (compartmentEntry==null) { @@ -256,7 +270,8 @@ public class BPMNToolBehaviorProvider extends DefaultToolBehaviorProvider implem String id = category.getId(); if (fromPalette!=null && id!=null) { for (TargetRuntime otherRt : TargetRuntime.getAllRuntimes()) { - if (otherRt!=rt) { +// if (otherRt!=rt) + { for (ToolPaletteDescriptor tp : otherRt.getToolPalettes()) { if ( fromPalette.equals(tp.getId())) { for (CategoryDescriptor c : tp.getCategories()) { @@ -277,7 +292,8 @@ public class BPMNToolBehaviorProvider extends DefaultToolBehaviorProvider implem String id = tool.getId(); if (fromPalette!=null && id!=null) { for (TargetRuntime otherRt : TargetRuntime.getAllRuntimes()) { - if (otherRt!=rt) { +// if (otherRt!=rt) + { for (ToolPaletteDescriptor tp : otherRt.getToolPalettes()) { if ( fromPalette.equals(tp.getId())) { for (CategoryDescriptor c : tp.getCategories()) { diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java index 4194eb7e..1582bdbc 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2Editor.java @@ -377,6 +377,8 @@ public class BPMN2Editor extends DiagramEditor implements IPreferenceChangeListe Bpmn2Preferences.setActiveProject(activeEditor.getProject()); TargetRuntime.setCurrentRuntime( activeEditor.getTargetRuntime() ); } + else + TargetRuntime.setCurrentRuntime(null); } public BPMN2MultiPageEditor getMultipageEditor() { @@ -389,9 +391,10 @@ public class BPMN2Editor extends DiagramEditor implements IPreferenceChangeListe @Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { - - setActiveEditor(this); + // This needs to happen very early because setActiveEditor will try to + // determine the TargetRuntime from the EditorInput. currentInput = input; + setActiveEditor(this); if (this.getDiagramBehavior()==null) { super.init(site, input); @@ -573,6 +576,8 @@ public class BPMN2Editor extends DiagramEditor implements IPreferenceChangeListe public boolean isDirty() { if (!editable) return false; + if (getEditorInput()==null) + return false; return super.isDirty(); } @@ -646,18 +651,7 @@ public class BPMN2Editor extends DiagramEditor implements IPreferenceChangeListe // If none of the plug-ins respond with "yes, this file is targeted for my runtime", // then use the "None" as the extension. This will configure the BPMN2 Modeler with // generic property sheets and other default behavior. - targetRuntime = getPreferences().getRuntime(); - if (targetRuntime == TargetRuntime.getDefaultRuntime()) { - for (TargetRuntime rt : TargetRuntime.getAllRuntimes()) { - if (rt.getRuntimeExtension().isContentForRuntime(input)) { - targetRuntime = rt; - break; - } - } - } - if (targetRuntime==null) - targetRuntime = TargetRuntime.getDefaultRuntime(); - + targetRuntime = TargetRuntime.getRuntime(input); TargetRuntime.setCurrentRuntime(targetRuntime); } return targetRuntime; diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java index 12d4e732..88405acb 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2EditorUpdateBehavior.java @@ -233,10 +233,10 @@ public class BPMN2EditorUpdateBehavior extends DefaultUpdateBehavior { switch (event.getEventType()) { case OperationHistoryEvent.REDONE: - TargetRuntime.getCurrentRuntime().notify(new LifecycleEvent(EventType.COMMAND_REDO, event.getOperation())); + LifecycleEvent.notify(new LifecycleEvent(EventType.COMMAND_REDO, event.getOperation())); break; case OperationHistoryEvent.UNDONE: - TargetRuntime.getCurrentRuntime().notify(new LifecycleEvent(EventType.COMMAND_UNDO, event.getOperation())); + LifecycleEvent.notify(new LifecycleEvent(EventType.COMMAND_UNDO, event.getOperation())); break; } } diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MarkerChangeListener.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MarkerChangeListener.java index 362f41f7..77089a57 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MarkerChangeListener.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/BPMN2MarkerChangeListener.java @@ -71,7 +71,7 @@ public class BPMN2MarkerChangeListener implements IResourceChangeListener { deletedMarkers.add(uri); } if (relatedUris!=null) { - for (String relatedUri : relatedUris.split(" ")) { + for (String relatedUri : relatedUris.split(" ")) { //$NON-NLS-1$ if (!deletedMarkers.contains(relatedUri)) deletedMarkers.add(relatedUri); } @@ -112,7 +112,8 @@ public class BPMN2MarkerChangeListener implements IResourceChangeListener { PropertySheet ps = (PropertySheet)v.getView(true); IPage pp = ps.getCurrentPage(); if (pp instanceof Bpmn2TabbedPropertySheetPage) { - ((Bpmn2TabbedPropertySheetPage)pp).refresh(); + if (((Bpmn2TabbedPropertySheetPage) pp).getCurrentTab()!=null) + ((Bpmn2TabbedPropertySheetPage)pp).refresh(); } } } diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties index 1ff12b49..18d05447 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/messages.properties @@ -74,7 +74,6 @@ SchemaImportDialog_Select_Java_Message=Please select a Java Type ModelTreeLabelProvider_s1_s2={0} \: {1} -CommonLabels_Data_Type=Data Type Bpmn2EditorAppearancePreferencePage_Colors_Group=Colors, Fonts and Line Styles Bpmn2EditorAppearancePreferencePage_GraphicalElements_Group=Graphical Elements Bpmn2EditorPreferencePage_Activities=Activities diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertyComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertyComposite.java index 14bda82f..bea48002 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertyComposite.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/DefinitionsPropertyComposite.java @@ -204,7 +204,7 @@ public class DefinitionsPropertyComposite extends DefaultDetailComposite { } @Override - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { // we can't just change the key because the map that contains it // needs to be updated, so remove old key, then add new. if (result instanceof String && !((String)result).isEmpty() ) { @@ -436,7 +436,7 @@ public class DefinitionsPropertyComposite extends DefaultDetailComposite { } } - protected boolean setValue(final Object value) { + public boolean setValue(final Object value) { // remove old prefix String prefix = text.getText(); NamespaceUtil.removeNamespaceForPrefix(imp.eResource(), prefix); diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionDetailComposite.java index 03cc42ba..1b3e037b 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/diagrams/ItemDefinitionDetailComposite.java @@ -72,7 +72,7 @@ public class ItemDefinitionDetailComposite extends DefaultDetailComposite { label = ModelUtil.getLabel(object, attribute); ObjectEditor editor = new ComboObjectEditor(this,object,attribute) { - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { super.setValue(result); Display.getCurrent().syncExec( new Runnable() { @Override @@ -109,7 +109,7 @@ public class ItemDefinitionDetailComposite extends DefaultDetailComposite { else { ObjectEditor editor = new TextObjectEditor(this,object,reference) { @Override - protected boolean setValue(Object result) { + public boolean setValue(Object result) { return super.setValue(ModelUtil.createStringWrapper((String)result)); } }; diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventDetailComposite.java index dd2ebfa2..ce73b064 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/events/CommonEventDetailComposite.java @@ -86,7 +86,7 @@ public class CommonEventDetailComposite extends DefaultDetailComposite { label = getPropertiesProvider().getLabel(be, attribute); final ObjectEditor editor = new BooleanObjectEditor(this,be,attribute) { - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { if (hasEventDefinition(be,ErrorEventDefinition.class)) { setCancel(be,true); this.setVisible(true); diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java index 681c5a58..79014882 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/ActivityDetailComposite.java @@ -317,7 +317,7 @@ public class ActivityDetailComposite extends DefaultDetailComposite { final String operationLabel = getPropertiesProvider().getLabel(activity, operationRef); final ObjectEditor operationEditor = new ComboObjectEditor(this,activity,operationRef) { @Override - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain(); domain.getCommandStack().execute(new RecordingCommand(domain) { @Override @@ -366,7 +366,7 @@ public class ActivityDetailComposite extends DefaultDetailComposite { final String messageLabel = getPropertiesProvider().getLabel(activity, messageRef); final ObjectEditor messageEditor = new ComboObjectEditor(this,activity,messageRef) { @Override - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { TransactionalEditingDomain domain = getDiagramEditor().getEditingDomain(); domain.getCommandStack().execute(new RecordingCommand(domain) { @Override diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoSetsListComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoSetsListComposite.java index c01aa20c..ad9a20df 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoSetsListComposite.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/IoSetsListComposite.java @@ -246,7 +246,7 @@ public class IoSetsListComposite extends DefaultListComposite { setText(text); } - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { return true; } } diff --git a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java index e775a9ab..0baa7c31 100644 --- a/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java +++ b/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/tasks/MultiInstanceLoopCharacteristicsDetailComposite.java @@ -158,7 +158,7 @@ public class MultiInstanceLoopCharacteristicsDetailComposite extends DefaultDeta if (isEnabled("isSequential")) { //$NON-NLS-1$ isSequentialEditor = new BooleanObjectEditor(this, getBO(), PACKAGE.getMultiInstanceLoopCharacteristics_IsSequential()) { - protected boolean setValue(final Object result) { + public boolean setValue(final Object result) { Object oldValue = object.eGet(feature); if (oldValue!=result && oldValue!=null && !oldValue.equals(result)) { TransactionalEditingDomain editingDomain = getDiagramEditor().getEditingDomain(); @@ -524,7 +524,7 @@ public class MultiInstanceLoopCharacteristicsDetailComposite extends DefaultDeta throwBehaviorEditor = new ComboObjectEditor(this,object,attribute) { @Override - protected boolean setValue(Object result) { + public boolean setValue(Object result) { MultiInstanceLoopCharacteristics lc = (MultiInstanceLoopCharacteristics)object; boolean updated = super.setValue(result); if (updated) { |