[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] selectAddedObject() throws NullPointerException only on Linux
|
- From: Barry Andrews <bandrews@xxxxxxxxxxxxxxxx>
- Date: Thu, 02 Dec 2004 09:32:04 -0500
- Newsgroups: eclipse.tools.gef
- Organization: EclipseCorner
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913
Hello,
I think this is probably a bug, but I would like to confirm with the
experts here before logging. I have overridden CreationTool to provide
additional functionality to performCreation() method. My class looks
like this:
public class DECreationTool extends CreationTool
{
/**
*
*/
public DECreationTool()
{
super();
}
/**
* @param aFactory
*/
public DECreationTool(CreationFactory aFactory)
{
super(aFactory);
}
/* (non-Javadoc)
* @see org.eclipse.gef.tools.CreationTool#performCreation(int)
*/
protected void performCreation(int button)
{
CreateCommand command = (CreateCommand)this.getCommand();
if(command.preExecute())
{
this.setCurrentCommand(command);
try
{
super.performCreation(button);
}
catch(NullPointerException $ne)
{
//TODO I only get this problem on Linux. It happens when
// selectAddedObject() is called.
;
}
}
}
}
All the preExecute() method does is gets some information from the user
via a dialog and returns true/false based on whether or not the
information was valid.
The problem is when selectAddedObject() method is called, the
EditPartViewer from getCurrentViewer() is null.
This only happens on Linux. It works fine on Windows. Is it obvious I am
doing something wrong here, or is it a bug in the framework?
many thanks,
Barry