Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334391

Summary: [Contributions] java.lang.IllegalArgumentException in CustomizePerspectiveDialog
Product: [Eclipse Project] Platform Reporter: Alexander Mising name <hawkap>
Component: UIAssignee: Andrey Loskutov <loskutov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hawkap, Lars.Vogel, loskutov, pwebster
Version: 3.6.1   
Target Milestone: 4.5 M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/41385
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=320ca4a5621e7f43e1687c3d5be33e4c1106281e
https://git.eclipse.org/r/45858
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=8916639c1ee72656689304d704ec77ce854b3f4b
Whiteboard:
Bug Depends on:    
Bug Blocks: 420956    

Description Alexander Mising name CLA 2011-01-14 11:19:48 EST
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.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
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.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
Comment 1 Alexander Mising name CLA 2011-01-14 11:22:02 EST
Problem is that CustomizePerspectiveDialog could not handle items which tooltip=null.

But tooltip could be set to null in ActionContributionItem (line 807-813).

// if the text is showing, then only set the tooltip if 
// different 
if (!showText || toolTip != null && !toolTip.equals(text)) { 
ti.setToolTipText(toolTip); 
} else { 
ti.setToolTipText(null); 
}
Comment 2 Alexander Mising name CLA 2011-01-14 11:27:13 EST
Scenarios to reproduce:
a)
1)Add item with icon
2)Set mode to "FORCE_TEXT"
3)Empty tooltip, or tooltip==label

open Window->Customize Perspective.. and then hover mouse under above action item.

b) Just add item without icon and without mode "FORCE_TEXT", but with tooltip==label

open Window->Customize Perspective.. and then hover mouse under above action item.
Comment 3 Alexander Mising name CLA 2011-01-14 11:29:09 EST
workaround is to have tooltip different from label.

But CustomizePerspectiveDialog shows tooltip text as label.
Comment 4 Andrey Loskutov CLA 2015-02-08 14:24:34 EST
Fix: https://git.eclipse.org/r/41385
Comment 5 Eclipse Genie CLA 2015-02-09 08:41:17 EST
New Gerrit change created: https://git.eclipse.org/r/41385
Comment 7 Andrey Loskutov CLA 2015-03-24 16:34:06 EDT
.
Comment 8 Eclipse Genie CLA 2015-04-15 06:54:11 EDT
New Gerrit change created: https://git.eclipse.org/r/45858