It is possible to develop visual classes that are descendants from my base classes? [message #129498] |
Fri, 04 August 2006 09:27  |
Eclipse User |
|
|
|
Hello, All!
Eclipse 3.2 final
VE 1.2 final
It is possible to develop visual classes that are descendants from my base classes?
Actualy I create base dialog with 3 panels on it
First panel - is a general layer
Second panel - is for possible buttons
Third panel - is for possible controls
Base dialog opened in VE perfectly.
After that I create a descendant from it and try to open in VE in order to put some controls
at Second and Third panels, but I CANT put anything :((
I write code manualy that adding controls and run my descendant dialog - at run time it looks fine
but in VE it is not.
Any suggestions???
Here smple code
----------- Base dlg code ----------
package test.ve;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JDialog;
import javax.swing.JPanel;
public class BaseDialog extends JDialog
{
private JPanel pLayer = null;
private JPanel pControls = null;
private JPanel pButtons = null;
public BaseDialog()
{
super();
initialize();
}
private void initialize()
{
this.setTitle("Base dlg");
this.setSize(300, 300);
this.setContentPane(this.getPnlLayer());
}
private JPanel getPnlLayer()
{
if (pLayer == null)
{
pLayer = new JPanel();
pLayer.setLayout(new BorderLayout());
pLayer.add(this.getPnlControls(), BorderLayout.CENTER);
pLayer.add(this.getPnlButtons(), BorderLayout.SOUTH);
}
return pLayer;
}
protected JPanel getPnlControls()
{
if (pControls == null)
{
pControls = new JPanel();
pControls.setBackground(Color.RED);
}
return pControls;
}
protected JPanel getPnlButtons()
{
if (pButtons == null)
{
pButtons = new JPanel();
pButtons.setBackground(Color.BLUE);
pButtons.setPreferredSize(new Dimension(0, 32));
}
return pButtons;
}
public static void main(String[] args)
{
BaseDialog aDlg = new BaseDialog();
aDlg.setModal(true);
aDlg.setVisible(true);
System.exit(0);
}
-------------------- Sample dlg code --------------
package test.ve;
public class SampleDialog extends BaseDialog
{
public SampleDialog()
{
super();
initialize();
}
private void initialize()
{
this.setTitle("Sample dlg");
initialize();
}
public static void main(String[] args)
{
SampleDialog aDlg = new SampleDialog();
aDlg.setModal(true);
aDlg.setVisible(true);
System.exit(0);
}
}
}
With best regards, Alexey Kuznetsov. E-mail: kuaw26@mail.ru
|
|
|
|
Re: It is possible to develop visual classes that are descendants from my base classes? [message #129762 is a reply to message #129643] |
Thu, 10 August 2006 06:33  |
Eclipse User |
|
|
|
Originally posted by: f-l.gmx.net
The simple solution we're using is to provide the basic dialog structure
with panels as initial source code for the VE.
Thus, the SampleDialog wouldn't extend BaseDialog (but Dialog), and instead
it would be initially populated with some code which more or less makes it
look like the BaseDialog. Now all panels are accessible.
As far as I've understood, since the initial component structure is
accessible in its entirety by the VE, nobody can keep the user from changing
this given structure by deleting panels or moving them... so it's more a
code template than a subclassed (and monolithic) component.
- Fedor
"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> schrieb im Newsbeitrag
news:eb7jg8$s1d$2@utils.eclipse.org...
> Not really. There is the problem of the existing controls on the base
> panels. When subclassing we don't know about these controls and so the
> layouts get messed up, and there could also be some exceptions.
>
> This is something we want to do but couldn't get to.
>
> --
> Thanks,
> Rich Kulp
|
|
|
|
Re: It is possible to develop visual classes that are descendants from my base classes? [message #613751 is a reply to message #129643] |
Thu, 10 August 2006 06:33  |
Eclipse User |
|
|
|
Originally posted by: f-l.gmx.net
The simple solution we're using is to provide the basic dialog structure
with panels as initial source code for the VE.
Thus, the SampleDialog wouldn't extend BaseDialog (but Dialog), and instead
it would be initially populated with some code which more or less makes it
look like the BaseDialog. Now all panels are accessible.
As far as I've understood, since the initial component structure is
accessible in its entirety by the VE, nobody can keep the user from changing
this given structure by deleting panels or moving them... so it's more a
code template than a subclassed (and monolithic) component.
- Fedor
"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> schrieb im Newsbeitrag
news:eb7jg8$s1d$2@utils.eclipse.org...
> Not really. There is the problem of the existing controls on the base
> panels. When subclassing we don't know about these controls and so the
> layouts get messed up, and there could also be some exceptions.
>
> This is something we want to do but couldn't get to.
>
> --
> Thanks,
> Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03242 seconds