<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
An AuthorListener is intended to receive notifications about the
changes in the author node model. Do you want an event when the
entire application is launched or an event every time a document
is open in an editor in a running Oxygen Author application? Both
could be achieved very easily using plugin level API: [1][2]. You
could create a plugin for Oxygen standalone and use the Eclipse
specific plugin support to write a small plugin that gets these
values from the user in an Eclipse environment. This plugin could
save these variables using [3][4] so that the framework code could
have access to them.<br>
<br>
If you want to do it from the framework alone then you could just
present this dialog on
ro.sync.ecss.extensions.api.AuthorExtensionStateListener.activated(AuthorAccess).
You might want to invoke this code on a
javax.swing.SwingUtilities.invokeLater(Runnable) if the editor
should be initialized before asking the user for those values. If
the user must be asked once the you could use Oxygen built-in
options storage support to store these values and the fact that
you already asked the user for them [5][6].<br>
<br>
[1]
ro.sync.exml.plugin.workspace.WorkspaceAccessPluginExtension.applicationStarted(StandalonePluginWorkspace)<br>
[2]
ro.sync.exml.workspace.api.PluginWorkspace.addEditorChangeListener(WSEditorChangeListener,
int)<br>
[3]
ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace()<br>
[4]
ro.sync.exml.workspace.api.PluginWorkspace.setGlobalObjectProperty(String,
Object)<br>
[5] ro.sync.ecss.extensions.api.AuthorAccess.getOptionsStorage()<br>
[6] ro.sync.ecss.extensions.api.OptionsStorage.setOption(String,
String)<br>
<pre class="moz-signature" cols="72">Best regards,
Alex
--
Alex Jitianu
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com">http://www.oxygenxml.com</a> </pre>
On 22-Jan-14 5:53 AM, Nathan wrote:<br>
</div>
<blockquote
cite="mid:CAAA7NDhN9mcFk3Y-pqXioB1_XGHPnckoSt20=0E3xREuE+UtOg@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi,</div>
<div> I am using Oxygen 15's inbuilt DITA framework and I would
like to customize it by showing a Swing based form when Oxygen
Author has been opened. This form will be used to set custom
variables which can then be used later on. </div>
<div> I am planning to do this using the Author API,
specifically the AuthorExtensionStateListener interface (I saw
a sample at "<a moz-do-not-send="true"
href="http://www.oxygenxml.com/doc/ug-author/index.html#topics/dg-author-extension-state-listener.html">http://www.oxygenxml.com/doc/ug-author/index.html#topics/dg-author-extension-state-listener.html</a>"
in this regard). I presume the next step would be to register
an implementation of AuthorListener (or extend the
"AuthorListenerAdapter" class) within the activate method of
the implementation of AuthorExtensionStateListener interface. </div>
<div> My questions are as follows:</div>
<div> <span class="" style="white-space:pre"> </span>a) Is
this the best way to implement what I have in mind?</div>
<div> <span class="" style="white-space:pre"> </span>b) There
does not seem to be any Author window event which can be used
to popup the form. I see others for doctypeChanged(),
documentChanged etc here but nothing to record a
opening-of-author event.</div>
<div>I feel like I am missing something here and would greatly
appreciate some help. If there is a better way to do this, I
am all ears. Just a note, I cannot use plugins since this has
to work for people who use Oxygen Author standalone and those
who use the Author plugin within eclipse.</div>
<div><br>
</div>
<div>My current code structure something like this...</div>
<div><br>
</div>
<div>File 1: </div>
<div><br>
</div>
<div>public class ditaAuthorExtensionStateListener implements
AuthorExtensionStateListener{</div>
<div>
....</div>
<div>....</div>
<div><br>
</div>
<div>public void activated(...){</div>
<div><span class="" style="white-space:pre"> </span>// Add
author document listeners.</div>
<div><span class="" style="white-space:pre"> </span>ditaAuthorDocumentListener
= new DitaAuthorListener();</div>
<div><span class="" style="white-space:pre"> </span>authorAccess.getDocumentController().addAuthorListener(ditaAuthorDocumentListener);</div>
<div><span class="" style="white-space:pre"> </span></div>
<div>}</div>
<div><span class="" style="white-space:pre"> </span></div>
<div>File 2: </div>
<div>public class DitaAuthorListener implements AuthorListener{</div>
<div><br>
</div>
<div>.....</div>
<div>.....</div>
<div>// I am stuck here since I do not find any method which is
triggered on opening Oxygen Author.</div>
<div><br>
</div>
<div>Thanks a bunch!</div>
<div>Nathan</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
oXygen-sdk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:oXygen-sdk@oxygenxml.com">oXygen-sdk@oxygenxml.com</a>
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk">http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk</a>
</pre>
</blockquote>
<br>
</body>
</html>