diff options
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java')
-rw-r--r-- | plugins/developer/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java b/plugins/developer/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java index 619f2b2e38c..aa653e44c77 100644 --- a/plugins/developer/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java +++ b/plugins/developer/org.eclipse.papyrus.gmfgenextension/src/org/eclipse/papyrus/papyrusgmfgenextension/popupaction/AddNodeShowHideContentsBehavior.java @@ -1,51 +1,51 @@ -/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.papyrusgmfgenextension.popupaction;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.codegen.gmfgen.GenNode;
-import org.eclipse.jface.action.IAction;
-
-
-public class AddNodeShowHideContentsBehavior extends Action {
-
- /** the key for the EditPolicy to add. */
- public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"; //$NON-NLS-1$
-
- /** the path for the EditPolicy */
- public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"; //$NON-NLS-1$
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- @Override
- public void run(IAction action) {
- // Parse selected GenLink(s) and add the desired CustomBehavior
- Iterator<EObject> it = getSelectedEObject().iterator();
- while (it.hasNext()) {
- EObject eObject = it.next();
- if (eObject instanceof GenNode) {
- // test if it has got a external node to display applied stereotype
- if (!hasCustomBehavior(((GenNode) eObject), SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY)) {
- addCustomBehavior((GenNode) eObject, SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY, SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_CLASS);
- }
- }
- }
- }
-}
+/***************************************************************************** + * Copyright (c) 2010 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.papyrusgmfgenextension.popupaction; + +import java.util.Iterator; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.codegen.gmfgen.GenNode; +import org.eclipse.jface.action.IAction; + + +public class AddNodeShowHideContentsBehavior extends Action { + + /** the key for the EditPolicy to add. */ + public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY"; //$NON-NLS-1$ + + /** the path for the EditPolicy */ + public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_CLASS = "org.eclipse.papyrus.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy"; //$NON-NLS-1$ + + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + @Override + public void run(IAction action) { + // Parse selected GenLink(s) and add the desired CustomBehavior + Iterator<EObject> it = getSelectedEObject().iterator(); + while (it.hasNext()) { + EObject eObject = it.next(); + if (eObject instanceof GenNode) { + // test if it has got a external node to display applied stereotype + if (!hasCustomBehavior(((GenNode) eObject), SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY)) { + addCustomBehavior((GenNode) eObject, SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_KEY, SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY_CLASS); + } + } + } + } +} |