[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-devel
Subject:    Re: [ jEdit-devel ] Heads up: changes in ProjectViewer API
From:       Shlomy Reinstein <sreinst1 () gmail ! com>
Date:       2009-03-31 4:51:29
Message-ID: fa5cf0360903302151k41949851v94ca7567dc7c89a2 () mail ! gmail ! com
[Download RAW message or body]

On Tue, Mar 31, 2009 at 5:32 AM, Marcelo Vanzin
<vanza@users.sourceforge.net> wrote:
> On Mon, Mar 30, 2009 at 1:50 PM, Shlomy Reinstein <sreinst1@gmail.com> wrote:
>> One thing about the OptionsService - why not use ordinary OptionPane
>> objects for the service? Currently, for a simple option pane, I need
>> to write two classes: One for the implementation of OptionsService,
>> and the other is the actual option pane.
>
> For two reasons:
>
> (i) Service instances are "singletons". So if I instantiate you
> service, I'll always be using the same instance.

Right, I forgot about that.

> This has the following side-effects:
>
> - I need a new method in OptionPane and another in OptionGroup to
> notify the service about what is being edited at the time it's used.

Right. The project being edited was previously retrieved by a static
function in ProjectOptions, so the current way it better. Initially I
didn't notice it and it took me a few minutes to realize that the
service actually gets the project as parameter... The pvdebug classes
do not make any use of the project - maybe it's better to add some
usage there, just for reference.

> (ii) is more about preference, but I think the issues in (i) make this
> approach desirable. It also makes it pretty sample to do what I did
> for the VersionControlService (which provides its own option panes by
> just extending OptionsService).

I didn't notice you've made such changes already to a concrete plugin
that makes use of the project options API. I thought that pvdebug was
the only reference, so I looked there. I think It's better to add some
content in it.

> On the flip side, by writing the OptionsService implementation you
> don't need to write java code under weirdly-named properties in the
> plugin's property file, which is something I never liked.

I agree.
All in all, the changes I had to do were pretty small, it's only the
time it took me to find out how to change it exactly that annoyed me a
little. Maybe I should have tracked the PV commits and not be
surprised by this.

Shlomy

------------------------------------------------------------------------------
-- 
-----------------------------------------------
jEdit Developers' List
jEdit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic