Page 1 of 1

Override the "accept" action in Manage Reviews panel

Posted: Wed Mar 29, 2017 7:31 pm
by Isabelle
Hello,

We use oxygen-18.1.0.0.jar, and we need to execute a specific action each time users accept a review in our application.
In fact, this action will update a "table of modification" in the document.

I success to override "Edit/Accept_Change" in the Review toolbar but we also need to override the "accept" action in the Manage Reviews panel.
I don't find how to do that.

Can you explain me how can I improve this "accept" action, please ?
Thanks.

Regards,
Isabelle

Re: Override the "accept" action in Manage Reviews panel

Posted: Thu Mar 30, 2017 2:53 pm
by alex_jitianu
Hello,

You can customize the actions in the Review panel using an ReviewActionsProvider. You can set one line this:

Code: Select all

		if (EditorPageConstants.PAGE_AUTHOR.equals(editorComponent.getWSEditorAccess().getCurrentPageID())) {
WSAuthorComponentEditorPage page = (WSAuthorComponentEditorPage) editorComponent.getWSEditorAccess().getCurrentPage();
AuthorReviewController reviewController = page.getAuthorAccess().getReviewController();
AuthorReviewViewController authorReviewViewController = reviewController.getAuthorReviewViewController();

authorReviewViewController.addReviewActionsProvider(new ReviewActionsProvider() {
@Override
public void customizeContextualMenuActions(
AuthorAccess authorAccess,
AuthorPersistentHighlight[] selectedHighlights,
Object popupMenu) {

}

@Override
public void customizeHoverActions(AuthorAccess authorAccess,
AuthorPersistentHighlight authorPersistentHighlight,
List actions) {
}
});
}
Best regards,
Alex

Re: Override the "accept" action in Manage Reviews panel

Posted: Fri Mar 31, 2017 6:56 pm
by Isabelle
Hello Alex,

Thanks for your answer but I don't understand how it could solve my issue.
The 2 methods you provide only allow to customize the contextual menu actions and the hover actions.
But I need to customize the "accept" action in the Review Panel.
Image

Is it possible ?

Regards,
Isabelle

Re: Override the "accept" action in Manage Reviews panel

Posted: Mon Apr 03, 2017 10:42 am
by alex_jitianu
Hello Isabelle,

The "Accept" action appears only when you hover an entry in the Review panel. This means that you can intercept it on the customizeHoverActions() callback:

Code: Select all


				public void customizeHoverActions(AuthorAccess authorAccess,
AuthorPersistentHighlight authorPersistentHighlight,
List actions) {
if (actions != null) {
for (Iterator iterator = actions.iterator(); iterator.hasNext();) {
javax.swing.Action action = (javax.swing.Action) iterator.next();
String oxygenActionID = ((StandalonePluginWorkspace) PluginWorkspaceProvider.getPluginWorkspace()).getOxygenActionID(action);

if ("Review/Accept".equals(oxygenActionID)) {
// TODO This is the accept action. You can replace it with another one.
}
}
}
}
Best regards,
Alex

customizeHoverActions

Re: Override the "accept" action in Manage Reviews panel

Posted: Mon Apr 03, 2017 10:47 am
by Isabelle
Hello,

Thank you Alex.
I didn't realize it was an "hover" method type.
I will try this.

Regards,
Isabelle