Page 1 of 1

"Dynamic" toolbar

Posted: Mon Jan 30, 2012 5:58 pm
by Vincent
Hello,

Is there any way (with the SDK), to make the author toolbar "dynamic" ?

Actually, I want my toolbar to be different depending the context of the caret in the XML Tree.

I have a list of action I want to propose to my users only when he can use it...

That would be awesome in term of customization !

Vincent

Re: "Dynamic" toolbar

Posted: Tue Jan 31, 2012 10:30 am
by Radu
Hi Vincent,

No, the Author toolbar cannot be made dynamic using the Author SDK, the mounted Author operations are fixed.

But using our Plugins API:

http://www.oxygenxml.com/oxygen_sdk.htm ... er_Plugins

you could implement a Workspace Access plugin type.

Such a plugin allows you to add a toolbar components customizer:

Code: Select all

ro.sync.exml.workspace.api.standalone.StandalonePluginWorkspace.addToolbarComponentsCustomizer(ToolbarComponentsCustomizer)
Then on the Author toolbar you could try to mount a JPanel in which dynamically you would change the actions based on the caret position.

Using a Workspace Access plugin you can also add your custom toolbar (or view) to Oxygen.

The sample Java class included in the Plugins SDK

Code: Select all

ro.sync.sample.plugin.workspace.CustomWorkspaceAccessPluginExtension
contains some sample code about this.

Regards,
Radu

Re: "Dynamic" toolbar

Posted: Tue Jan 31, 2012 12:07 pm
by Vincent
Thank you Radu,

I will take a look on it and I think I'll be quickly back with further questions !


Vincent.

Re: "Dynamic" toolbar

Posted: Wed Feb 29, 2012 11:59 am
by SSC
Hello,

is there something similar to the ro.sync.exml.workspace.api.standalone.StandalonePluginWorkspace.addToolbarComponentsCustomizer(ToolbarComponentsCustomizer) method for the eclipse plugin of oxygen?
In former discussions you already told me that the internal toolbar of an Oxygen editor cannot be modified in the eclipse version.
At that time my aim was to remove items from the internal toolbar.
Now I´d like to know, if the internal toolbar can be appeded by custom items.
I ask this because we currently do not use the main Coolbar of Eclipse in order to save free space on the screen, so that I would for instance like to include the save action in the internal toolbar of the Editor.

Regards,

Simon

Re: "Dynamic" toolbar

Posted: Wed Feb 29, 2012 2:05 pm
by Radu
Hi Simon,

Sorry but we currently do not have such API.
We'll see if we can add such API and update the forum entry when I have more details.

Regards,
Radu

Re: "Dynamic" toolbar

Posted: Fri Oct 19, 2012 2:40 pm
by Radu
Hi,

Oxygen 14.1 was released and it contains this Eclipse extension API:
com.oxygenxml.editor.editors.ActionBarContributorCustomizer

Regards,
Radu

Re: "Dynamic" toolbar

Posted: Thu Dec 06, 2012 6:16 pm
by Vincent
Radu wrote:Hi,

Oxygen 14.1 was released and it contains this Eclipse extension API:
com.oxygenxml.editor.editors.ActionBarContributorCustomizer

Regards,
Radu

Hi,

Do you have documentation for this extension ?
The javadoc link doesn't seem to work :
http://www.oxygenxml.com/InstData/Edito ... mizer.html


Thank you,
Vincent.

Re: "Dynamic" toolbar

Posted: Thu Dec 06, 2012 6:21 pm
by Radu
Hi Vincent,

This customizer interface is for the Oxygen plugin for Eclipse.
Basically if you had another Eclipse plugin, in its plugin.xml you would have some code like:

Code: Select all

<extension point="com.oxygenxml.editor.actionBarContributorCustomizer">
<implementation class="my.package.CustomActionBarContributorCustomizer"/>;
</extension>
The code for the customizer is this one:

Code: Select all

public abstract class ActionBarContributorCustomizer {

/**
* Customize the actions before they are contributed to the main Document menu (XML or XSL, or XSD, etc).
*
* @param actions The list of original actions.
* @return The list of modified actions.
*/
public abstract List<IAction> customizeActionsContributedToDocumentMenu(List<IAction> actions);

/**
* Customize the actions before they are contributed to the main Document toolbar.
*
* @param actions The list of original actions.
* @return The list of modified actions.
*/
public abstract List<IAction> customizeActionsContributedToDocumentToolbar(List<IAction> actions);

/**
* Customize an internal coolbar for a cetain author page. This callback may be received more than once for the
* same document so please make sure that you do not add the same action twice.
*
* @param coolbar The internal coolbar after the fixed actions have been added.
* @param authorEditorPage The current author editor page.
*/
public abstract void customizeAuthorPageInternalCoolbar(CoolBar coolbar, WSAuthorEditorPage authorEditorPage);
}
I'll see if we can also fix the Javadoc link on the website.

Regards,
Radu