Best Practice to check readOnly elements
Posted: Wed Oct 15, 2014 4:34 pm
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