Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » NPE during mouse down on palette(Null pointer exception is thrown when i click on palette.)
NPE during mouse down on palette [message #1268324] Mon, 10 March 2014 11:02
mohamed masood is currently offline mohamed masoodFriend
Messages: 1
Registered: March 2014
Junior Member
java.lang.NullPointerException
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:247)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer$1.run(AbstractEditPartViewer.java:131)
at org.eclipse.gef.SelectionManager.fireSelectionChanged(SelectionManager.java:144)
at org.eclipse.gef.SelectionManager.appendSelection(SelectionManager.java:83)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.appendSelection(AbstractEditPartViewer.java:190)
at org.eclipse.gef.ui.parts.AbstractEditPartViewer.select(AbstractEditPartViewer.java:599)
at org.eclipse.gef.ui.palette.editparts.PaletteEditPart$SingleSelectionTracker.performSelection(PaletteEditPart.java:174)
at org.eclipse.gef.tools.SelectEditPartTracker.performConditionalSelection(SelectEditPartTracker.java:167)
at org.eclipse.gef.tools.SelectEditPartTracker.handleButtonDown(SelectEditPartTracker.java:92)
at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart$ToggleButtonTracker.handleButtonDown(ToolEntryEditPart.java:92)
at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart$OtherToggleButtonTracker.handleButtonDown(ToolEntryEditPart.java:169)
at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091)
at org.eclipse.gef.tools.SelectionTool.mouseDown(SelectionTool.java:514)
at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:245)
at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMousePressed(DomainEventDispatcher.java:348)
at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown(LightweightSystem.java:523)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:192)
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:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


And here is my palette viewer.

@Override
protected PaletteViewerProvider createPaletteViewerProvider()
{
return new PaletteViewerProvider(getEditDomain()) {
private IMenuListener menuListener;

@Override
protected void configurePaletteViewer(PaletteViewer viewer)
{
super.configurePaletteViewer(viewer);
viewer.setCustomizer(new FormPaletteCustomizer());
viewer.addDragSourceListener(new TemplateTransferDragSourceListener(viewer));
}

@Override
protected void hookPaletteViewer(PaletteViewer viewer)
{
super.hookPaletteViewer(viewer);
final CopyTemplateAction copy = (CopyTemplateAction) getActionRegistry().getAction(ActionFactory.COPY.getId());
viewer.addSelectionChangedListener(copy);
if (menuListener == null)
{
menuListener = new IMenuListener() {
public void menuAboutToShow(IMenuManager manager)
{
manager.appendToGroup(GEFActionConstants.GROUP_COPY, copy);
}
};
}
viewer.getContextMenu().addMenuListener(menuListener);
}
};
}

Thanks in advance
Previous Topic:How to hook the GEF Editor and TextEditor together in MultiPage Editor
Next Topic:I want to change fontsize in textflow or label
Goto Forum:
  


Current Time: Thu Dec 18 05:49:00 GMT 2014

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

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