Skip to main content



      Home
Home » Eclipse Projects » Sirius » Hide actions in tab-bar
Hide actions in tab-bar [message #1765394] Fri, 09 June 2017 03:56 Go to next message
Eclipse UserFriend
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 04:38 Go to previous messageGo to next message
Eclipse UserFriend
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,

Re: Hide actions in tab-bar [message #1765405 is a reply to message #1765401] Fri, 09 June 2017 05:08 Go to previous messageGo to next message
Eclipse UserFriend
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 04:38 Go to previous messageGo to next message
Eclipse UserFriend
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 08:50 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Hide actions in tab-bar [message #1791723 is a reply to message #1791716] Wed, 04 July 2018 09:22 Go to previous messageGo to next message
Eclipse UserFriend
did the trick. Perfect!
Re: Hide actions in tab-bar [message #1791765 is a reply to message #1791723] Thu, 05 July 2018 02:40 Go to previous messageGo to next message
Eclipse UserFriend
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 566 times)
Re: Hide actions in tab-bar [message #1791781 is a reply to message #1791765] Thu, 05 July 2018 04:32 Go to previous messageGo to next message
Eclipse UserFriend
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

[Updated on: Thu, 05 July 2018 04:37] by Moderator

Re: Hide actions in tab-bar [message #1791791 is a reply to message #1791781] Thu, 05 July 2018 07:15 Go to previous messageGo to next message
Eclipse UserFriend
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 08:38 Go to previous message
Eclipse UserFriend
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
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: Sat Jul 12 01:05:34 EDT 2025

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

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

Back to the top