I don't understand how this correlates with the problem you mentioned
before (how to find a field on a prop panel). It sounds like an
entirely different problem.
More comments inline below:
On Wed, Apr 23, 2008 at 5:47 AM, Zoran Jeremic <[EMAIL PROTECTED]> wrote:
> I have 2 different errors in the following method.
> public void setProjectValues(){
> if (Model.getFacade().isAModel(TargetManager.getInstance().getTarget())){
> LOG.info("setProjectValues 1");
> It works if the model is selected, but if I select any other element i.e.
> class
> diagram it generates the following error:
> Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException:
> Must have an MDR element supplied. Received a
> org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram
Pretty much everything you need to know is in the error message.
Don't pass diagrams to Model subsystem methods!
TargetManager.getTarget() can return a variety of object types,
depending on what is selected (as you discovered in your
experimentation). You need to check the type of the target returned
before using it and conditionalize your code appropriately.
> If I select model it passes but generates the following error when I try to
> access the field description in my tab.
> Here is the error that I get:
>
> 33187 INFO [AWT-EventQueue-0] setProjectValues 5 (Project.java:69)
> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
> at depths.ont.project.Project.setProjectValues(Project.java:70)
There's not enough context to tell what code is causing this
exception. Are you using a debugger to debug these problems? The
fact that you've got logging messages inserted every line in your code
makes me suspicious that you are not. Set your debugger to break on
NullPointerExceptions or set a breakpoint just before the failing line
and look at the execution state. It should be obvious what the
problem is.
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]