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

Bug 268352

Summary: [Compatibility] Tabs Don't have Close Option
Product: [Eclipse Project] e4 Reporter: Aghiles Abdesselam <aghilesa>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED WORKSFORME QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: Kevin_McGuire, remy.suen
Version: 0.9   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 271490    
Bug Blocks:    

Description Aghiles Abdesselam CLA 2009-03-12 10:16:27 EDT
In the compatibility demo, none of the tabs have the close option.
Comment 1 Eric Moffatt CLA 2009-03-13 09:43:10 EDT
Kevin, do you have any input on how to arrange this? Should we be doing this through the CSS or through the UI model (or a combination)?
Comment 2 Eric Moffatt CLA 2009-03-20 13:43:35 EDT
I've hacked in some code (using the magic 'policy' field) to get the compatibility layer to have min/max buttons and the correct close button behavior for editor/view stacks.

We should remove this code once we figure out the correct implementation path...
Comment 3 Kevin McGuire CLA 2009-04-07 12:38:08 EDT
(In reply to comment #1)
> Should we be doing this
> through the CSS or through the UI model (or a combination)?

I think it'd be cool to do in CSS.

Note setShowClose() is on CTabItem.  We don't support that today but could in M3.

The 3x policy for close box visibility, which I assume we're going to at least keep in compatibility, is for all editors to have their close box but only the selected view within it's stack to have one.

Thus we'd need:

1) To distinguish editors from views presumably via CSS class selector.  Here the renderer would set the CSS ID of the CTabFolder to be either .editors or .views (or .editorStack and .viewStack if you prefer)

2) Have markup that looks something like:

CTabFolder.editors CTabItem {
   showClose: true;
}

CTabFolder.views CTabItem {
  showClose: false;
}

CTabFolder.view CTabItem:selected {
  showClose: true;
}

If nothing else it'd be a good exercise in more complex CSS styling.  I also like the idea of having it in the CSS since then it's quite easy to change what is purely a visual policy of how we treat editors different from views.
Comment 4 Kevin McGuire CLA 2009-04-07 12:39:47 EDT
Minor typo, last CSS expression should've read:

CTabFolder.views CTabItem:selected {
  showClose: true;
}
Comment 5 Kevin McGuire CLA 2009-04-07 12:53:33 EDT
I've created bug #271490 for the CTabItem support.  Eric, if you agree with this approach we can add it as blocking this bug.
Comment 6 Eric Moffatt CLA 2009-04-07 16:01:06 EDT
Sounds good to me...
Comment 7 Eric Moffatt CLA 2009-07-17 15:07:51 EDT
We now delegate to the CSS for this...