logo       

PlugInContext.getLayerManager returns null?: msg#00530

gis.jump.devel

Subject: PlugInContext.getLayerManager returns null?

I'm still squishing bugs in my super select tool, and I've come upon a
problem. I hope you guys can offer a suggestion that might help me fix
it.

In my code I need to obtain a reference to the LayerManager of the
current task. I do this using the PlugInContext object passed to my
PlugIn's execute() method. I know from logging statements that my
PlugInContext is not null. However, it appears that the LayerManager
returned by the PlugInContext.getLayerManager method is null.

When the this code is executed a task in open in OpenJUMP and contains
Layers, so I know the instance of LayerManager returned by the context
should be valid, and not null.

Am I missing another part of the picture? The Javadoc for the
PlugInContext and LayerManagerProxy classes did not mention any
exceptions or conditions under which a null value would be returned.

Thank you for any suggestions.

The Sunburned Surveyor

P.S. - Here is the code snippet in question:

if(this.context == null)
{
logger.debug("The context was null.");
}

LayerManager manager = this.context.getLayerManager();
.debug("Just got the layer manager.");

if(manager == null)
{
logger.debug("The manager was null.");
}

The last line in the log file is "The manager was null."

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise