summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-04-04 04:29:57 (EDT)
committer Stephan Born2012-04-24 10:13:50 (EDT)
commit1928733827f6c4a0257645ee238f42b8b86013da (patch)
treed5ed98f5e00e64ce0a38ee7ae1ba3ba91de11498
parentb45ce8b7e816b50467786b3122c6c9485a705ddd (diff)
downloadorg.eclipse.stardust.ide-1928733827f6c4a0257645ee238f42b8b86013da.zip
org.eclipse.stardust.ide-1928733827f6c4a0257645ee238f42b8b86013da.tar.gz
org.eclipse.stardust.ide-1928733827f6c4a0257645ee238f42b8b86013da.tar.bz2
Jira-ID: CRNT-23740
"Visibility Public" checkbox should be added for all data types and participants which can be shared across models git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@55267 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/RoleGeneralPropertyPage.java73
-rw-r--r--modeling/org.eclipse.stardust.modeling.repository.common/src/org/eclipse/stardust/modeling/repository/common/ConnectionManager.java11
2 files changed, 84 insertions, 0 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/RoleGeneralPropertyPage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/RoleGeneralPropertyPage.java
index 9c13506..a377e10 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/RoleGeneralPropertyPage.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/RoleGeneralPropertyPage.java
@@ -14,20 +14,35 @@ import java.text.NumberFormat;
import java.text.ParseException;
import org.eclipse.stardust.common.StringUtils;
+import org.eclipse.stardust.engine.api.model.PredefinedConstants;
+import org.eclipse.stardust.model.xpdl.carnot.AttributeType;
import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelPackage;
+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.RoleType;
+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.stardust.modeling.core.VerifierFactory;
+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.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
public class RoleGeneralPropertyPage extends IdentifiablePropertyPage
{
private Text cardinalityText;
+ private Button publicCheckBox;
+
+ private boolean publicType;
+
+ private IModelElement modelElement;
+
public void loadFieldsFromElement(IModelElementNodeSymbol symbol, IModelElement element)
{
super.loadFieldsFromElement(symbol, element);
@@ -38,6 +53,9 @@ public class RoleGeneralPropertyPage extends IdentifiablePropertyPage
{
cardinalityText.setText(cardinality);
}
+
+ modelElement = element;
+ setupVisibility();
}
public void loadElementFromFields(IModelElementNodeSymbol symbol, IModelElement element)
@@ -73,5 +91,60 @@ public class RoleGeneralPropertyPage extends IdentifiablePropertyPage
FormBuilder.createLabel(composite, Diagram_Messages.LB_Cardinality);
cardinalityText = FormBuilder.createText(composite);
cardinalityText.addVerifyListener(VerifierFactory.intVerifier);
+
+ 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$
+ }
+ }
+ });
+ }
+
+ 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);
}
}
+
+
diff --git a/modeling/org.eclipse.stardust.modeling.repository.common/src/org/eclipse/stardust/modeling/repository/common/ConnectionManager.java b/modeling/org.eclipse.stardust.modeling.repository.common/src/org/eclipse/stardust/modeling/repository/common/ConnectionManager.java
index cbc18e9..161686c 100644
--- a/modeling/org.eclipse.stardust.modeling.repository.common/src/org/eclipse/stardust/modeling/repository/common/ConnectionManager.java
+++ b/modeling/org.eclipse.stardust.modeling.repository.common/src/org/eclipse/stardust/modeling/repository/common/ConnectionManager.java
@@ -80,6 +80,17 @@ public class ConnectionManager implements IConnectionManager
return false;
}
}
+ if (eObjectdescriptor.getEObject() instanceof RoleType)
+ {
+ RoleType roleType = eObjectdescriptor.getEObject();
+ AttributeType visibility = AttributeUtil.getAttribute(
+ (IExtensibleElement) roleType,
+ PredefinedConstants.MODELELEMENT_VISIBILITY);
+ if (visibility != null && "Private".equals(visibility.getValue())) //$NON-NLS-1$
+ {
+ return false;
+ }
+ }
if (eObjectdescriptor.getEObject() instanceof DataType)
{
DataType dataType = eObjectdescriptor.getEObject();