org.eclipse.ocl.examples.emf.validation.validity.ui.view
Class ValidityView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by org.eclipse.ocl.examples.emf.validation.validity.ui.view.ValidityView
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public class ValidityView
extends org.eclipse.ui.part.ViewPart
implements org.eclipse.ui.ISelectionListener

The ValidityView provides a dual view of ValidatableNode model elements and ConstrainingNode model classes to browse, filter and control model validation.


Nested Class Summary
protected  class ValidityView.ChangeSelectionJob
          The ChangeSelectionJob performs the work for a setSelection() without clogging up the UI.
static class ValidityView.ValidityViewLabelProvider
          ValidityViewLabelProvider extends the standard AdapterFactoryLabelProvider to provide icons for non-standard Java objects such as Method.
 
Field Summary
protected  FilteredCheckboxTree filteredConstrainingNodesTree
           
protected  FilteredCheckboxTree filteredValidatableNodesTree
           
static java.lang.String ID
          The ID of the view as specified by the extension.
protected  org.eclipse.emf.ecore.resource.ResourceSet modelResourceSet
           
protected  IDEValidityManager validityManager
           
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ValidityView()
           
 
Method Summary
 void addFilter(boolean isValidatableFilterAction, IVisibilityFilter filter)
           
 void addFilteredSeverity(Severity severity)
           
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          This is a callback that will allow us to create the viewer and initialize it.
protected static org.eclipse.jface.action.ToolBarManager createSectionToolBar(org.eclipse.ui.forms.widgets.Section section)
          Creates a tool bar for the given section.
protected  void createValidityViewForm(org.eclipse.ui.forms.widgets.FormToolkit toolkit, org.eclipse.swt.widgets.Composite parent)
          This will be called in order to create the actual body of the validity view, the "Validity" form.
 void dispose()
           
 org.eclipse.jface.viewers.CheckboxTreeViewer getConstrainingNodesViewer()
          gets the Constraining Nodes Viewer
protected  org.eclipse.ui.forms.widgets.Form getForm()
          Returns the validity view form.
 org.eclipse.jface.viewers.CheckboxTreeViewer getValidatableNodesViewer()
          gets the validatable Nodes Viewer
 IDEValidityManager getValidityManager()
          gets the Validity Manager
protected  void initializeFilters()
           
 void redraw()
          Schedule a redraw of validatable and constraining trees.
 void removeFilter(boolean isValidatableFilterAction, IVisibilityFilter filter)
           
 void removeFilteredSeverity(Severity severity)
           
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
           
 void setFocus()
          Passing the focus request to the viewer's control.
protected  void setSelection(org.eclipse.emf.common.notify.Notifier newSelection)
           
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

ID

@NonNull
public static final java.lang.String ID
The ID of the view as specified by the extension.

See Also:
Constant Field Values

filteredValidatableNodesTree

protected FilteredCheckboxTree filteredValidatableNodesTree

filteredConstrainingNodesTree

protected FilteredCheckboxTree filteredConstrainingNodesTree

validityManager

@NonNull
protected final IDEValidityManager validityManager

modelResourceSet

protected org.eclipse.emf.ecore.resource.ResourceSet modelResourceSet
Constructor Detail

ValidityView

public ValidityView()
Method Detail

addFilter

public void addFilter(boolean isValidatableFilterAction,
                      @NonNull
                      IVisibilityFilter filter)

addFilteredSeverity

public void addFilteredSeverity(@NonNull
                                Severity severity)

createSectionToolBar

protected static final org.eclipse.jface.action.ToolBarManager createSectionToolBar(org.eclipse.ui.forms.widgets.Section section)
Creates a tool bar for the given section.

Parameters:
section - The section for which we need a tool bar.
Returns:
The created tool bar.

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
This is a callback that will allow us to create the viewer and initialize it.

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

createValidityViewForm

protected void createValidityViewForm(org.eclipse.ui.forms.widgets.FormToolkit toolkit,
                                      org.eclipse.swt.widgets.Composite parent)
This will be called in order to create the actual body of the validity view, the "Validity" form.

Parameters:
toolkit - Toolkit that can be used to create the form.
parent - Parent composite of the form.

getForm

protected org.eclipse.ui.forms.widgets.Form getForm()
Returns the validity view form.

Returns:
The validity view form.

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart

getConstrainingNodesViewer

@NonNull
public org.eclipse.jface.viewers.CheckboxTreeViewer getConstrainingNodesViewer()
gets the Constraining Nodes Viewer

Returns:
the constrainingNodesViewer

getValidityManager

@NonNull
public IDEValidityManager getValidityManager()
gets the Validity Manager

Returns:
the validityManager

getValidatableNodesViewer

@NonNull
public org.eclipse.jface.viewers.CheckboxTreeViewer getValidatableNodesViewer()
gets the validatable Nodes Viewer

Returns:
the validatableNodesViewer

initializeFilters

protected void initializeFilters()

redraw

public void redraw()
Schedule a redraw of validatable and constraining trees.


removeFilter

public void removeFilter(boolean isValidatableFilterAction,
                         @NonNull
                         IVisibilityFilter filter)

removeFilteredSeverity

public void removeFilteredSeverity(@NonNull
                                   Severity severity)

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener

setSelection

protected void setSelection(org.eclipse.emf.common.notify.Notifier newSelection)

setFocus

public void setFocus()
Passing the focus request to the viewer's control. This will Refresh the viewers contents.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart