Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 220891 - [Workbench] early startup could allow option to be disabled by default
Summary: [Workbench] early startup could allow option to be disabled by default
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 173040
  Show dependency tree
 
Reported: 2008-02-29 02:07 EST by Jacek Pospychala CLA
Modified: 2011-02-28 07:01 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2008-02-29 02:07:40 EST
Sometimes super users want functionality to be put in early startup, that won't be useful for the rest.
It would be useful then to set org.eclipse.ui.startup extension point to be disabled by default and allow such user to enable it in "Preferences -> General -> Startup and Shutdown" if he knows what he do.


Our particular use case is bug 173040 where we want to start error log view on any first log event.

See Daniel Megert comment: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173040#c11
Comment 1 Dani Megert CLA 2008-02-29 05:31:43 EST
I will fix this if Platform UI agrees on it.
Comment 2 Jacek Pospychala CLA 2008-02-29 05:43:13 EST
(In reply to comment #1)
> I will fix this if Platform UI agrees on it.

that would be great. I've started prototyping and run into one problem:
Platform UI stores preference only about disabled plugins and then there's no way to enable that plugins using preference.
There's another preference needed, or some tweaking to already existing one.
Comment 3 Dani Megert CLA 2008-02-29 06:18:59 EST
>There's another preference needed, or some tweaking to already existing one.
Yep. Fortunately this is an internal preference.
Comment 4 Kim Horne CLA 2008-03-03 13:45:52 EST
Just to be clear, you're suggesting a new attribute to the startup extension point for "enabled" with the default being true (for backwards compatibility)?  If so, absolutely - great idea!
Comment 5 Dani Megert CLA 2008-03-10 04:23:01 EDT
Yes, that's my suggestion. I'll try to do this for M6, so that we can also close bug 173040.
Comment 6 Dani Megert CLA 2008-03-21 13:49:54 EDT
This is a bit more complicated than I hoped because
- the UI prefs aren't 100% stored: there's just a black list
  ==> we also need a white list for those that are disabled by default
- the individual attributes are currently only read in the EarlyStartupRunnable
  ==> we could get and check the 'enabled' attribute there but that seems
      conceptually wrong to me: we should make that check before we create the
      runnable.

My preferred solution to this is to introduce a StartupDescriptor or StartupRecord that holds all that information together for each contribution.

I have the extension point addition in place but the above changes need more work. I hope to get this done during next weeks fix pass.
Comment 7 Dani Megert CLA 2008-03-27 13:07:30 EDT
> I hope to get this done during next weeks fix pass.
That did not work out.
Comment 8 Dani Megert CLA 2008-04-08 06:36:09 EDT
Mike, according to Philippe we also need PMC approval for extension point changes. 

I would like to add the following attribute:

         <attribute name="enabled" type="boolean" use="default" value="true">
            <annotation>
               <documentation>
                  the startup takes place if this attribute is &amp;quot;true&amp;quot; or if this optional attribute is not present. The user can override this setting in his preferences.
               </documentation>
            </annotation>
         </attribute>


Or in more readable form:

enabled (true | false), default: true
- the startup takes place if this attribute is "true" or if this optional attribute is not present. The user can override this setting in his preferences.
Comment 9 Kim Horne CLA 2008-04-08 13:39:23 EDT
(In reply to comment #8)
> Mike, according to Philippe we also need PMC approval for extension point
> changes. 
> 
> I would like to add the following attribute:
> 
>          <attribute name="enabled" type="boolean" use="default" value="true">
>             <annotation>
>                <documentation>
>                   the startup takes place if this attribute is
> &amp;quot;true&amp;quot; or if this optional attribute is not present. The user
> can override this setting in his preferences.
>                </documentation>
>             </annotation>
>          </attribute>
> 
> 
> Or in more readable form:
> 
> enabled (true | false), default: true
> - the startup takes place if this attribute is "true" or if this optional
> attribute is not present. The user can override this setting in his
> preferences.
> 

Traditionally we've had issues with boolean attributes like this.  We define two states and then we discover a third that'd we'd like to expose and suddenly we have two boolean values with some crazy interaction.  I'd suggest using an enumeration attribute instead with a name like "mode."  Perhaps there'd be different behavior based on whether or not the plug-in was already loaded (via osgi.bundles in an RCP app) or whether or not the extension lived in the product plugin or what have you. 
Comment 10 Dani Megert CLA 2008-04-08 15:48:08 EDT
>Traditionally we've had issues with boolean attributes like this. 
Examples?

>We define
>two states and then we discover a third that'd we'd like to expose and suddenly
>we have two boolean values with some crazy interaction.
Sorry but this indeed looks like "crazy" to me. At least in JDT and Text land we make API that is requested and needed and do not prepare to 'crazy' stuff. Of course if Platform UI according to their experience propose a better way I am all open. Mike?
Comment 11 Mike Wilson CLA 2008-04-08 16:03:23 EDT
Adding Jeff for more history about the pain that using boolean values has caused us. I'm pretty sure we've discussed it several times in the arch calls. There's *always* a third option (we just don't what it is yet).
Comment 12 Dani Megert CLA 2008-04-08 16:06:16 EDT
Yes, there is alway more that people want ;-)
My personal attitude is: you can always give more later. That's normally less pain than exposing too much upfront. But that's just me.
Comment 13 Kim Horne CLA 2008-04-09 09:19:13 EDT
(In reply to comment #10)
> >Traditionally we've had issues with boolean attributes like this. 
> Examples?

There are two examples of this in the actionSet extension point alone - the @pulldown attribute and the combination of @retarget/@allowLabelUpdate are both examples of where we've neglected to look forward when defining our extension points.  We have similar issues in our java APIs as well.  The only one off the top of my head is the part state/zoomed state distinction in IWorkbenchPage. 

> >We define
> >two states and then we discover a third that'd we'd like to expose and suddenly
> >we have two boolean values with some crazy interaction.
> Sorry but this indeed looks like "crazy" to me. At least in JDT and Text land
> we make API that is requested and needed and do not prepare to 'crazy' stuff.
> Of course if Platform UI according to their experience propose a better way I
> am all open. Mike?
> 

Here's an example that I could easily see us doing - having an unmodifiable "on" state for RCP applications.  This state would override any preference or setting specified by your suggested attribute.  It'd be another one of those boolean pairs like  @retarget/@allowLabelUpdate where the value of one makes the value of the other irrelevant.  Having an enumeration for values here would allow us to head these situations off before they happen with absolutely no pain in the short term.
Comment 14 Dani Megert CLA 2008-04-09 10:15:58 EDT
Would the following attribute better fit your needs:

Attribute 'enablement' or 'startupMode' with currently allowed values 'onByDefault' and 'offByDefault'? This would allow to e.g. add 'alwaysOn' or 'ignoreUserPref'. Or we could use numbers instead of strings (not sure what's the preferred thing for Platform UI - I'd prefer strings though).

Personally I'd still prefer to add just what we need now, unless there's already some requests in bugzilla to do more in the future. But I am also absolutely fine with the other approach.
Comment 15 Boris Bokowski CLA 2008-04-09 14:47:30 EDT
(In reply to comment #14)
> Would the following attribute better fit your needs:
> 
> Attribute 'enablement' or 'startupMode' with currently allowed values
> 'onByDefault' and 'offByDefault'? This would allow to e.g. add 'alwaysOn' or
> 'ignoreUserPref'. Or we could use numbers instead of strings (not sure what's
> the preferred thing for Platform UI - I'd prefer strings though).

Sounds good to me (an attribute with string values). It looks like we already have an idea what kind of additional values we might want in the future.
Comment 16 Dani Megert CLA 2008-04-29 05:55:52 EDT
Moving to 3.5. Too late now.
Comment 17 Dani Megert CLA 2011-02-28 07:01:13 EST
On a second thought we should not offer this and should not make it easier to use the startup extension point. A better solution for bug 173040 would be a new extension point where plug-ins can register for log events via extension point.