sk.uniba.euromath.editor
Class MultiViewXMLEditor

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.EditorPart
              extended by org.eclipse.ui.part.MultiPageEditorPart
                  extended by sk.uniba.euromath.editor.MultiViewXMLEditor
All Implemented Interfaces:
IAdaptable, IExecutableExtension, IEditorPart, ISaveablePart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPartOrientation

public class MultiViewXMLEditor
extends MultiPageEditorPart

Is an IEditorPart suporting views

For every opening file = IEditorInput new instance is created by workbench (or by us, somewhere in rcp, openfilewizard) and view for file is added.

For opened file new view can be opened by invoking ViewPopupMenu. Navigation between views is provided by pages localized at left-bottom of editor control, there can be also invoked ViewPopupMenu.

View is presented by EditorSite located on page within this editor.

View is defined by selecting XSLT transformation, stylesheet. So views differs by XSLT transformation used on common input with other views - edited document. View implements IEditorPart, is a true compound editor and must be EditorSite or extended.

Author:
Tomáš Studva 31.7.2005

Field Summary
static String ID
          With this id is registered as IEditorPart.
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
MultiViewXMLEditor()
          Constructor.
 
Method Summary
 void addViewListener(IViewListener listener)
          Adds view listener.
 void closeActiveView()
          Closes active view.
protected  void createPages()
          Creates one view = page for document which was just opened or created.
 void doSave(IProgressMonitor monitor)
           
 void doSaveAs()
           
 EditorSite getActiveView()
          Return active view.
 Object getAdapter(Class adapter)
           
 XMLResourceManipulator getResourceManipulator()
           
 XMLAccess getXMLAccess()
          Returns the document instance.
 void init(IEditorSite site, IEditorInput input)
           
 boolean isSaveAsAllowed()
           
 boolean outlineAvailable()
          Tests if outline is created/ready.
protected  void pageChange(int newPageIndex)
          When view is activated, selection is synchronized with outline.
 void removeViewListener(IViewListener listener)
          Removes view listener.
protected  void setInput(IEditorInput input)
          Checks if input is correct.
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
addPage, addPage, addPage, addPage, createPageContainer, createPartControl, createSite, dispose, getActiveEditor, getActivePage, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageText, handlePropertyChange, isDirty, removePage, setActivePage, setControl, setFocus, setPageImage, setPageText
 
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, 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, removePropertyListener
 

Field Detail

ID

public static final String ID
With this id is registered as IEditorPart.

See Also:
Constant Field Values
Constructor Detail

MultiViewXMLEditor

public MultiViewXMLEditor()
Constructor.

Method Detail

getAdapter

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

outlineAvailable

public boolean outlineAvailable()
Tests if outline is created/ready.

Returns:
true, if outline is avalaible

init

public void init(IEditorSite site,
                 IEditorInput input)
          throws PartInitException
Specified by:
init in interface IEditorPart
Overrides:
init in class MultiPageEditorPart
Throws:
PartInitException

createPages

protected void createPages()
Creates one view = page for document which was just opened or created.

Specified by:
createPages in class MultiPageEditorPart

setInput

protected void setInput(IEditorInput input)
Checks if input is correct.

Overrides:
setInput in class EditorPart

closeActiveView

public void closeActiveView()
Closes active view.


getActiveView

public EditorSite getActiveView()
Return active view.

Returns:
EditorSite

getXMLAccess

public final XMLAccess getXMLAccess()
Returns the document instance.

Returns:
the document instance.

pageChange

protected void pageChange(int newPageIndex)
When view is activated, selection is synchronized with outline.

Overrides:
pageChange in class MultiPageEditorPart

doSave

public void doSave(IProgressMonitor monitor)
Specified by:
doSave in interface ISaveablePart
Specified by:
doSave in class EditorPart

doSaveAs

public void doSaveAs()
Specified by:
doSaveAs in interface ISaveablePart
Specified by:
doSaveAs in class EditorPart

isSaveAsAllowed

public boolean isSaveAsAllowed()
Specified by:
isSaveAsAllowed in interface ISaveablePart
Specified by:
isSaveAsAllowed in class EditorPart

addViewListener

public void addViewListener(IViewListener listener)
Adds view listener.

Parameters:
listener - to add

removeViewListener

public void removeViewListener(IViewListener listener)
Removes view listener.

Parameters:
listener - to remove

getResourceManipulator

public XMLResourceManipulator getResourceManipulator()
Returns:
Returns the resourceManipulator.


Copyright © 2003-2006 null. All Rights Reserved.