Best Practice to check readOnly elements
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 47
- Joined: Thu Jun 19, 2014 3:55 pm
Best Practice to check readOnly elements
Hi
we are using the Eclipse Oxygen Author in Version 15.2
I want to drag an element. If I move the cursor over an readOnly element, there will be no DND.DROP_NONE symbol. So I implemented this:
Is there a better way to figure out, if the element is read-only?
Best regards,
Denis
we are using the Eclipse Oxygen Author in Version 15.2
I want to drag an element. If I move the cursor over an readOnly element, there will be no DND.DROP_NONE symbol. So I implemented this:
Code: Select all
AuthorViewToModelInfo authorViewToModelInfo = getAuthorViewToModelInfo(event);
AuthorNode node = authorViewToModelInfo.getAuthorNode();
boolean editable = authorAccess.getDocumentController()
.isEditable(node);
if (!editable) {
event.detail = DND.DROP_NONE;
}
Best regards,
Denis
Denis Zygann
KGU Consulting GmbH
http://www.kgu-consulting.com
KGU Consulting GmbH
http://www.kgu-consulting.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Best Practice to check readOnly elements
Hi Denis,
From where exactly do you drag that element? From a custom view? Did you already have a custom drop handler for it?
Basically the isEditable API method checks that:
Is it insufficient for your needs?
Regards,
Radu
From where exactly do you drag that element? From a custom view? Did you already have a custom drop handler for it?
Basically the isEditable API method checks that:
The API also convers content references or xi:included sections (basically content which comes from another XML file).* Test if a node is editable or not. A node is not editable for one of the following cases:
* <ul>
* <li>the CSS property 'editable' is to 'false';</li>
* <li>the node is entirely included into a DELETED change marker.</li>
* <ul>
Is it insufficient for your needs?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service