beforeAttributeChange and attributeChanged in the AuthorListener
Oxygen general issues.
-
- Posts: 206
- Joined: Thu Dec 01, 2011 4:22 pm
- Location: Hamburg, Germany
beforeAttributeChange and attributeChanged in the AuthorListener
Hello,
there are several ways to change attributes of a certain tag element.
Internally I guess they are all changed by the
Is the AuthorListener with its attributeChanged event the correct listener for the setAttribute method of the AuthorDocumentController?
When exactly are the beforeAttributeChange and attributeChanged methods are invoked?
Thanks in advance
Simon
there are several ways to change attributes of a certain tag element.
Internally I guess they are all changed by the
Code: Select all
documentController.setAttribute(attrName, new AttrValue(attrValue), authorElement);
When exactly are the beforeAttributeChange and attributeChanged methods are invoked?
Thanks in advance
Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
vogella GmbH
http://www.vogella.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: beforeAttributeChange and attributeChanged in the AuthorListener
Hi Simon,
So you are referring to this listener class:
ro.sync.ecss.dom.AuthorDocumentListenerExt
It should receive events before and after an attribute was added/removed/changed either through the Attributes Table (or in-place Attributes viewer) provided by Oxygen or when some API call to the document controller is made either by the Oxygen code or by a developer's extension.
What exactly are you trying to accomplish?
If you want to alter the value which is set I would suggest the document filter approach:
ro.sync.ecss.extensions.api.AuthorDocumentFilter.setAttribute(AuthorDocumentFilterBypass, String, AttrValue, AuthorElement)
Regards,
Radu
So you are referring to this listener class:
ro.sync.ecss.dom.AuthorDocumentListenerExt
It should receive events before and after an attribute was added/removed/changed either through the Attributes Table (or in-place Attributes viewer) provided by Oxygen or when some API call to the document controller is made either by the Oxygen code or by a developer's extension.
What exactly are you trying to accomplish?
If you want to alter the value which is set I would suggest the document filter approach:
ro.sync.ecss.extensions.api.AuthorDocumentFilter.setAttribute(AuthorDocumentFilterBypass, String, AttrValue, AuthorElement)
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 206
- Joined: Thu Dec 01, 2011 4:22 pm
- Location: Hamburg, Germany
Re: beforeAttributeChange and attributeChanged in the AuthorListener
I was not referring to the ro.sync.ecss.dom.AuthorDocumentListenerExt, but to the ro.sync.ecss.extensions.api.AuthorListener.
I am not able to find the ro.sync.ecss.dom.AuthorDocumentListenerExt class. Maybe it is obfuscated.
How do I get the ro.sync.ecss.extensions.api.AuthorDocumentFilter, you mentioned?
For the usual AuthorDocumentController I use the following method :
Regards,
Simon
I am not able to find the ro.sync.ecss.dom.AuthorDocumentListenerExt class. Maybe it is obfuscated.
How do I get the ro.sync.ecss.extensions.api.AuthorDocumentFilter, you mentioned?
For the usual AuthorDocumentController I use the following method :
Code: Select all
private AuthorDocumentController getDocumentController() {
IEditorPart activeEditor = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (activeEditor instanceof WSEditor) {
WSEditorPage currentPage = ((WSEditor) activeEditor)
.getCurrentPage();
if (currentPage instanceof WSAuthorEditorPage) {
return ((WSAuthorEditorPage) currentPage)
.getDocumentController();
}
}
return null;
}
Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
vogella GmbH
http://www.vogella.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: beforeAttributeChange and attributeChanged in the AuthorListener
Hi Simon,
You are right, I meant this listener:
ro.sync.ecss.extensions.api.AuthorListener
Once you gain access to the AuthorDocumentController you can do the following:
Regards,
Radu
You are right, I meant this listener:
ro.sync.ecss.extensions.api.AuthorListener
Once you gain access to the AuthorDocumentController you can do the following:
Code: Select all
documentController.setDocumentFilter(new AuthorDocumentFilter() {
/**
* @see ro.sync.ecss.extensions.api.AuthorDocumentFilter#setAttribute(ro.sync.ecss.extensions.api.AuthorDocumentFilterBypass, java.lang.String, ro.sync.ecss.extensions.api.node.AttrValue, ro.sync.ecss.extensions.api.node.AuthorElement)
*/
@Override
public void setAttribute(AuthorDocumentFilterBypass filterBypass, String attributeName,
AttrValue value, AuthorElement element) {
//Here you can modify the attribute name and/or value before delegating to super.
//TODO your code here
// Delegate to super to perform the default operation on the attribute value and name.
super.setAttribute(filterBypass, attributeName, value, element);
}
});
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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