This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 431978 - [PresentationAPI] Introduce a new constant in IPresentationEngine "HIDDEN_EXPLICITLY"
Summary: [PresentationAPI] Introduce a new constant in IPresentationEngine "HIDDEN_EXP...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Lars Vogel CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-04 03:57 EDT by Lars Vogel CLA
Modified: 2014-04-29 09:19 EDT (History)
5 users (show)

See Also:
daniel_megert: pmc_approved+
emoffatt: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2014-04-04 03:57:44 EDT
In Bug 426535  I work on the possibility to hide Toobars via right mouse click. 

This should also be integrated into the "Customize Perspective" dialog and the ResetPerspective handler. 

So it would nice to have this constant as API for Luna instead of using the String. Other model elements / renderer could also take advantage of this, e.g. Bug 431868.
Comment 1 Dani Megert CLA 2014-04-04 05:03:16 EDT
Please provide the full API along with the Javadoc for review.
Comment 2 Lars Vogel CLA 2014-04-04 05:08:24 EDT
It is a new constant, below is the full API (Javadoc reformatted so that it reads well in Bugzilla, will be correct in the source code)

/**
* This is a persistedState 'key' which can be used by the 
* renderer implementation to decide
* that the user interface element has been hidden by the user
* 
* @since 1.2
*/
public static final String HIDDEN_BY_USER = "HIDDEN_BY_USER"; //$NON-NLS-1$
Comment 3 Dani Megert CLA 2014-04-07 03:46:14 EDT
(In reply to Lars Vogel from comment #2)
> It is a new constant, below is the full API (Javadoc reformatted so that it
> reads well in Bugzilla, will be correct in the source code)
> 
> /**
> * This is a persistedState 'key' which can be used by the 
> * renderer implementation to decide
> * that the user interface element has been hidden by the user
> * 
> * @since 1.2
> */
> public static final String HIDDEN_BY_USER = "HIDDEN_BY_USER"; //$NON-NLS-1$

Is it to "decide" or just to to query the state i.e. like a getter? Please add a dot to the end of Javadoc sentences.

Eric, please also review whether this new constant is needed at this point, thanks.
Comment 4 Lars Vogel CLA 2014-04-07 03:50:44 EDT
(In reply to Dani Megert from comment #3)
> (In reply to Lars Vogel from comment #2)
> > It is a new constant, below is the full API (Javadoc reformatted so that it
> > reads well in Bugzilla, will be correct in the source code)
> > 
> > /**
> > * This is a persistedState 'key' which can be used by the 
> > * renderer implementation to decide
> > * that the user interface element has been hidden by the user
> > * 
> > * @since 1.2
> > */
> > public static final String HIDDEN_BY_USER = "HIDDEN_BY_USER"; //$NON-NLS-1$
> 
> Is it to "decide" or just to to query the state i.e. like a getter? Please
> add a dot to the end of Javadoc sentences.

This would be used to set a tag to the model elements and to query the state. For example ToolBarManagerRenderer sets this tag and queries it.

> Eric, please also review whether this new constant is needed at this point,
> thanks.
Comment 5 Brian de Alwis CLA 2014-04-08 09:26:52 EDT
Could I suggest that this instead be HIDDEN_EXPLICITLY as it would be useful for the remainder of the Activities work (bug 359778).  I have a hack at implementing activities for menus and toolbars there, but it's insufficient as it's only toggles off the visible flag.
Comment 6 Lars Vogel CLA 2014-04-08 11:15:46 EDT
(In reply to Brian de Alwis from comment #5)
> Could I suggest that this instead be HIDDEN_EXPLICITLY as it would be useful
> for the remainder of the Activities work (bug 359778).  I have a hack at
> implementing activities for menus and toolbars there, but it's insufficient
> as it's only toggles off the visible flag.

Fine for me, if Eric does not object (IIRC he suggested the name) but we still have to wait for the PMC decision.
Comment 7 Dani Megert CLA 2014-04-08 11:19:21 EDT
(In reply to Lars Vogel from comment #6)
> (In reply to Brian de Alwis from comment #5)
> > Could I suggest that this instead be HIDDEN_EXPLICITLY as it would be useful
> > for the remainder of the Activities work (bug 359778).  I have a hack at
> > implementing activities for menus and toolbars there, but it's insufficient
> > as it's only toggles off the visible flag.
> 
> Fine for me, if Eric does not object (IIRC he suggested the name) but we
> still have to wait for the PMC decision.

PMC waits for review+ :-)
Comment 8 Lars Vogel CLA 2014-04-08 11:22:06 EDT
(In reply to Dani Megert from comment #7)
> (In reply to Lars Vogel from comment #6)
> > (In reply to Brian de Alwis from comment #5)
> > > Could I suggest that this instead be HIDDEN_EXPLICITLY as it would be useful
> > > for the remainder of the Activities work (bug 359778).  I have a hack at
> > > implementing activities for menus and toolbars there, but it's insufficient
> > > as it's only toggles off the visible flag.
> > 
> > Fine for me, if Eric does not object (IIRC he suggested the name) but we
> > still have to wait for the PMC decision.
> 
> PMC waits for review+ :-)

Not sure what this means. Do I have to do something?
Comment 9 Dani Megert CLA 2014-04-08 11:26:44 EDT
(In reply to Lars Vogel from comment #8)
> (In reply to Dani Megert from comment #7)
> > (In reply to Lars Vogel from comment #6)
> > > (In reply to Brian de Alwis from comment #5)
> > > > Could I suggest that this instead be HIDDEN_EXPLICITLY as it would be useful
> > > > for the remainder of the Activities work (bug 359778).  I have a hack at
> > > > implementing activities for menus and toolbars there, but it's insufficient
> > > > as it's only toggles off the visible flag.
> > > 
> > > Fine for me, if Eric does not object (IIRC he suggested the name) but we
> > > still have to wait for the PMC decision.
> > 
> > PMC waits for review+ :-)
> 
> Not sure what this means. Do I have to do something?

No, Eric.
Comment 10 Eric Moffatt CLA 2014-04-08 13:43:24 EDT
+1  

I like Brian's 'HIDDEN_EXPLICITLY' since it's more generic (we might at some point apply a 'policy' that hides things but isn't based off of some user action).

This is a very useful tag that over time can be applied to more and more of the UI in order to facilitate filtering out stuff the user doesn't want to see. For example it could be applied to an MPartDescriptor to hide a view's existence (i.e. it wouldn't show up in Quick Access or the Show View dialog...).

Lars, can you create a Gerrit for this one ?
Comment 11 Dani Megert CLA 2014-04-09 03:43:50 EDT
+1 for 'HIDDEN_EXPLICITLY'
Comment 12 Lars Vogel CLA 2014-04-09 04:28:17 EDT
(In reply to Eric Moffatt from comment #10)
> Lars, can you create a Gerrit for this one ?

https://git.eclipse.org/r/#/c/24687/
Comment 13 Eric Moffatt CLA 2014-04-15 15:15:57 EDT
Committed:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=e6037e42ee7d6a8477e41ec994f04b1755ff2c51

Thanks Lars. I find that the javadoc is somewhat confusing...its wording implies that once it's been set the renderers / rendering engine makes sure it's never displayed. 

I was going to say that this is 'wrong' but the more I think about it I think that this approach is correct. The implementation should be to have the TBR effectively locked to 'false' even if other controller logic wants to set it to be true. Perhaps we should change the 'isToBeRendered' implementation to enforce this ?

The alternate approach I originally had was that the new tag would be interpreted but the controller logic that is managing the TBR of the element. In the 'hide toolbar' scenario this would be the 'setVisible' handling for the various TB's. This approach is easier to implement but can be broken by any other code that can set that element's TBR state.
Comment 14 Lars Vogel CLA 2014-04-22 12:18:54 EDT
(In reply to Eric Moffatt from comment #13)
> Committed:
> 
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=e6037e42ee7d6a8477e41ec994f04b1755ff2c51
> 
> Thanks Lars. I find that the javadoc is somewhat confusing...its wording
> implies that once it's been set the renderers / rendering engine makes sure
> it's never displayed. 
> 
> I was going to say that this is 'wrong' but the more I think about it I
> think that this approach is correct. The implementation should be to have
> the TBR effectively locked to 'false' even if other controller logic wants
> to set it to be true. Perhaps we should change the 'isToBeRendered'
> implementation to enforce this ?
> 
> The alternate approach I originally had was that the new tag would be
> interpreted but the controller logic that is managing the TBR of the
> element. In the 'hide toolbar' scenario this would be the 'setVisible'
> handling for the various TB's. This approach is easier to implement but can
> be broken by any other code that can set that element's TBR state.

As far as I can see this bug is fixed. Thanks for the feedback Eric and Dani.
Comment 15 Lars Vogel CLA 2014-04-29 09:19:23 EDT
Yes, we have a new constant in Build id: I20140427-2030 ;-)