Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Brodt2014-07-11 16:07:57 -0400
committerBob Brodt2014-07-11 16:07:57 -0400
commitf80bcad9f61f9b67d4c9a61fdd06d071527825ed (patch)
tree4dc4010a79509c605668910c61f9c157209b9576
parent94ca44bf9fdfe45e52429e1bee0e2e7dc4427395 (diff)
downloadorg.eclipse.bpmn2-modeler-f80bcad9f61f9b67d4c9a61fdd06d071527825ed.tar.gz
org.eclipse.bpmn2-modeler-f80bcad9f61f9b67d4c9a61fdd06d071527825ed.tar.xz
org.eclipse.bpmn2-modeler-f80bcad9f61f9b67d4c9a61fdd06d071527825ed.zip
Fix Appearance preferences.
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java29
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java29
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolProfilesPreferencePage.java5
-rw-r--r--plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java4
4 files changed, 40 insertions, 27 deletions
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java
index 1a1694a8..6ac88541 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/preferences/ModelEnablements.java
@@ -166,18 +166,21 @@ public class ModelEnablements {
private void setEnabledSingle(EClass eClass, boolean enabled) {
if (isValid(eClass)) {
- String className = eClass.getName();
- if (enabled) {
- if (classes.containsKey(className))
- return;
- HashSet<String> features = new HashSet<String>();
- classes.put(className, features);
- }
- else {
- if (!classes.containsKey(className))
- return;
- classes.remove(className);
- }
+ setEnabledSingle(eClass.getName(), enabled);
+ }
+ }
+
+ private void setEnabledSingle(String className, boolean enabled) {
+ if (enabled) {
+ if (classes.containsKey(className))
+ return;
+ HashSet<String> features = new HashSet<String>();
+ classes.put(className, features);
+ }
+ else {
+ if (!classes.containsKey(className))
+ return;
+ classes.remove(className);
}
}
@@ -197,7 +200,7 @@ public class ModelEnablements {
}
// enable or disable just the class
EClass eClass = getEClass(name);
- setEnabledSingle(eClass, enabled);
+ setEnabledSingle(name, enabled);
if (enabled) {
// and enable all of its contained and referenced types
diff --git a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java
index ffafa9b9..e9de4516 100644
--- a/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java
+++ b/plugins/org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/runtime/TargetRuntime.java
@@ -954,20 +954,21 @@ public class TargetRuntime extends BaseRuntimeExtensionDescriptor implements IRu
}
private void getModelExtensions(ModelExtensionDescriptor med, Property p, Hashtable<EClass, List<EStructuralFeature>> list) {
- EClassifier eClassifier = med.getClassifier(p.name);
- if (eClassifier instanceof EClass) {
- EClass eClass = (EClass) eClassifier;
- List<EStructuralFeature> features = list.get(eClass);
- if (features==null) {
- features = new ArrayList<EStructuralFeature>();
- list.put(eClass,features);
- }
- for (Object v : p.getValues()) {
- if (v instanceof Property) {
- EStructuralFeature feature = med.createEFeature(eClass, (Property)v);
- if (feature!=null && !features.contains(feature))
- features.add(feature);
- getModelExtensions(med, (Property)v, list);
+ if (p.parent!=null) {
+ EClass eClass = med.getModelDecorator().getEClass(p.parent.type);
+ if (eClass!=null) {
+ List<EStructuralFeature> features = list.get(eClass);
+ if (features==null) {
+ features = new ArrayList<EStructuralFeature>();
+ list.put(eClass,features);
+ }
+ EStructuralFeature feature = med.createEFeature(eClass, p);
+ if (feature!=null && !features.contains(feature))
+ features.add(feature);
+ for (Object v : p.getValues()) {
+ if (v instanceof Property) {
+ getModelExtensions(med, (Property)v, list);
+ }
}
}
}
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolProfilesPreferencePage.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolProfilesPreferencePage.java
index c42d97f7..520479d0 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolProfilesPreferencePage.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/preferences/ToolProfilesPreferencePage.java
@@ -325,6 +325,11 @@ public class ToolProfilesPreferencePage extends PreferencePage implements IWorkb
ModelEnablementTreeEntry entry = (ModelEnablementTreeEntry)element;
ToolProfilesPreferencesHelper helper = getHelper(currentRuntime, currentProfileId);
helper.setEnabled(entry, checked);
+ if (entry.hasChildren()) {
+ for (ModelEnablementTreeEntry c : entry.getChildren()) {
+ helper.setEnabled(c, checked);
+ }
+ }
}
}
};
diff --git a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java
index 09c6c68b..85e489c3 100644
--- a/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java
+++ b/plugins/org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/property/DescriptionPropertySection.java
@@ -163,6 +163,10 @@ public class DescriptionPropertySection extends DefaultPropertySection implement
if (pes.length==1 && ChoreographyUtil.isChoreographyParticipantBand(pes[0])) {
return;
}
+
+ EStructuralFeature feature = getFeature(be,ShapeStyle.STYLE_OBJECT);
+ if (feature==null || !isModelObjectEnabled(be.eClass(), feature) || !isModelObjectEnabled(ShapeStyle.STYLE_ECLASS,null))
+ return;
final BaseElement element = (BaseElement) be;
EObject style = ShapeStyle.getStyleObject(element);

Back to the top