Override the "accept" action in Manage Reviews panel

Post here questions and problems related to oXygen frameworks/document types.
Isabelle
Posts: 60
Joined: Fri Jan 20, 2017 1:11 pm

Override the "accept" action in Manage Reviews panel

Post by Isabelle » Wed Mar 29, 2017 7:31 pm

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

alex_jitianu
Posts: 705
Joined: Wed Nov 16, 2005 11:11 am

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

Post by alex_jitianu » Thu Mar 30, 2017 2:53 pm

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

Isabelle
Posts: 60
Joined: Fri Jan 20, 2017 1:11 pm

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

Post by Isabelle » Fri Mar 31, 2017 6:56 pm

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

alex_jitianu
Posts: 705
Joined: Wed Nov 16, 2005 11:11 am

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

Post by alex_jitianu » Mon Apr 03, 2017 10:42 am

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

Isabelle
Posts: 60
Joined: Fri Jan 20, 2017 1:11 pm

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

Post by Isabelle » Mon Apr 03, 2017 10:47 am

Hello,

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

Regards,
Isabelle

Post Reply