Extending Sirius UI (tab-bar) [message #1854497] |
Mon, 22 August 2022 17:59 |
Bruno Curzi-Laliberté 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:
And here is a view after
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 #1854508 is a reply to message #1854503] |
Tue, 23 August 2022 05:48 |
Bruno Curzi-Laliberté 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04431 seconds