How do I add a right-click menu or toolbar buttons to a diff viewer

Hi,

I am trying to add either a popup menu, or a bunch of toolbar buttons to a diff viewer. Unfortunately, nothing works.

I am invoking a diff viewer like so:


DiffManager.getInstance().getDiffTool().show(request);

I have found the DiffToolbar interface and its implementation, DiffToolbarImpl, but adding them to the diff request does not seem to do anything.I am trying these approaches:

        DiffToolbar tb = new DiffToolbarImpl();
        tb.addSeparator();
        tb.addAction(ActionManager.getInstance().getAction("ThePlugin.Crucible.Add.Comment.In.Editor"));
        tb.addAction(ActionManager.getInstance().getAction("ThePlugin.Crucible.Comment.PrevDiff"));
        tb.addSeparator();
        request.customizeToolbar(tb);
        DiffManager.getInstance().getDiffTool().show(request);


and

        DiffRequest.ToolbarAddons addons = DiffRequest.ToolbarAddons.NOTHING;
        DiffToolbar tb = new DiffToolbarImpl();
        tb.addSeparator();
        tb.addSeparator();
        tb.addAction(ActionManager.getInstance().getAction("ThePlugin.Crucible.Add.Comment.In.Editor"));
        tb.addAction(ActionManager.getInstance().getAction("ThePlugin.Crucible.Comment.PrevDiff"));
        tb.addSeparator();
        addons.customize(tb);

        request.setToolbarAddons(addons);
        DiffManager.getInstance().getDiffTool().show(request);


Javadocs state that this is "work in progress" and I should not rely on it. Is there ANY way to customize manus or toolbars of the diff viewer?

Cheers
Janusz Gorycki

0

Please sign in to leave a comment.