Page 1 of 1
Add some action in Oxygen Xml Editor
Posted: Mon Oct 26, 2009 5:31 pm
by woody212
Hello,
I have a question, i need some help. I use Oxygen Xml Editor, like a plugin in a Eclipse Rich Client Application (RCP), to edit xml document.
And I want to add some action, to edit the content of the xml file, open in the oxygen xml editor.
Can you please tell me the way to add action (eg: add a bullist in the xml document)?
Because, in my RCP application, I just arrive to open the editor, and load on it a xml file. But I don’t know how to add event to edit and modify it.
Thanks you
Re: Add some action in Oxygen Xml Editor
Posted: Mon Oct 26, 2009 6:09 pm
by sorin_ristache
Hello,
There is an Author API that is documented in
the Author SDK from
Developer page for adding custom actions for editing a document in Author mode. You implement your custom actions in Java and you set the jar file containing the Java classes in an Author document framework in your Oxygen preferences as
documented in the User Manual.
Regards,
Sorin
Re: Add some action in Oxygen Xml Editor
Posted: Tue Oct 27, 2009 11:52 am
by woody212
Hello sorin,
Thanks for your answer. Like you said, i downloaded the author sdk. It contains some informations about customisation (configuring actions, Menu and Toolbar) on Oxygen xml Editor but, me, i use oxygen in a RCP Application, like a plugin eclipse...So do you know how i can deploy theses customisation on Oxygen xml Editor plugin eclipse version? because in my project , i don't use for exemple a "framework/sdf" directory.
regards.
Re: Add some action in Oxygen Xml Editor
Posted: Tue Oct 27, 2009 12:15 pm
by sorin_ristache
The Author API is implemented by Author editor in both
Oxygen standalone and
Eclipse plugin. The Java custom extension actions are the same and the user interface for registering your extensions looks the same. The difference is that
in the Eclipse Preferences dialog you see Eclipse controls instead of Java Swing controls.
Regards,
Sorin
Re: Add some action in Oxygen Xml Editor
Posted: Wed Oct 28, 2009 12:02 pm
by woody212
Hello sorin,
i first begin to add a simple action (insert Image) to the oxygen xml Editor 10.3 (StandAlone version), i follow the tutorial p 34 in the Oxygen Develloper Guide, but finally i can't test this action, because the button of this action, doesn't appear in the toolbar of Oxygen, however i follow all the instruction (adding a icone etc...)
Can you help me about this situation please?
Regards,
Re: Add some action in Oxygen Xml Editor
Posted: Wed Oct 28, 2009 3:18 pm
by sorin_ristache
Is your custom action listed on the
Author tab of
the dialog for editing the document type when you click on
2. Actions? If not the action was not detected from the parameters that you set on
the action configuration dialog. In this case you have to make sure you set the action parameters correctly. If yes it should also appear in the list of actions that are available for toolbars when you click on
5. Toolbar on the same
Author tab and you just have to use one of the buttons
Add as child or
Add as sibling for adding the action to a toolbar.
Regards,
Sorin
Re: Add some action in Oxygen Xml Editor
Posted: Wed Oct 28, 2009 4:18 pm
by woody212
Hello sorin,
Thanks for your answer. Yes, i have follow your instruction.When i click On 2.actions, my action appear in the list of actions, and yes , when i click on 5. Toolbar on the same Author tab, i have add my action to the toolbar in clicking on add as child button. After that, i click on apply, but the action still not appear on the toolbar...
Do i must close and open again the oxygen Xml Editor to actualise the toolbar? or are they anything else, i must do?
Regards,
Re: Add some action in Oxygen Xml Editor
Posted: Wed Oct 28, 2009 4:24 pm
by sorin_ristache
Did you set an icon for your action? If yes the icon should appear on the toolbar called Author custom actions when you edit in Author mode an XML document that matches the document type with the action.
If you want to use the action for the current edited file you have to reopen that file in Oxygen after adding the action to the toolbar in Preferences so that the preferences changes can be applied.
Regards,
Sorin
Re: Add some action in Oxygen Xml Editor
Posted: Sun Nov 01, 2009 4:19 pm
by woody212
Hello sorin,
I succesfully add some customise actions on the toolbar of éditor oxygen plugin Eclipse version.
So, now i want to do the same, in my eclipse RCP application: In my eclipse RCP application, i put the plugin version of oxygen xml editor, and when i open the oxygen perspective i use this fragment of code to open oxygen in a view of my application:
URLEditorInput input= new URLEditorInput(getClass().getClassLoader().getResource("/resources/ir/pharmaciens.xml"));
page.openEditor(input, OxygenEditor.EDITOR_ID);
page.showView(OxygenAttributesView.VIEW_ID);
page.showView(OxygenElementsView.VIEW_ID);
But is that with only the OxygenEditor view,OxygenAttributesView and OxygenElementsView, i can't add some action like you say on the develloper guide, because for exemple don't have the option menu of oxygen in my eclipse rcp application menu.
So, can you give me please a way to add some text author specific action? which class of the oxygenxml.jar must i overwrite or extends?
Thanks for your answer
Regards.
Re: Add some action in Oxygen Xml Editor
Posted: Mon Nov 02, 2009 11:16 am
by sorin_ristache
That depends on the set of core Eclipse plugins that you included in your Rich Client Application. You should have no problems installing the Oxygen plugin and customizing Author mode with custom Author actions that you add to a document type as
described in the User Manual if the following
necessary conditions are true:
- you can open an XML document in Author mode where the XML document is rendered using the CSS stylesheet associated with that document,
- the Eclipse preferences panel is available (menu Window -> Preferences in the Eclipse Classic platform) where the Oxygen plugin can add the Oxygen preferences and where you can configure your custom actions.
You don't extend or override any class from oxygenxml.jar. Your custom Author action must implement the interface
AuthorOperation and can use any class and method that is available in the Author API. You can find examples and the javadoc documentation in the
Author SDK on the
Developer page.
Regards,
Sorin
Re: Add some action in Oxygen Xml Editor
Posted: Mon Nov 02, 2009 12:21 pm
by woody212
Hello sorin,
I agree with you, preferences work done under the Eclipse environment (which contains the plugin oxygen).
However, when I compile and execute my application from this last, I open oxygen XML Editor(page.openView(OxygenEditorView.ID)), and when it is opened, mofications I realized that since the eclipse platform for adding customise actions of the editor does not work in my build application.
Basically, how is it possible to deploy preference done in Eclipse RCP platform, on my compiled and running application? because in my compiled and running application , I don't have any eclipse buttons menu (the menus File, Edit, Souurce ..., Window, Help) to customise it...
Thanks for your answer
Regards
Re: Add some action in Oxygen Xml Editor
Posted: Mon Nov 02, 2009 12:56 pm
by sorin_ristache
You have to include in your RCP application the OSGi plugins (org.eclipse.osgi, org.eclipse.osgi.services).
Regards,
Sorin