Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsset max item count for PartStack
https://www.eclipse.org/forums/index.php/mv/msg/667625/1265633/#msg_1265633
in the IDE there is the handy list of all tab items that appeares after
the last tab when a certain amount of items is opened. How can I achieve
this in my RCP? At the moment the behaviour is that the title gets
smaller and smaller the more items are opened.
Regards,
Jan]]>Jan Weidauer2014-03-06T10:38:42-00:00Re: set max item count for PartStack
https://www.eclipse.org/forums/index.php/mv/msg/667625/1265988/#msg_1265988
When we create a stack using the StackRenderer it calls 'setMinimumCharacters' based on whether it's an editor or a view stack. For view stacks we set it to '1', meaning that it'll shrink the tab rather than dropping them of onto the end with the '>>' dropdown.
I'm not positive but you may well be able to fix this by over riding our default using CSS...let me know if this doesn't work (it should).
]]>Eric Moffatt2014-03-06T21:00:06-00:00Re: set max item count for PartStack
https://www.eclipse.org/forums/index.php/mv/msg/667625/1266314/#msg_1266314
I wondered what the difference between a view stack and an editor stack
might be for this is a point of view I thought e4 hasn't anymore. So I
took a deeper look into the StackRenderer (I am working with 4.3). It
seems the renderer decides if the Stack is placed in an MArea or not.
I changed my model and placed the Stack inside an Area but nothing
changed. So I debugged that and found that the model service ignores the
fact that the parent of the Stack is an Area.
After that I was searching for possible CSS properties but didn't find a
proper thing. Could you give me a hint in this direction please?
If that turns out to be no usable way too I see only the option to try
to retrieve the CTabFolder of the Stack and set the minimum characters
programmatically. But this seems to be a more dirty way.
Jan
Am 06.03.2014 22:00, schrieb Eric Moffatt:
>
> When we create a stack using the StackRenderer it calls 'setMinimumCharacters' based on whether it's an editor or a view stack. For view stacks we set it to '1', meaning that it'll shrink the tab rather than dropping them of onto the end with the '>>' dropdown.
>
> I'm not positive but you may well be able to fix this by over riding our default using CSS...let me know if this doesn't work (it should).
>]]>Jan Weidauer2014-03-07T09:04:01-00:00Re: set max item count for PartStack
https://www.eclipse.org/forums/index.php/mv/msg/667625/1266602/#msg_1266602
Here's the current state of the SWT CSS capabilities (thanks to Paul Webster for finding this...)
CTabFolder ctf = (CTabFolder) changedElement.getWidget();
ctf.setMinimumCharacters(<whatever you want>);
}
]]>Eric Moffatt2014-03-07T18:03:48-00:00Re: set max item count for PartStack
https://www.eclipse.org/forums/index.php/mv/msg/667625/1268423/#msg_1268423
Am 07.03.2014 19:03, schrieb Eric Moffatt:
>
> Here's the current state of the SWT CSS capabilities (thanks to Paul Webster for finding this...)
>
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.e4.ui.css.swt/plugin.xml
>
> If it's not able to be set through CSS here's a hack that listens for new stacks being rendered and sets the char limit:
>
> @Inject
> @Optional
> private void handleNewStacks(@UIEventTopic(UIEvents.UIElement.TOPIC_WIDGET) Event event) {
> final MUIElement changedElement = (MUIElement) event.getProperty(EventTags.ELEMENT);
> if (!(changedElement instanceof MPartStack) || !(changedElement.getWidget() instanceof CTabFolder))
> return;
>
> CTabFolder ctf = (CTabFolder) changedElement.getWidget();
> ctf.setMinimumCharacters(<whatever you want>);
> }
>]]>Jan Weidauer2014-03-10T13:33:26-00:00