abstract class %ZEN.StudioDocument.AbstractEditor
extends %ZEN.Component.page
Base class for Studio Document editors that use the XEDIT
window within Studio.
An XEDIT document is a window within Studio with 2 panes: the upper
pane contains HTML content, served by a subclass of this class;
the lower pane displays an editable XML representation of the data
displayed in the upper pane. This XML representation is provided by this
class as well.
Subclasses of this are used to provide Studio content editors
for Abstract documents served by a corresponding subclass of the
%ZEN.StudioDocument.AbstractDocument class.
This is a Zen Page class.
property DocumentID
as %ZEN.Datatype.string(ZENURL="ID");
ID of current document.
This is provided, as a URL parameter, by the Studio.
property documentName
as %ZEN.Datatype.string(ZENURL="DOC");
Name of document being edited.
This is provided, as a URL parameter, by the Studio.
property modified
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Indicates that this document is modified.
Use the isModified,setModified,
and clearModified methods
to observe and change this.
property readOnly
as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Indicates that this document is in read only mode.
Editors should not set this property; it is set by the Studio.
Use the isReadOnly method to observe this.
property zoom
as %ZEN.Datatype.float [ InitialExpression = 100 ];
Current zoom level (as a percentage) of this editor (if applicable).
Use the getZoom and setZoom
methods to modify and observe this.
method %OnDrawHTMLHead()
as %Status
This callback is called at the start of the HTML HEAD section of the page.
This writes out the JavaScript methods expected by the Studio API.
classmethod GetClassName(pName As %String)
as %String
Given a document name, strip off the extension and return the class name.
method clearModified()
[ Language = javascript ]
Clear the modified flag for this editor.
method getZoom()
[ Language = javascript ]
Return the zoom level of the editor.
method isModified()
[ Language = javascript ]
Test if the document is modified.
method isReadOnly()
[ Language = javascript ]
Return the ReadOnly state of the editor.
abstract method onCanUndo()
[ Language = javascript ]
Test if undo is possible.
abstract method onCmdCopy()
[ Language = javascript ]
Notification that user has invoked the copy command.
abstract method onCmdCut()
[ Language = javascript ]
Notification that user has invoked the cut command.
abstract method onCmdDelete()
[ Language = javascript ]
Notification that user has invoked the delete command.
abstract method onCmdPaste()
[ Language = javascript ]
Notification that user has invoked the paste command.
abstract method onCmdRedo()
[ Language = javascript ]
Notification that user has invoked the redo command.
abstract method onCmdUndo()
[ Language = javascript ]
Notification that user has invoked the undo command.
abstract method onGetDocument()
[ Language = javascript ]
Get document with current state of editor
(raise event with current document in it)
abstract method onGetProperty(prop)
[ Language = javascript ]
Return the value of a specific property value from the editor.
method onSetDocument(state)
[ Language = javascript ]
Notification that the user has changed the XML version of this
document.
state is the contents of the XML editor pane.
abstract method onSetProperty(prop, value)
[ Language = javascript ]
Notification that the user has changed a property using
the Inspector.
prop is the property name, value is the
new value.
abstract method onSetReadOnly()
[ Language = javascript ]
Notification that Studio has modified the ReadOnly state of the editor.
abstract method onSetZoom()
[ Language = javascript ]
Notification that the zoom level of the editor has changed.
method onStartEditor()
[ Language = javascript ]
This client event, if present, is fired when editor is loaded.
method onloadHandler()
[ Language = javascript ]
This client event, if present, is fired when the page is loaded.
method raiseDocument(state)
[ Language = javascript ]
Raise a 'document' event to Studio.
This will set the contents of the XML pane within the Studio edit window,
if applicable. state is the text that will be placed within
the edit window.
method raiseEvent(type)
[ Language = javascript ]
Raise a named event for Studio to catch.
method raiseOpenDocument(doc)
[ Language = javascript ]
Raise an OPENDOC event to Studio.
doc is the full name (with extension) of the
document for Studio to open.
method raiseSelect(proplist)
[ Language = javascript ]
Raise a SELECT event to Studio.
This will update the Studio Inspector.
proplist is a list of property values for inspector to show.
The first property in the list is the Name of selected item.
proplist is an array of objects of the form:
proplist[n] = obj;
obj.name = 'name of property'
obj.type = 'type' (STRING,INTEGER, etc.)
obj.value = value
method setModified()
[ Language = javascript ]
Set the modified flag for this editor.
method setResultsDiv(data)
[ Language = javascript ]
Set contents of results div used to pass data to Studio.
method setZoom(zoom)
[ Language = javascript ]
Set the zoom level of the editor.