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

Bug 410787

Summary: [Perspectives] No way to influence the SWT Style bits of a Window
Product: [Eclipse Project] Platform Reporter: Jonas Helming <jhelming>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED DUPLICATE QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: bsd, emoffatt, Lars.Vogel, matthias.flock, pwebster
Version: 4.3Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jonas Helming CLA 2013-06-14 04:56:55 EDT
There is currently no way to influence the Style of a Window, e.g. to make it non-resizable or non-closable. This could either be done using tags in the application model or offering this in CSS.
Comment 1 Eric Moffatt CLA 2013-06-17 16:16:04 EDT
Which do you think would be better ? 

Since we can 'query' our CSS engine it's technically feasible to do this through CSS even though it's not directly supportable in SWT (we wouldn't even have to expose the 'bits', we can create custom 'attributes' associated the Window's CSS such as 'sizable=false'...)

We could also do the same thing through tags of course...
Comment 2 Jonas Helming CLA 2013-06-22 06:42:33 EDT
Hmm, since this is more related to the functionality of the window than to the "style" i think it would be more consistent to do it with tags. We already have tags for parts for "non-maximizable" etc.
Comment 3 Brian de Alwis CLA 2013-06-22 09:12:59 EDT
The tags represent state, which changes over the lifetime of the window. The style bits don't change, and so might be better to be expressed as CSS.
Comment 4 Jonas Helming CLA 2013-06-25 12:41:37 EDT
Brian, I agree with that.
Comment 5 Matthias F CLA 2013-06-28 05:44:25 EDT
Actually the style bits can change, because you can change the whole theme of the application. Changes to the shell style won't be updated then without rebuilding the UI because the shell style can only be set on creation of the shell.

Probably the MWindow model should have special attributes for this, like Parts have with the "closeable" checkbox.
Comment 6 Eric Moffatt CLA 2013-10-10 14:22:46 EDT
Just an observation on the last comment. It turns out that the IDE can't actually use the 'closeable' attribute since it's an attribute of an MPart. The IDE allows you to have a view that's closeable in one perspective but not in different one so we have to use the IPresentationEngine#NO_CLOSE tag on the MPlaceholders instead.

I'll tag this one for work in M3 since it's pretty self-contained. At this point based on the comments we'll go with the CSS approach, agreed ?
Comment 7 Eric Moffatt CLA 2013-10-10 14:23:59 EDT
BTW, one thing that would be nice is a definitive list of *which* attributes you want to control. We already mention 'close' and 'size', do we also want to limit the shell's size... ?
Comment 8 Timo Kinnunen CLA 2013-10-30 11:51:28 EDT
Menu bar, please. To be shown/hidden by tapping Alt-key.
Comment 9 Paul Webster CLA 2013-10-30 12:03:11 EDT
(In reply to Timo Kinnunen from comment #8)
> Menu bar, please. To be shown/hidden by tapping Alt-key.

?  That's not related to the style bits (trim, close, minimize, maximize, etc).

PW
Comment 10 Timo Kinnunen CLA 2013-10-30 14:54:42 EDT
(In reply to comment #9)
> ?  That's not related to the style bits (trim, close, minimize, maximize, etc).

I admit I haven't looked into the the code itself to see how the menu bar works, just that poking around in CSS Spy I see Shells having style bits like   SWT.TITLE,   SWT.CLOSE,   SWT.MENU,   SWT.MAX,   SWT.BORDER and with the menu bar non-responsive to inspecting its CSS, it seemed like something that should work but wasn't yet implemented. What's the real story on customizing menu bar visibility?
Comment 11 Jonas Helming CLA 2013-11-04 08:16:43 EST
for me the priority would be CLOSE, MIN, MAX, TITLE, ON_TOP

and less important:

BORDER, NO_TRIM, RESIZE

About the issue of changes at runtime: I think that this is the case for both, styling an model properties, expect you would be the model attributes unchangable...
Comment 12 Eric Moffatt CLA 2013-12-10 15:38:00 EST
M4 is done...
Comment 13 Eric Moffatt CLA 2014-02-11 14:05:43 EST
I'll mark this as a DUP, I'll be committing the code against the other defect...

*** This bug has been marked as a duplicate of bug 398027 ***