Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Extending Sirius UI (tab-bar)(Extending Sirius in a Java Plugin)
Extending Sirius UI (tab-bar) [message #1854497] Mon, 22 August 2022 17:59 Go to next message
Bruno Curzi-Laliberté is currently offline Bruno Curzi-LalibertéFriend
Messages: 14
Registered: January 2022
Junior Member
Hi, I am trying to add a simple button in the eclipse modeling UI for my runtime eclipse application using my plugin, except the UI breaks when i do so...

I will put 2 full screen images to put in context how the tab bar is broken, sorry for the size.

Here is a view before, see the tab bar above the diagram, where the mouse is:

https://i.imgur.com/bYvHlYW.png

And here is a view after

https://i.imgur.com/5TwIysd.png

I am adding my tabbar contribution like so:

import org.eclipse.ui.menus.CommandContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
import org.eclipse.ui.menus.ExtensionContributionFactory;
import org.eclipse.ui.menus.IContributionRoot;
import org.eclipse.ui.services.IServiceLocator;

public class testExtension extends ExtensionContributionFactory {

	public testExtension() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
		String cmdId = "org.epimodel.createEpidemic";
		CommandContributionItemParameter x = new CommandContributionItemParameter(
				serviceLocator,
                cmdId,
                cmdId,
                null,
                null,
                null,
                null,
                cmdId,
                cmdId,
                cmdId,
                CommandContributionItem.STYLE_PUSH,
                cmdId,
                true);
		additions.addContributionItem(new CommandContributionItem(x), null);
	}
}


I know I most likely put cmdId in too many argument places but I don't think that's the problem.

IF i do NOT call addContribuionItem(...) the UI is not broken.
Re: Extending Sirius UI (tab-bar) [message #1854501 is a reply to message #1854497] Mon, 22 August 2022 20:04 Go to previous messageGo to next message
Bruno Curzi-Laliberté is currently offline Bruno Curzi-LalibertéFriend
Messages: 14
Registered: January 2022
Junior Member
I can see my button if I stretch the window :)

https://i.imgur.com/bqVyq0N.png
Re: Extending Sirius UI (tab-bar) [message #1854502 is a reply to message #1854501] Mon, 22 August 2022 20:09 Go to previous messageGo to next message
Bruno Curzi-Laliberté is currently offline Bruno Curzi-LalibertéFriend
Messages: 14
Registered: January 2022
Junior Member
Now my button is gone I absolutely do not understand this tab bar :(

https://i.imgur.com/MCPW1T2.png
Re: Extending Sirius UI (tab-bar) [message #1854503 is a reply to message #1854502] Mon, 22 August 2022 20:11 Go to previous messageGo to next message
Bruno Curzi-Laliberté is currently offline Bruno Curzi-LalibertéFriend
Messages: 14
Registered: January 2022
Junior Member
If I extend the window to click my button I get an error saying the operation is not enabled, then i can close the diagram and when I reopen it the tab bar is fine but without my button.
Re: Extending Sirius UI (tab-bar) [message #1854508 is a reply to message #1854503] Tue, 23 August 2022 05:48 Go to previous messageGo to next message
Bruno Curzi-Laliberté is currently offline Bruno Curzi-LalibertéFriend
Messages: 14
Registered: January 2022
Junior Member
Resolved (kinda)

The tab bar is still huge BUT i can get my button on the screen even when clicking on diagram elements now, specifically the problematic property was String label being too long I assume, changed it to "label" instead of "org.epimode.createEpidemic"

CommandContributionItemParameter x = new CommandContributionItemParameter(
				serviceLocator, // IServiceLocator serviceLocator
				cmdId, // String id
				cmdId, // String commandId
				null, // Map parameters
				null, // ImageDescriptor icon
				null, // ImageDescriptor disabledIcon
				null, // ImageDescriptor hoverIcon
				"label", // String label
				null, // String mnemonic
				null, // String tooltip
				CommandContributionItem.STYLE_PUSH, // int style
				null, // String helpContextId
				true); // boolean visibleEnabled
Re: Extending Sirius UI (tab-bar) [message #1854708 is a reply to message #1854508] Fri, 02 September 2022 22:31 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hi Bruno,

If I got it correctly, you made your tabbar extension "with just Eclipse" but we also have our own abtract classes (org.eclipse.sirius.diagram.ui.tools.api.editor.tabbar.AbstractTabbarContributor) to help you and it should bypass these graphical issues. I recommand to have a look to this guide: https://www.eclipse.org/sirius/doc/developer/extensions-provide_tabbar_extensions.html

Best regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:[Sirius] Access to local resources of modeling project
Next Topic:Processing LinkedHashMap (Json) Object with AQL
Goto Forum:
  


Current Time: Thu Apr 25 12:09:56 GMT 2024

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

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

Back to the top