77. setReadOnly
Prev | Chapter 6. Commands written in the Java™ programming language | Next

## 77. setReadOnly

Parameter syntax:

    [ '[view]'|'[document]'|'[implicitElement]'|'[implicitNode]' ]?
    [ 'false'|'true'|'remove'|'toggle' ]?

The default subject of this command is the explicitly selected node. The default operation is `toggle`.

If option `[view]` is specified, this command changes the flag that determines whether or not the current view of the current document is editable.

Parameter value:

false, remove

  Make the current view of the current document non-editable.

true

  Make the current view of the current document editable.

toggle

  Make the current view of the current document non-editable if it is editable and make it editable if it is non-editable.

Otherwise, this command changes the value of the `{http://www.xmlmind.com/xmleditor/namespace/property}readOnly` property of specified node.

Parameter value:

false

  Set the value of the `readOnly` property to `Boolean.FALSE`.

true

  Set the value of the `readOnly` property to `Boolean.TRUE`.

remove

  Removes property `readOnly` from specified node.

toggle

  Set the value of the `readOnly` property to the inverse of its current value. If specified node has no `readOnly` property, it is the value of the nearest ancestor having a `readOnly` property which is inversed.

Examples:

    setReadOnly [view]
    setReadOnly true
    setReadOnly [document]toggle
    setReadOnly [implicitElement] remove

Prev | Up | Next
76. setProperty | Home | 78. setObject