sk.uniba.euromath.plugin.views.outline
Class XMLOutlinePage

java.lang.Object
  extended by org.eclipse.ui.part.Page
      extended by sk.uniba.euromath.plugin.views.outline.XMLOutlinePage
All Implemented Interfaces:
IAdaptable, ISelectionChangedListener, ISelectionProvider, IPage, IPageBookViewPage, IContentOutlinePage, IDOMSelectionChangedListener, IDOMSelectionProvider

public class XMLOutlinePage
extends Page
implements IContentOutlinePage, IDOMSelectionChangedListener, ISelectionChangedListener, IAdaptable, IDOMSelectionProvider


Field Summary
protected  XMLOutlineActionContributor actionContributor
          Outline action contributor.
 
Constructor Summary
XMLOutlinePage(EditorSite editorSite)
          Contructor.
 
Method Summary
 void addSelectionChangedListener(IDOMSelectionChangedListener listener)
          Adds a listener for selection changes in this selection provider.
 void addSelectionChangedListener(ISelectionChangedListener listener)
           
protected  IStructuredSelection convertDOMSelectionToStructuredSelection(DOMIntervalSet domSelection)
           
 void createControl(Composite parent)
          Set ups outline view.
protected  TreeViewer createTreeViewer(Composite parent)
          Creates and set ups reeViewer on composite.
 void dispose()
           
protected  void fireSelectionChangeEvent(DOMIntervalSet xmlSelection)
          Fires event when selection in page changed.
 Object getAdapter(Class adapter)
           
 XMLAccessContentProvider getContentProvider()
           
 Control getControl()
           
 DOMIntervalSet getDOMSelection()
          Returns copy of the current selection of provider.
protected  sk.uniba.euromath.plugin.views.outline.OutlineItemsLabelProvider getLabelProvider()
           
protected  Node getRoot()
          Returns XML node which will be the root of the outline tree.
 ISelection getSelection()
          This method is only here because of contract - is realy not needed.
 TreeViewer getViewer()
           
 XMLAccess getXMLAccess()
           
 void handleDocumentTransformation(XMLAccess newData)
          Handles when document has been transformed.
 void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager)
           
 void refreshViewerData(Node topNode)
           
 void removeSelectionChangedListener(IDOMSelectionChangedListener listener)
          Removes the given selection change listener from this selection provider.
 void removeSelectionChangedListener(ISelectionChangedListener listener)
           
 void selectionChanged(DOMSelectionChangedEvent event)
          EditorSite's selection change event handling.
 void selectionChanged(SelectionChangedEvent event)
          Handles selection changes in viewer.
 void setContentProvider(XMLAccessContentProvider contentProvider)
          Associates with Outline content provider.
 void setFocus()
           
protected  void setLabelProvider(sk.uniba.euromath.plugin.views.outline.OutlineItemsLabelProvider labelProvider)
          Associates with Outline label provider.
 void setSelection(DOMIntervalSet domSelection)
          Routs information about this new IXMLSelection to SelectionListeners and to TreeViewer
 void setSelection(ISelection selection)
          This method is only here because of contract - is realy not needed.
 void setShowTransformed(boolean showTrn)
           
protected  void startSelectionListening()
          Starts listening to selection change events.
protected  void stopSelectionListening()
          Stops listening to selection change events.
 
Methods inherited from class org.eclipse.ui.part.Page
getSite, init, setActionBars
 
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.part.IPage
setActionBars
 

Field Detail

actionContributor

protected XMLOutlineActionContributor actionContributor
Outline action contributor.

Constructor Detail

XMLOutlinePage

public XMLOutlinePage(EditorSite editorSite)
Contructor.

Parameters:
editorSite - associated editor site
Method Detail

createControl

public void createControl(Composite parent)
Set ups outline view.

Specified by:
createControl in interface IPage
Specified by:
createControl in class Page

makeContributions

public void makeContributions(IMenuManager menuManager,
                              IToolBarManager toolBarManager,
                              IStatusLineManager statusLineManager)
Overrides:
makeContributions in class Page

dispose

public void dispose()
Specified by:
dispose in interface IPage
Overrides:
dispose in class Page

getRoot

protected Node getRoot()
Returns XML node which will be the root of the outline tree.


createTreeViewer

protected TreeViewer createTreeViewer(Composite parent)
Creates and set ups reeViewer on composite.

Parameters:
parent -
Returns:

getAdapter

public Object getAdapter(Class adapter)
Specified by:
getAdapter in interface IAdaptable

getControl

public Control getControl()
Specified by:
getControl in interface IPage
Specified by:
getControl in class Page

handleDocumentTransformation

public void handleDocumentTransformation(XMLAccess newData)
Handles when document has been transformed. Updates viewer to display data from document.

Parameters:
newData - new document access

refreshViewerData

public void refreshViewerData(Node topNode)

setFocus

public void setFocus()
Specified by:
setFocus in interface IPage
Specified by:
setFocus in class Page

getDOMSelection

public DOMIntervalSet getDOMSelection()
Description copied from interface: IDOMSelectionProvider
Returns copy of the current selection of provider.

Specified by:
getDOMSelection in interface IDOMSelectionProvider
Returns:
the current selection by copy

getSelection

public ISelection getSelection()
This method is only here because of contract - is realy not needed.

Specified by:
getSelection in interface ISelectionProvider

addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)
Specified by:
addSelectionChangedListener in interface ISelectionProvider

addSelectionChangedListener

public void addSelectionChangedListener(IDOMSelectionChangedListener listener)
Description copied from interface: IDOMSelectionProvider
Adds a listener for selection changes in this selection provider. Has no effect if an identical listener is already registered.

Specified by:
addSelectionChangedListener in interface IDOMSelectionProvider
Parameters:
listener - a DOM selection changed listener

removeSelectionChangedListener

public void removeSelectionChangedListener(IDOMSelectionChangedListener listener)
Description copied from interface: IDOMSelectionProvider
Removes the given selection change listener from this selection provider. Has no affect if listener is not registered.

Specified by:
removeSelectionChangedListener in interface IDOMSelectionProvider
Parameters:
listener - a DOM selection changed listener

removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)
Specified by:
removeSelectionChangedListener in interface ISelectionProvider

setSelection

public void setSelection(DOMIntervalSet domSelection)
Routs information about this new IXMLSelection to SelectionListeners and to TreeViewer

Specified by:
setSelection in interface IDOMSelectionProvider
Parameters:
selection - IXMLSelection to set

setSelection

public void setSelection(ISelection selection)
This method is only here because of contract - is realy not needed.

Specified by:
setSelection in interface ISelectionProvider

selectionChanged

public void selectionChanged(DOMSelectionChangedEvent event)
EditorSite's selection change event handling.

Specified by:
selectionChanged in interface IDOMSelectionChangedListener
Parameters:
event - event object describing the change

convertDOMSelectionToStructuredSelection

protected IStructuredSelection convertDOMSelectionToStructuredSelection(DOMIntervalSet domSelection)

stopSelectionListening

protected void stopSelectionListening()
Stops listening to selection change events.


startSelectionListening

protected void startSelectionListening()
Starts listening to selection change events.


fireSelectionChangeEvent

protected void fireSelectionChangeEvent(DOMIntervalSet xmlSelection)
Fires event when selection in page changed.

Parameters:
xmlSelection - new selection to fire in event

selectionChanged

public void selectionChanged(SelectionChangedEvent event)
Handles selection changes in viewer. Selection change in viewer is selection change in outline, so selection change event is fired.

Specified by:
selectionChanged in interface ISelectionChangedListener

setShowTransformed

public void setShowTransformed(boolean showTrn)

getViewer

public TreeViewer getViewer()
Returns:
Returns the viewer.

getContentProvider

public XMLAccessContentProvider getContentProvider()
Returns:
Returns the contentProvider.

setContentProvider

public void setContentProvider(XMLAccessContentProvider contentProvider)
Associates with Outline content provider.

Parameters:
contentProvider - The contentProvider to set.

getXMLAccess

public XMLAccess getXMLAccess()
Returns:
Returns the xmlAccess.

getLabelProvider

protected sk.uniba.euromath.plugin.views.outline.OutlineItemsLabelProvider getLabelProvider()
Returns:
Returns the labelProvider.

setLabelProvider

protected void setLabelProvider(sk.uniba.euromath.plugin.views.outline.OutlineItemsLabelProvider labelProvider)
Associates with Outline label provider.

Parameters:
labelProvider - The labelProvider to set.


Copyright © 2003-2006 null. All Rights Reserved.