public class ViewUtils
extends java.lang.Object
Constructor and Description |
---|
ViewUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getBaseViewName(DiagramStatus.DesignView currentView)
Returns the name of the current actual view.
|
static org.eclipse.uml2.uml.Package |
getCHESSDeploymentPackage(org.eclipse.uml2.uml.Model theModel)
Returns the package representing the DeploymentView.
|
static org.eclipse.uml2.uml.Package |
getCHESSPSMPackage(org.eclipse.uml2.uml.Model theModel)
Returns the package representing the PSMView.
|
static org.eclipse.uml2.uml.Package |
getCHESSRtAnalysisPackage(org.eclipse.uml2.uml.Model theModel)
Returns the package representing the RTAnalysisView.
|
static org.eclipse.uml2.uml.Package |
getView(org.eclipse.emf.ecore.EObject element)
Gets the corresponding design view the model element resides in.
|
static boolean |
hasConcurrentViews(DiagramStatus.DesignView currentView)
Checks if the current view has virtual views activated.
|
static boolean |
hasConcurrentViews(java.lang.String viewName)
Checks if a design view can have virtual views.
|
static boolean |
isComponentView(DiagramStatus.DesignView view)
Deprecated.
use isDesignView(pkg, CHESSProfileManager.COMPONENT_VIEW)
|
static boolean |
isComponentView(org.eclipse.uml2.uml.Package pkg)
Deprecated.
use isDesignView(pkg, COMPONENT_VIEW)
|
static boolean |
isConcurrentView(DiagramStatus.DesignView currentView)
Checks if the current design view is a virtual view.
|
static boolean |
isDependabilityAnalysisView(DiagramStatus.DesignView view)
Deprecated.
use isDesignView(pkg, CHESSProfileManager.DEPENDABILITY_ANALYSIS_VIEW)
|
static boolean |
isDeploymentView(DiagramStatus.DesignView view)
Deprecated.
use
#isDesignView(DesignView, String) instead. |
static boolean |
isDeploymentView(org.eclipse.uml2.uml.Package pkg)
Deprecated.
use isDesignView(pkg, CHESSProfileManager.DEPLOYMENT_VIEW)
|
static boolean |
isDesignView(DiagramStatus.DesignView view,
java.lang.String name)
Checks if the current design view has the corresponding name.
|
static boolean |
isDesignView(org.eclipse.uml2.uml.Package pkg,
java.lang.String name)
Checks if the
Package passed as a parameter represents an actual design view. |
static boolean |
isElementInstantiable(org.eclipse.emf.ecore.EObject element,
java.lang.Object feature,
DiagramStatus.DesignView currentView,
org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
Checks if the current view owns (i.e.
|
static boolean |
isElementWritable_(org.eclipse.emf.ecore.EObject element,
java.lang.Object feature,
DiagramStatus.DesignView currentView,
org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
Checks if the current view has write access to (i.e can edit) the element/feature passed.
|
static boolean |
isElementWritable_(org.eclipse.emf.ecore.EObject element,
java.lang.Object feature,
java.lang.String viewName,
DiagramStatus.DesignView currentView,
org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
Checks if the given view has write access to (i.e can edit) the element/feature passed.
|
static boolean |
isExtraFunctionalView(DiagramStatus.DesignView view)
Deprecated.
use isDesignView(pkg, CHESSProfileManager.EXTRAFUNCTIONAL_VIEW)
|
static boolean |
isExtraFunctionalView(org.eclipse.uml2.uml.Package pkg)
Deprecated.
use isDesignView(pkg, EXTRAFUNCTIONAL_VIEW)
|
static boolean |
isOnView(DiagramStatus.DesignView currentView,
java.lang.String view)
Checks if the virtual design view is enabled.
|
static boolean |
isPSMView(org.eclipse.uml2.uml.Package pkg)
Deprecated.
use isDesignView(pkg, CHESSProfileManager.PSM_VIEW)
|
static boolean |
isRequirementView(org.eclipse.uml2.uml.Package pkg)
Deprecated.
use isDesignView(pkg, REQUIREMENT_VIEW)
|
static boolean |
isRTAnalysisView(org.eclipse.uml2.uml.Package pkg)
Deprecated.
use isDesignView(pkg, CHESSProfileManager.RT_ANALYSIS_VIEW)
|
static boolean |
isStereotypeInstantiable(org.eclipse.emf.ecore.EObject element,
java.lang.Object feature,
java.lang.Object stereotype,
DiagramStatus.DesignView currentView,
org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
Checks if the current view can create a stereotype.
|
static boolean |
isStereotypeWritable(org.eclipse.emf.ecore.EObject element,
java.lang.Object feature,
java.lang.Object stereotype,
DiagramStatus.DesignView currentView,
org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
Checks if the current view can edit a stereotype.
|
static boolean |
isSystemView(org.eclipse.uml2.uml.Package pkg)
Deprecated.
use isDesignView(pkg, CHESSProfileManager.SYSTEM_VIEW)
|
static boolean |
isViewModifiedOrRemoved(org.eclipse.emf.common.notify.Notification notification)
Checks if the stereotype of an actual view is modified or removed.
|
static boolean |
isViewStereotype(org.eclipse.uml2.uml.Stereotype stereotype)
Checks if the stereotype passed as a parameter represents a design view.
|
public static org.eclipse.uml2.uml.Package getView(org.eclipse.emf.ecore.EObject element)
element
- the model element@Deprecated public static boolean isDeploymentView(DiagramStatus.DesignView view)
#isDesignView(DesignView, String)
instead.view
- the design view, can be nullpublic static boolean isDesignView(DiagramStatus.DesignView view, java.lang.String name)
IllegalArgumentException
is raised.
Typical usage:
//check if the current view is a deployment view
//get the DesignView service
designViewService = ...
isDeploymentView = ViewUtils.isDesignView(designViewService, CHESSProfileManager.DEPLOYMENT_VIEW);
view
- the design view, can be nullname
- the name of the design view to check againstpublic static boolean isDesignView(org.eclipse.uml2.uml.Package pkg, java.lang.String name)
Package
passed as a parameter represents an actual design view.pkg
- the package to checkname
- the design view name@Deprecated public static boolean isDeploymentView(org.eclipse.uml2.uml.Package pkg)
pkg
- the pkg@Deprecated public static boolean isRTAnalysisView(org.eclipse.uml2.uml.Package pkg)
pkg
- the pkg@Deprecated public static boolean isDependabilityAnalysisView(DiagramStatus.DesignView view)
view
- the viewpublic static boolean isElementWritable_(org.eclipse.emf.ecore.EObject element, java.lang.Object feature, DiagramStatus.DesignView currentView, org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
element
- the model elementfeature
- the featurecurrentView
- the DesignView servicetheDomain
- the the domainpublic static boolean isElementWritable_(org.eclipse.emf.ecore.EObject element, java.lang.Object feature, java.lang.String viewName, DiagramStatus.DesignView currentView, org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
element
- the model elementfeature
- the featureviewName
- the view's namecurrentView
- the current viewtheDomain
- the the domainpublic static boolean isElementInstantiable(org.eclipse.emf.ecore.EObject element, java.lang.Object feature, DiagramStatus.DesignView currentView, org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
element
- the elementfeature
- the featurecurrentView
- the DesignView servicetheDomain
- the the domainpublic static boolean isStereotypeWritable(org.eclipse.emf.ecore.EObject element, java.lang.Object feature, java.lang.Object stereotype, DiagramStatus.DesignView currentView, org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
element
- the elementfeature
- the featurestereotype
- the stereotypecurrentView
- the DesignView servicetheDomain
- the the domainpublic static boolean isStereotypeInstantiable(org.eclipse.emf.ecore.EObject element, java.lang.Object feature, java.lang.Object stereotype, DiagramStatus.DesignView currentView, org.polarsys.chess.chessmlprofile.Core.Domain theDomain)
element
- the elementfeature
- the featurestereotype
- the stereotypecurrentView
- the DesignView servicetheDomain
- the the domainpublic static boolean isExtraFunctionalView(DiagramStatus.DesignView view)
view
- the viewpublic static boolean isExtraFunctionalView(org.eclipse.uml2.uml.Package pkg)
pkg
- the pkgpublic static boolean isComponentView(DiagramStatus.DesignView view)
view
- the viewpublic static boolean isComponentView(org.eclipse.uml2.uml.Package pkg)
pkg
- the pkgpublic static boolean isRequirementView(org.eclipse.uml2.uml.Package pkg)
pkg
- the pkgpublic static boolean isSystemView(org.eclipse.uml2.uml.Package pkg)
pkg
- the pkgpublic static boolean isPSMView(org.eclipse.uml2.uml.Package pkg)
pkg
- the pkgpublic static boolean isViewModifiedOrRemoved(org.eclipse.emf.common.notify.Notification notification)
notification
- the notificationpublic static boolean isViewStereotype(org.eclipse.uml2.uml.Stereotype stereotype)
stereotype
- the stereotypepublic static boolean isConcurrentView(DiagramStatus.DesignView currentView)
currentView
- the DesignView servicepublic static boolean isOnView(DiagramStatus.DesignView currentView, java.lang.String view)
currentView
- the DesignView serviceview
- the name of the virtual design view to checkpublic static org.eclipse.uml2.uml.Package getCHESSRtAnalysisPackage(org.eclipse.uml2.uml.Model theModel)
theModel
- the modelpublic static org.eclipse.uml2.uml.Package getCHESSDeploymentPackage(org.eclipse.uml2.uml.Model theModel)
theModel
- the modelpublic static org.eclipse.uml2.uml.Package getCHESSPSMPackage(org.eclipse.uml2.uml.Model theModel)
theModel
- the modelpublic static boolean hasConcurrentViews(DiagramStatus.DesignView currentView)
currentView
- the DesignView servicepublic static boolean hasConcurrentViews(java.lang.String viewName)
viewName
- the name of the viewpublic static java.lang.String getBaseViewName(DiagramStatus.DesignView currentView)
currentView
- the DesignView service