Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Tooltip for WorkbenchWindowControlContribution Items
Tooltip for WorkbenchWindowControlContribution Items [message #833037] Fri, 30 March 2012 22:16 Go to next message
Stefan Nöbauer is currently offline Stefan NöbauerFriend
Messages: 20
Registered: January 2012
Junior Member
Hello,

I implemented a WorkbenchWindowControlContribution to place on the toolbar
via plugin.xml

I just created a Combo for testing. Everything works fine in the toolbar
.... but

if I try to customize my Perspective and I expand my Toolbar where I
placed my Contribution Item I no label is displayed and on mouse hover I
get an IllegalArgumentException.
The code on that place just tries to get the tooltip of the contribution
Item.

In fact there is no possibility to add label and tooltip in the plugin.xml
file I wonder how to solve this problem.

I am using Eclipse 3.6

My ContributionItem:

public class ShowReportsContribution extends
WorkbenchWindowControlContribution {

/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.ContributionItem#isVisible()
*/
@Override
public boolean isVisible() {
return super.isVisible();
}

/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.ContributionItem#isDynamic()
*/
@Override
public boolean isDynamic() {
return false;
}

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

/**
* @param id
*/
public ShowReportsContribution(String id) {
super(id);
// TODO Auto-generated constructor stub
}

/*
* (non-Javadoc)
*
* @see
*
org.eclipse.jface.action.ControlContribution#createControl(org.eclipse
* .swt.widgets.Composite)
*/
@Override
protected Control createControl(Composite parent) {
return new Combo(parent, SWT.None);
}

}

My decleration in PLugin.xml

<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
id="workspace.toolbar"
label="My Toolbar">
<control
class="ShowReportsContribution"
id="Test">
</control>
</toolbar>
</menuContribution>


The Exception:
java.lang.IllegalArgumentException: Argument cannot be null
at org.eclipse.swt.SWT.error(SWT.java:4064)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
at org.eclipse.swt.widgets.Label.setText(Label.java:388)
at
org.eclipse.ui.internal.dialogs.CustomizePerspectiveDialog$NameAndDescriptionToolTip.createEntry(CustomizePerspectiveDialog.java:754)
at
org.eclipse.ui.internal.dialogs.CustomizePerspectiveDialog$NameAndDescriptionToolTip.createToolTipContentArea(CustomizePerspectiveDialog.java:704)
at org.eclipse.jface.window.ToolTip.toolTipShow(ToolTip.java:359)
at org.eclipse.jface.window.ToolTip.toolTipOpen(ToolTip.java:483)
at org.eclipse.jface.window.ToolTip.toolTipCreate(ToolTip.java:348)
at org.eclipse.jface.window.ToolTip.access$2(ToolTip.java:342)
at
org.eclipse.jface.window.ToolTip$ToolTipOwnerControlListener.handleEvent(ToolTip.java:631)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at
org.eclipse.ui.internal.WorkbenchPage.editActionSets(WorkbenchPage.java:1881)
at
org.eclipse.ui.internal.handlers.EditActionSetsHandler.execute(EditActionSetsHandler.java:41)
at
org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at
org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:178)
at
org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247)
at
org.eclipse.ui.internal.PerspectiveSwitcher$11.widgetSelected(PerspectiveSwitcher.java:1144)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)




Can anyone help me?
--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/
Re: Tooltip for WorkbenchWindowControlContribution Items [message #895849 is a reply to message #833037] Mon, 16 July 2012 10:01 Go to previous message
Marcin   is currently offline Marcin Friend
Messages: 8
Registered: October 2011
Junior Member
Hello Stefan,

I'm struggling with the same problem. Have you found the solution?
Or maybe this is a bug and should be reported in bugzilla?

Has anyone have an idea how to provide the tooltip shown in the customize perspective dialog?

Regards,
Marcin
Previous Topic:TableLayout layouts too early
Next Topic:How to delete a cell in a table??
Goto Forum:
  


Current Time: Mon Feb 26 02:41:24 GMT 2024

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

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

Back to the top