|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEditor
Interface that each EuroMath2 editor must implement. Editor is a MVC
controller, that uses renderer output (the view) to edit source document. One
instance of editor edits one nameroot. Each editor receives its own instance
of IRenderer
. Editor is always associated with exactly one target
namespace.
The method call order is as follows: first the
init(Source,IRenderer,Composite,XMLAccess,EditorSite)
method is
called to initialize the editor. * After the initialization the editor must
be able to display renderer's IFigures, process keyboard and mouse events.
reinit(Source, IChangeCollector)
may be called at any time to inform
renderer of partial data change.
Editor can support only two kinds of sources: the
DOMSource
and
ObjectSource
, because they can be easily accessed
multiple times.
Instance of editor is always used by a single thread - it should not be synchronized, resulting in faster execution.
IRenderer
,
EditInstanceProvider
Method Summary | |
---|---|
void |
addFocusListener(IFocusListener listener)
Adds listener for focus events. |
void |
dispose()
Prepares for end of work. |
IActionContributor |
getActionContributor()
Returns action contributor, which can make bars special for this IEditor. |
Composite |
getClientComposite()
Returns Composite where clients - children IEditors will(should) be created. |
Composite |
getHostingComposite()
Returns composite which host this editor - composite received in init. |
IRenderer |
getRenderer()
Returns IRenderer for this IEditor from init. |
Set<String> |
getVisualizedIds()
Returns ids of nodes which are graphically rendered(represented) by this editor. |
void |
init(Source transformedDoc,
IRenderer renderer,
Composite parent,
XMLAccess xmlAccess,
EditorSite editorSite)
Initializes the editor. |
void |
performPaintUpdate()
Paints all figures needed to repaint. |
void |
reinit(Source transformedDoc,
IChangeCollector changes)
Reinitialize the editor when a partial change of the transformed document occurs. |
void |
removeFocusListener(IFocusListener listener)
Removes listener for focus events. |
void |
setFocus()
Ask this editor to set focus. |
void |
sortIds(List<String> ids)
Sorts ids in manner as they are graphicaly displayed. |
Methods inherited from interface sk.uniba.euromath.editor.selections.IDOMSelectionChangedListener |
---|
selectionChanged |
Method Detail |
---|
void init(Source transformedDoc, IRenderer renderer, Composite parent, XMLAccess xmlAccess, EditorSite editorSite) throws EditorException
Initializes the editor. The editor should retrieve all figures from the renderer and display them on given composite. It must NOT resize nor move the composite or its children - this is handled by the EditorSite itself.
The editor works with two 'kinds' of document:
source
parameter, and it
MUST NOT be modified. This document is given to the renderer instance.xmlAccess
facility.
transformedDoc
- the transformed document, rendered by the renderer.
May be instance of DOMSource
or ObjectSource
only. Editor is encouraged to throw any exception including
ClassCastException
if it encounters illegal objects, to
detect invalid objects quickly and cleanly.renderer
- instance of the renderer, rendering the transformed
document. The renderer instance is used only in this instance of editor.parent
- Composite
where to install
IFigure
s.xmlAccess
- the source document accessor.editorSite
- host for this class.
EditorException
- if the editor cannot be initialized. In such case
the common text editor/generic editor/read-only editor shall be used.void reinit(Source transformedDoc, IChangeCollector changes)
Reinitialize the editor when a partial change of the transformed document occurs. The reinitialization of renderer is already finished - editor should query for new figures for each changed element.
transformedDoc
- source with all changes already applied.changes
- defines changed elements. Has appropriate type for
transformedDoc
parameter, i.e. DOMChangeCollector
for DOMSource
etc.Composite getClientComposite()
Composite getHostingComposite()
IRenderer getRenderer()
void setFocus()
void dispose()
void performPaintUpdate()
IActionContributor getActionContributor()
void addFocusListener(IFocusListener listener)
listener
- void removeFocusListener(IFocusListener listener)
listener
- Set<String> getVisualizedIds()
void sortIds(List<String> ids)
ids
- list of ids to sort
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |