| author | Rainer Pielmann | 2012-04-05 03:53:52 (EDT) |
|---|---|---|
| committer | Stephan Born | 2012-04-24 10:13:54 (EDT) |
| commit | 900924cd5c252be536d5aef81c3999add6f9b1eb (patch) (side-by-side diff) | |
| tree | f3ae6027d40ae2006beb0cdf1bbd0070840cc181 | |
| parent | 1c77f44f2a47403e401b65b3ef0e1197f00c6016 (diff) | |
| download | org.eclipse.stardust.ide-900924cd5c252be536d5aef81c3999add6f9b1eb.zip org.eclipse.stardust.ide-900924cd5c252be536d5aef81c3999add6f9b1eb.tar.gz org.eclipse.stardust.ide-900924cd5c252be536d5aef81c3999add6f9b1eb.tar.bz2 | |
Jira-ID: CRNT-24487
Activity relocation: Could not save the property in Manual activity related to activity relocation
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@55317 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
| -rw-r--r-- | modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ApplicationGeneralPropertyPage.java | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ApplicationGeneralPropertyPage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ApplicationGeneralPropertyPage.java index ad4a23f..a04d89d 100644 --- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ApplicationGeneralPropertyPage.java +++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ApplicationGeneralPropertyPage.java @@ -10,8 +10,100 @@ *******************************************************************************/ package org.eclipse.stardust.modeling.core.properties; +import org.eclipse.stardust.engine.api.model.PredefinedConstants; +import org.eclipse.stardust.model.xpdl.carnot.AttributeType; +import org.eclipse.stardust.model.xpdl.carnot.IExtensibleElement; +import org.eclipse.stardust.model.xpdl.carnot.IModelElement; +import org.eclipse.stardust.model.xpdl.carnot.IModelElementNodeSymbol; +import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil; +import org.eclipse.stardust.modeling.common.projectnature.BpmProjectNature; +import org.eclipse.stardust.modeling.common.ui.jface.utils.FormBuilder; +import org.eclipse.stardust.modeling.core.Diagram_Messages; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.PlatformUI; public class ApplicationGeneralPropertyPage extends IdentifiablePropertyPage { + private Button publicCheckBox; + + private boolean publicType; + + private IModelElement modelElement; + + @Override + protected void contributeExtraControls(Composite composite) + { + super.contributeExtraControls(composite); + publicCheckBox = FormBuilder.createCheckBox(composite, + Diagram_Messages.CHECKBOX_Visibility); + publicCheckBox.addSelectionListener(new SelectionAdapter() + { + + public void widgetSelected(SelectionEvent e) + { + + publicType = !publicType; + if (publicType) + { + AttributeUtil.setAttribute((IExtensibleElement) modelElement, + PredefinedConstants.MODELELEMENT_VISIBILITY, "Public"); //$NON-NLS-1$ + } + else + { + AttributeUtil.setAttribute((IExtensibleElement) modelElement, + PredefinedConstants.MODELELEMENT_VISIBILITY, "Private"); //$NON-NLS-1$ + } + } + }); + } + + @Override + public void loadElementFromFields(IModelElementNodeSymbol symbol, IModelElement element) + { + super.loadElementFromFields(symbol, element); + } + + @Override + public void loadFieldsFromElement(IModelElementNodeSymbol symbol, IModelElement element) + { + super.loadFieldsFromElement(symbol, element); + modelElement = element; + setupVisibility(); + } + + private void setupVisibility() + { + AttributeType visibility = AttributeUtil.getAttribute( + (IExtensibleElement) modelElement, + PredefinedConstants.MODELELEMENT_VISIBILITY); + if (visibility == null) + { + String visibilityDefault = PlatformUI.getPreferenceStore().getString( + BpmProjectNature.PREFERENCE_MULTIPACKAGEMODELING_VISIBILITY); + if (visibilityDefault == null || visibilityDefault == "" //$NON-NLS-1$ + || visibilityDefault.equalsIgnoreCase("Public")) //$NON-NLS-1$ + { + AttributeUtil.setAttribute((IExtensibleElement) modelElement, + PredefinedConstants.MODELELEMENT_VISIBILITY, "Public"); //$NON-NLS-1$ + publicType = true; + } + } + else + { + if (visibility.getValue().equalsIgnoreCase("Public")) //$NON-NLS-1$ + { + publicType = true; + } + else + { + publicType = false; + } + } + publicCheckBox.setSelection(publicType); + } + } |

