Extensions Actions disarmed in Oxygen Component

Oxygen general issues.
CheryBen
Posts: 24
Joined: Tue Jun 05, 2012 10:34 am

Extensions Actions disarmed in Oxygen Component

Post by CheryBen »

Hi, i'm stil using Oxygen Component to create a custom standalone application.

I'm trying to integrate Oxygen 14.2 but i have troubles with extensions actions, they are always disarmed (disabled).
I'm using the code provided in the javadoc to get the extension actions and i add them to a JToolBar.

Here is a piece of code :

Code: Select all

List<JToolBar> toolBarList = ((WSAuthorComponentEditorPage)oxygenComponent.getAuthorComponentProvider().getWSEditorAccess().getCurrentPage()).createExtensionActionsToolbars();
for(JToolBar jToolBar : toolBarList) {
for(int i=0; i<=jToolBar.getComponentCount(); i++) {
final Component component = jToolBar.getComponent(i);
add(component);
}
}
Another problem is : what happened if the current page is the Text Page, which is now available ? should i remove the actions from the toolbar?

I founded in this forum (http://www.oxygenxml.com/forum/post2359 ... led#p23597) that the actions would be contextual to the caret position, but this was not in the release note, i miss some documentation.
I hope that the solution that consist to implement a caret listener and test each xpath context of each action is not the right way.

Regards,
Benoît.
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Extensions Actions disarmed in Oxygen Component

Post by Radu »

Hi Benoît,
I'm trying to integrate Oxygen 14.2 but i have troubles with extensions actions, they are always disarmed (disabled).
I'm using the code provided in the javadoc to get the extension actions and i add them to a JToolBar.
....
If you look at the latest 14.2 Author Component Sample Project Java code for our sample ro.sync.ecss.samples.AuthorComponentSample class, the ro.sync.ecss.samples.AuthorComponentSample.reconfigureActionsToolbar() method is called from three places. Your code should do the same (it's important that the toolbar is completely re-configured when the "documentTypeChanged()" callback is called).
The extension actions should be automatically activated/de-activated from our side if their activation XPath expressions do not fulfill.
Another problem is : what happened if the current page is the Text Page, which is now available ? should i remove the actions from the toolbar?
You should look in the latest Java code for ro.sync.ecss.samples.AuthorComponentSample. It handles such pages switches by adding a listener.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
CheryBen
Posts: 24
Joined: Tue Jun 05, 2012 10:34 am

Re: Extensions Actions disarmed in Oxygen Component

Post by CheryBen »

Thanks Radu, i will look the new sample code.

I should compare the new projet to the older one to check the changes and improve my own code.

May be, it would be helpful if you could host the sample project on a public code repository. By this way, we could see the changes in the logs, without comparing the project versions.
What do you think about this?

Regards,
Benoît.
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Extensions Actions disarmed in Oxygen Component

Post by Radu »

Hi Benoît,

That's a very interesting idea. What repositories are you usually using? GIT, SVN?
I'll add this as an improvement request.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
CheryBen
Posts: 24
Joined: Tue Jun 05, 2012 10:34 am

Re: Extensions Actions disarmed in Oxygen Component

Post by CheryBen »

Actually we use GIT for all new projects and some old projects have been migrate from SVN to GIT.

Most of the open source projects that i know use GIT and host the sources on sourceforge or github.

This improvement would be awesome for all Oxygen integrators! :)

Regards,
Benoît.
Post Reply