Page 1 of 1

Extensions Actions disarmed in Oxygen Component

Posted: Tue Apr 02, 2013 7:06 pm
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.

Re: Extensions Actions disarmed in Oxygen Component

Posted: Wed Apr 03, 2013 10:48 am
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

Re: Extensions Actions disarmed in Oxygen Component

Posted: Wed Apr 03, 2013 11:32 am
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.

Re: Extensions Actions disarmed in Oxygen Component

Posted: Wed Apr 03, 2013 12:22 pm
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

Re: Extensions Actions disarmed in Oxygen Component

Posted: Wed Apr 03, 2013 12:41 pm
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.