directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-Arnaud Marcelot ...@marcelot.net>
Subject Re: [Studio] Adding extensibility to Entry Editor
Date Wed, 12 Aug 2009 16:12:09 GMT
Hi again,
Actually there's no need to get the properties of the General Preference
Page of Eclipse and to initialize the OpenStrategy object with an open
method.

All this is done by the Workbench plugin.

The only thing we need to do is to add an IOpenEventListener:

        OpenStrategy handler = new OpenStrategy(
view.getMainWidget().getViewer().getTree() );

        handler.addOpenListener( new IOpenEventListener()

        {

            public void handleOpen( SelectionEvent e )

            {

                System.out.println( "handleOpen() " + e );

            }

        } );

I tested it and it works fine. :)
Regards,
Pierre-Arnaud

On Wed, Aug 12, 2009 at 5:19 PM, Pierre-Arnaud Marcelot <pa@marcelot.net>wrote:

> Stefan S.,
> FYI, here's how to access the properties of the General Preference page of
> Eclipse for "Open mode":
>
>    - OPEN_ON_SINGLE_CLICK  --
>     WorkbenchPlugin.getDefault().getPreferenceStore().getBoolean(
>    IPreferenceConstants.OPEN_ON_SINGLE_CLICK );
>    - SELECT_ON_HOVER  --
>     WorkbenchPlugin.getDefault().getPreferenceStore().getBoolean(
>    IPreferenceConstants.SELECT_ON_HOVER );
>    - OPEN_AFTER_DELAY ("Open when using arrow keys" in the preference
>    page)  --  WorkbenchPlugin.getDefault().getPreferenceStore().getBoolean(
>    IPreferenceConstants.OPEN_AFTER_DELAY );
>
> Eclipse is using the "OpenStrategy.setOpenMethod(singleClickMethod);"
> instruction to set the open mode globally.
>
> And uses this code to determine if an object should be opened:
>
> OpenStrategy handler = new OpenStrategy(control);
>
> handler.addOpenListener(new IOpenEventListener() {
>
> public void handleOpen(SelectionEvent e) {
>
> ... // code to handle the open event.
>
> }
>
> });
>
> Regards,
> Pierre-Arnaud
>
>
> On Wed, Aug 12, 2009 at 2:30 PM, Pierre-Arnaud Marcelot <pa@marcelot.net>wrote:
>
>> Hi all,
>> Yesterday Stefan created the extension point and I created a preference
>> page where the user will be able to reorder the editors.
>>
>> When it is defined in the plugin.xml file of a plugin, each Entry Editor
>> is assigned a priority.
>> This priority is an integer based property.
>> All Entry Editors are sorted by priority.
>>
>> When a new editor needs to be opened, we're going to get an ordered list
>> of these Entry Editors and iterate on this list
>> until we find an editor that can handle ('boolean canHandle(...)' method)
>> the given entry.
>>
>> Stefan and I would like to allow the user to reorder the editors via the
>> preference page.
>>
>> As soon as the user reorders the editors, the original priority value is
>> discarded and the user's order is saved in the plugin's preferences.
>>
>> Now, I have a question.
>>
>> Let's say the user has re-organized the Entry Editors and he adds a new
>> plugin that has a new entry editor.
>> At the next launch of Apache Directory Studio, we'll notice that a new
>> Entry Editor is available, but what should we do with it ? Where should we
>> place it in the Entry Editors order ?
>>
>> I think we should discard the priority information since the user has
>> defined his own order and that this new editor should be placed at the end
>> of the list.
>>
>> Thoughts ?
>>
>> Thanks,
>> Pierre-Arnaud
>>
>> On Mon, Aug 10, 2009 at 6:00 PM, Pierre-Arnaud Marcelot <pa@marcelot.net>wrote:
>>
>>> Hi all,
>>> We've had an interesting discussing on IRC with Stefan S. about adding
>>> extensibility to the Entry Editor.
>>>
>>> We'd like to introduce a new mechanism to allow the addition of new
>>> editors.
>>> This will allow us to have for example a single-window editor and a
>>> multi-window editor for entries.
>>>
>>> To do so, we'll introduce a new custom extension point with the following
>>> properties:
>>>
>>>    - the class name of the editor
>>>    - a name
>>>    - if it is single-window or multi-window
>>>    - a priority
>>>    - an image
>>>    - a description
>>>
>>> The class of the editor should implement our Editor's interface which
>>> defines only one method:
>>>
>>>    - boolean canHandle(IEntry entry) /** This method indicates if the
>>>    editor can handle the given entry. */
>>>
>>> This feature should be part of the 1.5 release of Studio
>>>
>>> Regards
>>> Pierre-Arnaud
>>>
>>
>>
>

Mime
View raw message