Skip to main content



      Home
Home » Archived » Visual Editor (VE) » Cannot set JDialog owner Frame
Cannot set JDialog owner Frame [message #54121] Tue, 03 August 2004 10:55 Go to next message
Eclipse UserFriend
Hi,

In VE 1.0M2, setting the owner Frame of a JDialog prevents VE from
displaying the dialog.

If I create a JDialog in my GUI, VE creates a method like this...

private JDialog getJDialog() {
if(jDialog == null) {
jDialog = new JDialog();
jDialog.setContentPane(getJContentPane());
}
return jDialog;
}

The only way I know of setting the owner Frame of this JDialog is to
pass it in the ctor, like this...

private JDialog getJDialog() {
if(jDialog == null) {
jDialog = new JDialog(this);
jDialog.setContentPane(getJContentPane());
}
return jDialog;
}

....where 'this' is the top level JFrame subclass also created in VE.

This worked in VE in eclipse2, but in eclipse3 the JDialog will not
display due to the following error...

java.lang.IllegalArgumentException (IWAV0001E Currently "this" is not
supported)

Is there a work-around?

Chris.
Re: Cannot set JDialog owner Frame [message #54179 is a reply to message #54121] Tue, 03 August 2004 11:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

I have an open defect to allow more support of the "this". The problem
we have is that we try to do exactly what you state in the code, but
there is no "this" during design time. That is because we are in the
process of creating/modifying "this" and we can't run a real "this"
because it is constantly changing. The old VE code had some special
checks in it for JDialog and "this" and understood it, but we revamped
completely how this works to give us more flexibilty, but we lost the
"this" capability.

One workaround for the moment may be to add a jDialog.setParent(this);
right after the constructor. You'll probably get a warning on the
setParent() from the VE but it won't stop the JDialog from being created
and seeing the dialog in the VE.

--
Thanks, Rich Kulp

Re: Cannot set JDialog owner Frame [message #54206 is a reply to message #54179] Tue, 03 August 2004 11:55 Go to previous messageGo to next message
Eclipse UserFriend
Rich Kulp wrote:

> I have an open defect to allow more support of the "this". The problem
> we have is that we try to do exactly what you state in the code, but
> there is no "this" during design time. That is because we are in the
> process of creating/modifying "this" and we can't run a real "this"
> because it is constantly changing. The old VE code had some special
> checks in it for JDialog and "this" and understood it, but we revamped
> completely how this works to give us more flexibilty, but we lost the
> "this" capability.

Perhaps VE could try calling a no-args ctor if the ctor in the code fails.

> One workaround for the moment may be to add a jDialog.setParent(this);
> right after the constructor. You'll probably get a warning on the
> setParent() from the VE but it won't stop the JDialog from being created
> and seeing the dialog in the VE.

This won't work as JDialog doesn't have a setParent() method, or any
other way of setting the parent other than in the ctor.

The only work-around is to remove the ctor args while designing and
remember to put them back for running.

Frankly, I'm amazed that VE works at all without any source annotations.
It's cool stuff!

Chris.
Re: Cannot set JDialog owner Frame [message #54257 is a reply to message #54206] Tue, 03 August 2004 19:57 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Opps. I thought there was a way to set the owner. So until I fix the
defect with "this" in CTORs there is no workaround. Sorry. :-(


--
Thanks, Rich Kulp

Re: Cannot set JDialog owner Frame [message #596595 is a reply to message #54121] Tue, 03 August 2004 11:19 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

I have an open defect to allow more support of the "this". The problem
we have is that we try to do exactly what you state in the code, but
there is no "this" during design time. That is because we are in the
process of creating/modifying "this" and we can't run a real "this"
because it is constantly changing. The old VE code had some special
checks in it for JDialog and "this" and understood it, but we revamped
completely how this works to give us more flexibilty, but we lost the
"this" capability.

One workaround for the moment may be to add a jDialog.setParent(this);
right after the constructor. You'll probably get a warning on the
setParent() from the VE but it won't stop the JDialog from being created
and seeing the dialog in the VE.

--
Thanks, Rich Kulp

Re: Cannot set JDialog owner Frame [message #596603 is a reply to message #54179] Tue, 03 August 2004 11:55 Go to previous message
Eclipse UserFriend
Rich Kulp wrote:

> I have an open defect to allow more support of the "this". The problem
> we have is that we try to do exactly what you state in the code, but
> there is no "this" during design time. That is because we are in the
> process of creating/modifying "this" and we can't run a real "this"
> because it is constantly changing. The old VE code had some special
> checks in it for JDialog and "this" and understood it, but we revamped
> completely how this works to give us more flexibilty, but we lost the
> "this" capability.

Perhaps VE could try calling a no-args ctor if the ctor in the code fails.

> One workaround for the moment may be to add a jDialog.setParent(this);
> right after the constructor. You'll probably get a warning on the
> setParent() from the VE but it won't stop the JDialog from being created
> and seeing the dialog in the VE.

This won't work as JDialog doesn't have a setParent() method, or any
other way of setting the parent other than in the ctor.

The only work-around is to remove the ctor args while designing and
remember to put them back for running.

Frankly, I'm amazed that VE works at all without any source annotations.
It's cool stuff!

Chris.
Re: Cannot set JDialog owner Frame [message #596622 is a reply to message #54206] Tue, 03 August 2004 19:57 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Opps. I thought there was a way to set the owner. So until I fix the
defect with "this" in CTORs there is no workaround. Sorry. :-(


--
Thanks, Rich Kulp

Previous Topic:Extending the palette
Next Topic:Designtime: Components don't show up
Goto Forum:
  


Current Time: Sat Jul 05 12:21:20 EDT 2025

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

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

Back to the top