Do a contextual InputURLChooser actions list

Post here questions and problems related to oXygen frameworks/document types.
sebastienlavandier
Posts: 124

Do a contextual InputURLChooser actions list

Tue Mar 08, 2016 3:03 pm

Hi,
I develop a CMS Oxygen Plugin to work with Dita documents.

I added some actions in existing browse actions list.

Code: Select all

public class CustomInputURLChooser implements InputURLChooserCustomizer {

    @Override
    public void customizeBrowseActions(List<Action> existingBrowseActions, InputURLChooser chooser) {
        // Add the browse CMS functions action on the first position.
        final BrowseFunctionAction browseFunctionAction = new BrowseFunctionAction(chooser);
        existingBrowseActions.add(0, browseFunctionAction);

        // Add the browse CMS guides action on the second position.
        final BrowseGuideAction browseGuideAction = new BrowseGuideAction(chooser);
        existingBrowseActions.add(1, browseGuideAction);

        // Add the browse CMS images action on the third position.
        final BrowseImageAction browseImageAction = new BrowseImageAction(chooser);
        existingBrowseActions.add(2, browseImageAction);
    }
}


But in some case, I don't want to show all action list.
For example, on Dita maps manager open action, I just want to show one of them (browseGuideAction).
Or, when I when to add a topic reference, I just want to show an other (browseFunctionAction).

This list is used everywhere in browse action, but I hope I can customize it.

How I can do that ?
Thanks in advance for your help

Sébastien.L
Radu
Posts: 5749

Re: Do a contextual InputURLChooser actions list

Tue Mar 08, 2016 3:34 pm

Hi Sébastien,

The InputURLChooser object you receive has a method getContextDescription() which should return some platform-indepentent description of the context in which you provide the action. You should try to do a system.err.println with this information in both contexts, see what it returns, maybe it's enough to differentiate between contexts.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sebastienlavandier
Posts: 124

Re: Do a contextual InputURLChooser actions list

Tue Mar 08, 2016 4:13 pm

Hi Radu,

Thank you for your answer.
But this mehod (getContextDescription()) is only set for "DITA_Maps_Manager/Open".
The others are null.
So, this solves only one of my problems...

Do you have an other idea ?

Thanks in advance for your help.

Sébastien.L
Radu
Posts: 5749

Re: Do a contextual InputURLChooser actions list

Tue Mar 08, 2016 4:20 pm

Hi Sébastien,

Could you tell me all the places, dialogs from which you want a non-null context to be returned on the "getContextDescription()" method?
I could try to possibly fix this in time for Oxygen 18.0 (in a couple of months).
I don't have another idea other than maybe trying to find the active visible window/dialog using Swing mechanisms and obtaining its title but this would be ugly.

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

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest