Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 346788

Summary: Missing exclude attribute on FormData
Product: [Eclipse Project] Platform Reporter: Rob Stark <Rob>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: carolynmacleod4, eclipse.felipe, FredTrellis, prakash, pwebster, remy.suen, Rob, Silenio_Quarti, tom.schindl
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
Adds exclude to FormData, in same fashion as exists on GridData
none
Implementation to support new exclude attribute on FormData none

Description Rob Stark CLA 2011-05-21 11:23:49 EDT
Created attachment 196269 [details]
Adds exclude to FormData, in same fashion as exists on GridData

I would like to offer up an update to a committer for consideration. Can someone please help?

I came across a need to display a mask on-top of my ViewParts during application start-up as state data is loaded from the database (for each View). As such, I came across the need to leverage the idea of 'exclude' on the FormData object for the LoadingMask object in the Composite children array. I noticed the feature existed in the GridData and wondered why it did not also exist on the FormData. I took the time to add it to the FormData object, and by extension of implementation, included the check in the FormLayout.layout(). It was a fairly straight-forward add-on.

Basically I needed a way to hide or exclude the mask from view once the background job of loading was completed. I wanted to hide this instead of disposing it as other points in the application may need to re-display the same loading mask. Using the 'exclude' on the FormData object was a convenient way to hide/show components as the composite layout is re-invoked....

Would someone please take a look and see what you think. I would like to offer this back to the code-base if possible. Just thought it was worth mentioning.
Comment 1 Rob Stark CLA 2011-05-21 11:25:19 EDT
Created attachment 196270 [details]
Implementation to support new exclude attribute on FormData
Comment 2 Felipe Heidrich CLA 2011-05-24 11:48:19 EDT
Hi Rob, we will only be able to work on new APIs after the 3.7 release.
Comment 3 Carolyn MacLeod CLA 2011-05-24 13:55:34 EDT
It is already possible to exclude controls in a FormLayout by switching attachments around. Here's a snippet that shows how:
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet313.java

Having said that, however, it still might be useful to have an exclude field in FormData because it might lead to simpler code, and it would probably be easier for FormLayout users to discover.
Comment 4 Fred Trellis CLA 2013-01-15 04:13:39 EST
(In reply to comment #3)
> It is already possible to exclude controls in a FormLayout by switching
> attachments around. Here's a snippet that shows how:
> http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.swt.snippets/
> src/org/eclipse/swt/snippets/Snippet313.java
> 
> Having said that, however, it still might be useful to have an exclude field
> in FormData because it might lead to simpler code, and it would probably be
> easier for FormLayout users to discover.

Snippet313 demonstrates how to make a control un-visible.

The exclude field functions in GridData as an "exclude for layout calculations", not "exclude from visibility".

This is useful when wishing to place a control manually, outside of the layout managers results.  For example, the Unified toolbar is best excluded from the layout manager, otherwise it's size is dependant on other controls, rather than constant.
Comment 5 Eclipse Genie CLA 2020-05-03 20:34:02 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.