Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Hide actions in tab-bar
Hide actions in tab-bar [message #1765394] Fri, 09 June 2017 07:56 Go to next message
Martin Jedlicka is currently offline Martin JedlickaFriend
Messages: 122
Registered: January 2016
Senior Member
Hi,

I needed to hide some actions in the tab-bar, but I did not find the appropriate command id to it.

How can I hide some actions from the tab-bar (and popup menu)?

I need to hide actions:


  • Arrange Linked Border Nodes
  • Pin / Unpin
  • Fill color
  • Line Color
  • Activate Layouting Mode
  • Set style to workspace image
  • Apply the aplicable appearance properties


Thanks.

Martin
Re: Hide actions in tab-bar [message #1765401 is a reply to message #1765394] Fri, 09 June 2017 08:38 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi Martin,

What you need to do is to provide a complete custom tabbar to be able to remove already present items.
This process is described in the documentation in SIrius>Sirius Developer Manual > Extension Point > Provide tab-bar extensions

Regards,



Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Hide actions in tab-bar [message #1765405 is a reply to message #1765401] Fri, 09 June 2017 09:08 Go to previous messageGo to next message
Martin Jedlicka is currently offline Martin JedlickaFriend
Messages: 122
Registered: January 2016
Senior Member
Hi Pierre,

Super. Thanks you very much!

Martin
Re: Hide actions in tab-bar [message #1791692 is a reply to message #1765405] Wed, 04 July 2018 08:38 Go to previous messageGo to next message
Wolfgang Geck is currently offline Wolfgang GeckFriend
Messages: 9
Registered: June 2018
Junior Member
Is there a way to hide the editor's tab-bar completely? I implemented a custom TabbarContributor that always returns an empty list of IContributionItems but there is still an empty tabbar area visible on top of the editor.
Re: Hide actions in tab-bar [message #1791716 is a reply to message #1791692] Wed, 04 July 2018 12:50 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

To hide the tabbar, you need to activate programmatically the following non-UI preference (let's say in the Activator of the plugin with your odesign):
DiagramUIPlugin.getPlugin().getPreferenceStore().setValue(SiriusDiagramUiPreferencesKeys.PREF_OLD_UI.name(), true);

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Hide actions in tab-bar [message #1791723 is a reply to message #1791716] Wed, 04 July 2018 13:22 Go to previous messageGo to next message
Wolfgang Geck is currently offline Wolfgang GeckFriend
Messages: 9
Registered: June 2018
Junior Member
did the trick. Perfect!
Re: Hide actions in tab-bar [message #1791765 is a reply to message #1791723] Thu, 05 July 2018 06:40 Go to previous messageGo to next message
Wolfgang Geck is currently offline Wolfgang GeckFriend
Messages: 9
Registered: June 2018
Junior Member
Hi Steve,

I first didn't realize it but your solution adds some extra entries to the applications global toolbar. index.php/fa/33309/0/

The only quick and dirty solution I found so far is the following layout hack:

@Override
public List<IContributionItem> getContributionItems(ISelection selection, IDiagramWorkbenchPart part,
ToolBarManager manager) {

((GridData) manager.getControl().getParent().getLayoutData()).heightHint=0;
manager.getControl().getParent().layout(true);
return Collections.emptyList();
}

Wolfgang
  • Attachment: toolbar.png
    (Size: 3.41KB, Downloaded 490 times)
Re: Hide actions in tab-bar [message #1791781 is a reply to message #1791765] Thu, 05 July 2018 08:32 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

Yes I forgot to add that you will still need to remove the action yourself. The preference only revert back to the old UI where the actions where on the top action bar. I have to admit that I never tried to removed them all. I am curious why do you want to remove them all, as well as action like the arrange all or show/hide etc?
For the implementation of your TabbarContributor, I would have return empty list in the implementation of the methods List<IContributionItem> getDiagramContributionItem(IDiagramWorkbenchPart part, ToolBarManager manager) and List<IContributionItem> getDiagramElementContributionItem(IDiagramWorkbenchPart part, ToolBarManager manager).

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Thu, 05 July 2018 08:37]

Report message to a moderator

Re: Hide actions in tab-bar [message #1791791 is a reply to message #1791781] Thu, 05 July 2018 11:15 Go to previous messageGo to next message
Wolfgang Geck is currently offline Wolfgang GeckFriend
Messages: 9
Registered: June 2018
Junior Member
Hi Steve, I returned an empty collection for both method implementations however got all that additional extra entries shown in the screenshot above. The reason why we try to get rid of the toolbar is that we replace an existing non Sirius based editor (without toolbar) one by one with an Sirius based editor. I thought there was a simple solution anyway the use case is not so important and my layout hack works fine for the moment!

Thanks for your fast reply and help
Wolfgang
Re: Hide actions in tab-bar [message #1791798 is a reply to message #1791791] Thu, 05 July 2018 12:38 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
You're welcome.
Looking back to your screenshot, the remaining tools are GEF or GMF tools. I thought that not contributing them through getDiagramContributionItem() would get rid of them (as in examples like org.eclipse.sirius.tests.swtbot.tabbar.TabbarContributorSample they are added to the list of tabbar actions). It may comes from the combinaison with the preference "old UI" that bring them back. Anyway, I think that your solution was the only way to hide them all using a TabbarContributor.

Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:the following mapping semantic candidates expression could not be correctly evaluated :
Next Topic:Rollback to a previous state of the model
Goto Forum:
  


Current Time: Thu Mar 28 08:51:03 GMT 2024

Powered by FUDForum. Page generated in 0.02717 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top