Getting AuthorComponentProvider from AuthorOperations in Applet

Oxygen general issues.
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Getting AuthorComponentProvider from AuthorOperations in Applet

Post by neon096 »

Is there a way to get the AuthorComponentProvider from with the AuthorOpertations?

Currently the only way I've got them is by using a singleton on the JPanel for the applet. However this means I cannot create any unit tests on my operation classes. Current the print operation is doing the following.

Code: Select all


public void doOperation(final AuthorAccess access, final ArgumentsMap arg1) throws IllegalArgumentException,
AuthorOperationException {
AuthoringPanel.getInstance().print(true);
}
The AuthoringPanel does the call to the AuthorComponentProvider

Code: Select all


public void print(final boolean printPreview) {
authorComponent.print(printPreview);
}
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

Re: Getting AuthorComponentProvider from AuthorOperations in Applet

Post by Radu »

Hi Neil,

The AuthorOperations only work with AuthorAccess.
And AuthorAccess does not (yet) have API to call print.

Maybe a workaround would be to avoid creating the "Print" action as an "AuthorOperation" (in the associated framework).
In the applet you could add a custom toolbar button with a print action which has access to the AuthorComponentProvider.

If you add the "Print" action as an author operation it will also be available in the toolbar for the Oxygen standalone version. But in the Oxygen standalone version you already have the "File->Print" menu.
Or do you want to make the Print action also available on the toolbar in the standalone Oxygen version?
In this case, maybe we could add some API to print() in the AuthorEditorAccess.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Re: Getting AuthorComponentProvider from AuthorOperations in Applet

Post by neon096 »

I also want the PrintOperation in the right click popup menu.
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Re: Getting AuthorComponentProvider from AuthorOperations in Applet

Post by neon096 »

Also it's not just for printing. I'd like to do other things as well.
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

Re: Getting AuthorComponentProvider from AuthorOperations in Applet

Post by Radu »

Hi,
I also want the PrintOperation in the right click popup menu.
Besides adding an author operation to the pop-up menu by editing the associated document type you can also use this API to customize the JPopupMenu before showing (API available also from the Author Component Provider side):

Code: Select all

ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.setPopUpMenuCustomizer(AuthorPopupMenuCustomizer)
Also it's not just for printing. I'd like to do other things as well.
We cannot make available the AuthorComponentProvider to the AuthorOperations because an AuthorOperation should work both for the standalone Oxygen and for the applet unchanged and in the standalone version the AuthorComponentProvider API does not exist.

But we can try to increase the AuthorAccess API if you have some requests.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply