[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] selectAddedObject() throws NullPointerException only on Linux

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