blob: df3a54625969bb4fc88594a6103767cfe4d04599 [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Validity View (new in Luna)</title>
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
<link rel="home" href="index.html" title="OCL Documentation">
<link rel="up" href="UsersGuide.html" title="Users Guide">
<link rel="prev" href="InteractiveOCL.html" title="Console">
<link rel="next" href="Debugger.html" title="Debugger (new in Luna)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Validity View (new in Luna)</h1>
<div class="section" title="Validity View (new in Luna)">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ValidityView"></a>Validity View (new in Luna)</h2>
</div>
</div>
</div>
<p>The standard EMF validation capabilities provide a useful overview of problems:</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>as markers in the source model,</p>
</li>
<li class="listitem">
<p>as markers in the Problems View,</p>
</li>
<li class="listitem">
<p>in Pop-up dialogs.</p>
</li>
</ul>
</div>
<p>The
<span class="bold"><strong>Validity View</strong></span> provides a much more detailed view of the problems and so assists in debugging bad models and/or bad constaints.
</p>
<p>The
<span class="bold"><strong>Validity View</strong></span> may be shown by invoking
<span class="bold"><strong>OCL-&gt;Show Validity View</strong></span> from the right button menu of some model editors such as the
<span class="bold"><strong>Sample Ecore Model Editor</strong></span>. Alternatively the
<span class="bold"><strong>Validity View</strong></span> view may be created by
<span class="bold"><strong>Window-&gt;Show View-&gt;Other... OCL-&gt;Validity View</strong></span>.
</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1530-validity-view.png"></div>
<p>
</p>
<p>The left-hand pane titled Model Elements provides a tree view of the Resources in a ResourceSet in a similar fashion to the Sample Ecore Editor. However an additional child element (in blue italics) is added for each constraint applicable to its parent element. Checkboxes enable or disable the element from re-validations and JUnit-like status icons show the status of the most recent validation. Hovertext provides further detail.</p>
<p>The right-hand pane titled Metamodel Constraints provides a tree view of the model hierarchies that contribute constraints. An additional child element is added for each model element to which the constraint applies.</p>
<p>The displays track the mouse selection in other views. Whenever the mouse selection can be resolved to an EObject, that EObject&rsquo;s ResourceSet populates the left hand pane and constraints affecting the left hand pane populate the right hand pane. Tracking the mouse selection is quite expensive, and probably irritating. It can be inhibited by pinning the view to the current selection.</p>
<p>There is generally much too much detail if all elements and constraints are considered and so the view provides many facilities to facilitate focusing on the interesting combinations.</p>
<div class="section" title="View Tool Bar">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ValidityViewToolBar"></a>View Tool Bar</h3>
</div>
</div>
</div>
<p>The View Tool Bar is at the top and right of the view following the Validity View title. It provides facilities common to both Model Elements and Metamodel Constraints.</p>
<div class="section" title="Expand All">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="ExpandAll"></a>Expand All</h4>
</div>
</div>
</div>
<p>The plus icon causes the Model Elements and Metamodel Constraints to be fully expanded to display all their contents. Beware that for large models this may result in slow screen updates. </p>
</div>
<div class="section" title="Collapse All">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="CollapseAll"></a>Collapse All</h4>
</div>
</div>
</div>
<p>The minus icon causes the Model Elements and Metamodel Constraints to collapse to display only their top level elements. </p>
</div>
<div class="section" title="Pin">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Pin"></a>Pin</h4>
</div>
</div>
</div>
<p>The pin icon toggles the track current cursor selection. When unpinned, the default, any change in mouse selection may cause recomputation of Model Elements and Metamodel Constraints contents. When pinned the contents are stable.</p>
</div>
<div class="section" title="Refresh">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Refresh"></a>Refresh</h4>
</div>
</div>
</div>
<p>The double arrow icon causes the Model Elements and Metamodel Constraints to be recomputed. This may be necessary for a metamodel change to be used.</p>
</div>
<div class="section" title="Run">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Run"></a>Run</h4>
</div>
</div>
</div>
<p>The white triangle in green circle icon runs a validation on all enabled model element/constraint combinations updating the status indications for constraints in the left hand Model Element and model elements in right hand Constraint pane.</p>
</div>
<div class="section" title="Filter">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Filter"></a>Filter</h4>
</div>
</div>
</div>
<p>The Filtering menu hides unwanted contributions to the display. Each of the validation result statuses can be individually enabled.</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>Show all errors</p>
</li>
<li class="listitem">
<p>Show all infos</p>
</li>
<li class="listitem">
<p>Show all failures</p>
</li>
<li class="listitem">
<p>Show all warnings</p>
</li>
<li class="listitem">
<p>Show all successes</p>
</li>
</ul>
</div>
<p>By default none of the selections are enabled so everything is shown. As soon as a specific status is enabled all display elements with other non-enabled statuses are hidden. Thus selecting just *Show all warnings" hides error/info/failure/success results.</p>
</div>
<div class="section" title="Save">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Save"></a>Save</h4>
</div>
</div>
</div>
<p>The floppy disk icon supports export of the validation results.</p>
<p>The available export formats are extensible through the org.eclipse.ocl.examples.emf.validation.validity.validity_exporter extension point.</p>
<p>The default exporters support</p>
<div class="section" title="html">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="html"></a>html</h5>
</div>
</div>
</div>
<p>An HTML file summarising the results.</p>
</div>
<div class="section" title="model">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="model"></a>model</h5>
</div>
</div>
</div>
<p>An XMI model conforming to validity.ecore containing all results with references to the model elements and constraints.</p>
</div>
<div class="section" title="text">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="text"></a>text</h5>
</div>
</div>
</div>
<p>A text file summarising the results.</p>
</div>
</div>
</div>
<div class="section" title="Model Elements Pane">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ValidityViewModelElementsPane"></a>Model Elements Pane</h3>
</div>
</div>
</div>
<p>The Model Elements Pane is the left hand pane of the Validity View. </p>
<p>It comprises a title and tool bar, text filter and scrollable tree of model elements and their constraints.</p>
<div class="section" title="Model Elements Tool Bar">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="ValidityViewModelElementsToolBar"></a>Model Elements Tool Bar</h4>
</div>
</div>
</div>
<p>The Model Elements Tool Bar is at the top and right of the left hand pane following the Model Elements title. It provides facilities specific to the Model Elements.</p>
<div class="section" title="Expand All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ExpandAll2"></a>Expand All</h5>
</div>
</div>
</div>
<p>The plus icon causes the Model Elements to be fully expanded to display all their contents. Beware that for large models this may result in slow screen updates. </p>
</div>
<div class="section" title="Collapse All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="CollapseAll2"></a>Collapse All</h5>
</div>
</div>
</div>
<p>The minus icon causes the Model Elements to collapse to display only their top level elements. </p>
</div>
<div class="section" title="Enable All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="EnableAll"></a>Enable All</h5>
</div>
</div>
</div>
<p>The tick icon causes all Model Elements to be enabled and so included in the next validation.</p>
</div>
<div class="section" title="Disable All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="DisableAll"></a>Disable All</h5>
</div>
</div>
</div>
<p>The no-tick icon causes all Model Elements to be disabled and so excluded from the next validation.</p>
</div>
<div class="section" title="Show/Hide disabled">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ShowHidedisabled"></a>Show/Hide disabled </h5>
</div>
</div>
</div>
<p>The document icon with a query controls whether disabled Model Element selections are visible. A diagonal strikethrough shows when selections are hidden.</p>
<p>By default disabled selections are hidden, which allows the unwanted root elements of large models to be unchecked and so hidden before a slow attempt is made to display them.</p>
</div>
</div>
<div class="section" title="Text Filter">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="TextFilter"></a>Text Filter</h4>
</div>
</div>
</div>
<p>The text filter takes a StringMatcher pattern that selects which elements are visible. The pattern may contain</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>a * to match zero or more characters</p>
</li>
<li class="listitem">
<p>a ? to match exactly one character</p>
</li>
<li class="listitem">
<p>a \ to escape the following character</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Model Elements tree">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="ModelElementstree"></a>Model Elements tree</h4>
</div>
</div>
</div>
<p>The scrollable tree shows the containment hierarchy of all elements in the ResourceSet containing the model element identified by the mouse selection.</p>
<p>The +/- collapse/expand icons preceding each element enable interesting elements to be shown and others folded away.</p>
<p>Each element is preceded by a check box that enables its usage within the next validation run. All elements may be enabled or disabled using the icons in the Model Elements Tool Bar. Enabling/disabling individual elements enables/disables the element&rsquo;s descendants and propagates a partial enable/disable to the element&rsquo;s ancestors.</p>
<p>The checkbox is followed by a validation status icon.</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>tick for validation successful</p>
</li>
<li class="listitem">
<p>red cross for validation unsuccessful but incomplete</p>
</li>
<li class="listitem">
<p>blue cross for validation failure (incomplete)</p>
</li>
<li class="listitem">
<p>amber warning for a validation warning</p>
</li>
<li class="listitem">
<p>question mark for no validation performed</p>
</li>
</ul>
</div>
<p>The status icon is followed by an element-specific icon identifying its type and label.</p>
<p>Double-clicking a leaf Constraint in the left-hand pane makes the corresponding constraint and parent model-element visible in the right-hand pane.</p>
</div>
<div class="section" title="Model Elements Context Menu">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="ModelElementsContextMenu"></a>Model Elements Context Menu</h4>
</div>
</div>
</div>
<p>The context menu in the model elements tree offers the following facilities in addition to those also available in the toolbar.</p>
<div class="section" title="Validate Selection">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ValidateSelection"></a>Validate Selection</h5>
</div>
</div>
</div>
<p>Revalidates all constraints applicable to the selected Model Element and its children.</p>
</div>
<div class="section" title="Debug Single Enabled Selection">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="DebugSingleEnabledSelection"></a>Debug Single Enabled Selection</h5>
</div>
</div>
</div>
<p>Launches the debugger for the selected Model Element and associated Constraint.</p>
<p>The entry is greyed out if more than one Constraint is selected, so the invocation should normally be made from a leaf Constraint result.</p>
<p>
<span class="italic">Debug launching is only available for OCL constraints in Luna SR0.</span>
</p>
</div>
<div class="section" title="Show in Editor">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ShowinEditor"></a>Show in Editor</h5>
</div>
</div>
</div>
<p>Opens an editor for the selected Model Element or Metamodel Constraint.</p>
<p>
<span class="italic">Opening is not available for all forms of constraint in Luna SR0.</span>
</p>
</div>
</div>
</div>
<div class="section" title="Metamodel Constraints Pane">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ValidityViewMetamodelConstraintsPane"></a>Metamodel Constraints Pane</h3>
</div>
</div>
</div>
<p>The Metamodel Constraints Pane is the right hand pane of the Validity View. </p>
<p>It comprises a title and tool bar, text filter and scrollable tree of metamodel constraints and the model elements to which they apply.</p>
<div class="section" title="Metamodel Constraints Tool Bar">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="ValidityViewMetamodelConstraintsToolBar"></a>Metamodel Constraints Tool Bar</h4>
</div>
</div>
</div>
<p>The Metamodel Constraints Tool Bar is at the top and right of the right hand pane following the Metamodel Constraints title. It provides facilities specific to the Metamodel Constraints.</p>
<div class="section" title="Expand All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ExpandAll3"></a>Expand All</h5>
</div>
</div>
</div>
<p>The plus icon causes the Metamodel Constraints to be fully expanded to display all their contents. Beware that for large models this may result in slow screen updates. </p>
</div>
<div class="section" title="Collapse All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="CollapseAll3"></a>Collapse All</h5>
</div>
</div>
</div>
<p>The minus icon causes the Metamodel Constraints to collapse to display only their top level elements. </p>
</div>
<div class="section" title="Enable All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="EnableAll2"></a>Enable All</h5>
</div>
</div>
</div>
<p>The tick icon causes all Metamodel Constraints to be enabled and so included in the next validation.</p>
</div>
<div class="section" title="Disable All">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="DisableAll2"></a>Disable All</h5>
</div>
</div>
</div>
<p>The no-tick icon causes all Metamodel Constraints to be disabled and so excluded from the next validation.</p>
</div>
<div class="section" title="Show/Hide disabled">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ShowHidedisabled2"></a>Show/Hide disabled </h5>
</div>
</div>
</div>
<p>The document icon with a query controls whether disabled Metamodel Constraints selections are visible. A diagonal strikethrough shows when selections are hidden.</p>
<p>By default disabled selections are hidden, which allows the unwanted root elements of large metamodels to be unchecked and so hidden before a slow attempt is made to display them. </p>
</div>
</div>
<div class="section" title="Text Filter">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="TextFilter2"></a>Text Filter</h4>
</div>
</div>
</div>
<p>The text filter takes a StringMatcher pattern that selects which elements are visible. The pattern may contain</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>a * to match zero or more characters</p>
</li>
<li class="listitem">
<p>a ? to match exactly one character</p>
</li>
<li class="listitem">
<p>a \ to escape the following character</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Metamodel Constraints tree">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="MetamodelConstraintstree"></a>Metamodel Constraints tree</h4>
</div>
</div>
</div>
<p>The scrollable tree shows the containment hierarchy of all constraints applicable to model elements in the ResourceSet containing the model element identified by the mouse selection.</p>
<p>The +/- collapse/expand icons preceding each element enable interesting elements to be shown and others folded away.</p>
<p>Each element is preceded by a check box that enables its usage within the next validation run. All elements may be enabled or disabled using the icons in the Model Elements Tool Bar. Enabling/disabling individual elements enables/disables the element&rsquo;s descendants and propagates a partial enable/disable to the element&rsquo;s ancestors.</p>
<p>The checkbox is followed by a validation status icon.</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>tick for validation successful</p>
</li>
<li class="listitem">
<p>red cross for validation unsuccessful but incomplete</p>
</li>
<li class="listitem">
<p>blue cross for validation failure (incomplete)</p>
</li>
<li class="listitem">
<p>amber warning for a validation warning</p>
</li>
<li class="listitem">
<p>question mark for no validation performed</p>
</li>
</ul>
</div>
<p>The status icon is followed by an element-specific icon identifying its type and label.</p>
<p>Double-clicking a leaf Model Element in the right-hand pane makes the corresponding Model Element and parent Metamodel Constraint visible in the left-hand pane.</p>
</div>
<div class="section" title="Metamodel Constraints Context Menu">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="MetamodelConstraintsContextMenu"></a>Metamodel Constraints Context Menu</h4>
</div>
</div>
</div>
<p>The context menu in the metamodel constraints tree offers the following facilities in addition to those also available in the toolbar.</p>
<div class="section" title="Validate Selection">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ValidateSelection2"></a>Validate Selection</h5>
</div>
</div>
</div>
<p>Revalidates all model elements applicable to the selected constraint and its children.</p>
</div>
<div class="section" title="Debug Single Enabled Selection">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="DebugSingleEnabledSelection2"></a>Debug Single Enabled Selection</h5>
</div>
</div>
</div>
<p>Launches the debugger for the selected Model Element and associated Constraint.</p>
<p>The entry is greyed out if more than one Constraint is selected, so the invocation should normally be made from a leaf Model Element result.</p>
<p>
<span class="italic">Debug launching is only available for OCL constraints in Luna SR0.</span>
</p>
</div>
<div class="section" title="Show in Editor">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="ShowinEditor2"></a>Show in Editor</h5>
</div>
</div>
</div>
<p>Opens an editor for the selected Model Element or Metamodel Constraint.</p>
<p>
<span class="italic">Opening is not available for all forms of constraint in Luna SR0.</span>
</p>
</div>
</div>
</div>
<div class="section" title="Constraint Locators">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ConstraintLocators"></a>Constraint Locators</h3>
</div>
</div>
</div>
<p>The constraints displayed in the right hand pane are located by constraint locators that are registered with the org.eclipse.ocl.examples.emf.validation.validity.constraint_locator extension point. A constraint locator implements org.eclipse.ocl.examples.emf.validation.validity.locator.ConstraintLocator or the org.eclipse.ocl.examples.emf.validation.validity.ui.locator.ConstraintUILocator to define location, presentation, execution and debug launching of a particular kind of constraint.</p>
<p>Constraint locators are associated with metamodel namespaces which are determined by the nsURI of the EPackage that contains the EClass of a Model Element EObject. Constraint locators may be registered for a particular metamodel namespace or for no namespace. Those registered for no namespace are activated whenever a namespace is encountered for which no specific constraint locators are registered.</p>
<p>The following Constraint Locators are available by default.</p>
<div class="section" title="org.eclipse.ocl.examples.emf.validation.validity.locator.EClassConstraintLocator">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="org.eclipse.ocl.examples.emf.validation.validity.locator.EClassConstraintLocator"></a>org.eclipse.ocl.examples.emf.validation.validity.locator.EClassConstraintLocator</h4>
</div>
</div>
</div>
<p>This constraint locator supports discovery of constraints realized by invariant EOperations in the Java code generated by an EMF genmodel.</p>
</div>
<div class="section" title="org.eclipse.ocl.examples.emf.validation.validity.locator.EValidatorConstraintLocator">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="org.eclipse.ocl.examples.emf.validation.validity.locator.EValidatorConstraintLocator"></a>org.eclipse.ocl.examples.emf.validation.validity.locator.EValidatorConstraintLocator</h4>
</div>
</div>
</div>
<p>This constraint locator supports reflective discovery of validateXXXX methods in the Java code generated by an EMF genmodel using the EValidatorRegistry to identify the relevant Java code.</p>
</div>
<div class="section" title="org.eclipse.ocl.examples.validity.locator.DelegateUIConstraintLocator">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="org.eclipse.ocl.examples.validity.locator.DelegateUIConstraintLocator"></a>org.eclipse.ocl.examples.validity.locator.DelegateUIConstraintLocator</h4>
</div>
</div>
</div>
<p>This constraint locator supports OCL constraints represented as EAnnotations in Ecore metamodels.</p>
</div>
<div class="section" title="org.eclipse.ocl.examples.validity.locator.PivotUIConstraintLocator">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="org.eclipse.ocl.examples.validity.locator.PivotUIConstraintLocator"></a>org.eclipse.ocl.examples.validity.locator.PivotUIConstraintLocator</h4>
</div>
</div>
</div>
<p>This constraint locator supports discovery of org.eclipse.ocl.pivot.Constraint classes in Pivot metamodels.</p>
</div>
<div class="section" title="org.eclipse.ocl.examples.validity.locator.UMLUIConstraintLocator">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="org.eclipse.ocl.examples.validity.locator.UMLUIConstraintLocator"></a>org.eclipse.ocl.examples.validity.locator.UMLUIConstraintLocator</h4>
</div>
</div>
</div>
<p>This constraint locator supports discovery of org.eclipse.uml2.uml.Constraint classes in UML metamodels.</p>
</div>
</div>
</div>
</body>
</html>