Why VE calls actionPreformed Listeners? [message #547887] |
Tue, 20 July 2010 06:02 |
Eclipse User |
|
|
|
Originally posted by: fbondioli.autentiweb.com
Hi all,
I'm using eclipse 3.5.2 and VE 1.4 for design Swing applications.
I've noticed that VE often follows actionPerformed events linked to object and this produces very often unpredictable results.
For example in the code below, the method "inserisciNuovoCliente()" is called by the VE during setup and prevent it to display the frame correctly. If I comment
the call to inserisciNuovoCliente() the frame is displayed OK.
Is there a way to prevent this behaviour?
private JButton getBtInsNuovoCliente() {
if (btInsNuovoCliente == null) {
btInsNuovoCliente = new JButton();
btInsNuovoCliente.setText("Inserisci nuovo cliente");
btInsNuovoCliente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
new Thread() {
public void run() {
inserisciNuovoCliente();
}
}.start();
}
});
}
return btInsNuovoCliente;
}
private void inserisciNuovoCliente() {
Anagrafica cli = new Anagrafica();
cli.setCliente(true);
FrameSchedaAnagrafica fsa = new FrameSchedaAnagrafica(cli);
UIUtils.showModalInternalFrame(fsa, StoreClientGlobal.desktopPane, this);
cli = fsa.getAnagObject();
if (cli.getId() != null) {
try {
ddtObject.setDestinatario(cli);
detailPanel.toControl(txtFornitore);
//txtFornitore.setBoundValue(cli);
} catch (Exception e) {
e.printStackTrace();
}
}
StoreClientGlobal.desktopPane.remove(fsa);
fsa.dispose();
}
|
|
|
Re: Why VE calls actionPreformed Listeners? [message #547895 is a reply to message #547887] |
Tue, 20 July 2010 06:48 |
Eclipse User |
|
|
|
Originally posted by: fbondioli.autentiweb.com
Fabio B. ha scritto:
> Hi all,
> I'm using eclipse 3.5.2 and VE 1.4 for design Swing applications.
>
> I've noticed that VE often follows actionPerformed events linked to
> object and this produces very often unpredictable results.
> For example in the code below, the method "inserisciNuovoCliente()" is
> called by the VE during setup and prevent it to display the frame
> correctly. If I comment the call to inserisciNuovoCliente() the frame is
> displayed OK.
>
> Is there a way to prevent this behaviour?
>
> private JButton getBtInsNuovoCliente() {
> if (btInsNuovoCliente == null) {
> btInsNuovoCliente = new JButton();
> btInsNuovoCliente.setText("Inserisci nuovo cliente");
> btInsNuovoCliente.addActionListener(new
> java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> new Thread() {
> public void run() {
> inserisciNuovoCliente();
> }
> }.start();
> }
> });
> }
> return btInsNuovoCliente;
> }
>
> private void inserisciNuovoCliente() {
> Anagrafica cli = new Anagrafica();
> cli.setCliente(true);
> FrameSchedaAnagrafica fsa = new FrameSchedaAnagrafica(cli);
> UIUtils.showModalInternalFrame(fsa, StoreClientGlobal.desktopPane,
> this);
> cli = fsa.getAnagObject();
> if (cli.getId() != null) {
> try {
> ddtObject.setDestinatario(cli);
> detailPanel.toControl(txtFornitore);
> //txtFornitore.setBoundValue(cli);
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> StoreClientGlobal.desktopPane.remove(fsa);
> fsa.dispose();
> }
I've investigated any further and discovered that VE doesn't follows the actionPerformed events but simply try to parse the private inserisciNuovoCliente() method
the problem is that VE try to create a model for the FrameSchedaAnagrafica object that is a VisualObject (it extends JInternalFrame) and something goes wrong.
I've tried adding the VE annotation comment to the declaration of the fsa object without success:
....
FrameSchedaAnagrafica fsa = null; // @jve:
fsa = new FrameSchedaAnagrafica(cli);
....
From the info I've found googling, this annotation should tell VE not to create a model for my fsa object and not to try to visualize it, but it seems it
doesn't work.
Is there anything else I can try?
Regards
Fabio B.
|
|
|
Re: Why VE calls actionPreformed Listeners? [message #618419 is a reply to message #547887] |
Tue, 20 July 2010 06:48 |
Eclipse User |
|
|
|
Originally posted by: fbondioli.autentiweb.com
Fabio B. ha scritto:
> Hi all,
> I'm using eclipse 3.5.2 and VE 1.4 for design Swing applications.
>
> I've noticed that VE often follows actionPerformed events linked to
> object and this produces very often unpredictable results.
> For example in the code below, the method "inserisciNuovoCliente()" is
> called by the VE during setup and prevent it to display the frame
> correctly. If I comment the call to inserisciNuovoCliente() the frame is
> displayed OK.
>
> Is there a way to prevent this behaviour?
>
> private JButton getBtInsNuovoCliente() {
> if (btInsNuovoCliente == null) {
> btInsNuovoCliente = new JButton();
> btInsNuovoCliente.setText("Inserisci nuovo cliente");
> btInsNuovoCliente.addActionListener(new
> java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent e) {
> new Thread() {
> public void run() {
> inserisciNuovoCliente();
> }
> }.start();
> }
> });
> }
> return btInsNuovoCliente;
> }
>
> private void inserisciNuovoCliente() {
> Anagrafica cli = new Anagrafica();
> cli.setCliente(true);
> FrameSchedaAnagrafica fsa = new FrameSchedaAnagrafica(cli);
> UIUtils.showModalInternalFrame(fsa, StoreClientGlobal.desktopPane,
> this);
> cli = fsa.getAnagObject();
> if (cli.getId() != null) {
> try {
> ddtObject.setDestinatario(cli);
> detailPanel.toControl(txtFornitore);
> //txtFornitore.setBoundValue(cli);
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> StoreClientGlobal.desktopPane.remove(fsa);
> fsa.dispose();
> }
I've investigated any further and discovered that VE doesn't follows the actionPerformed events but simply try to parse the private inserisciNuovoCliente() method
the problem is that VE try to create a model for the FrameSchedaAnagrafica object that is a VisualObject (it extends JInternalFrame) and something goes wrong.
I've tried adding the VE annotation comment to the declaration of the fsa object without success:
....
FrameSchedaAnagrafica fsa = null; // @jve:
fsa = new FrameSchedaAnagrafica(cli);
....
From the info I've found googling, this annotation should tell VE not to create a model for my fsa object and not to try to visualize it, but it seems it
doesn't work.
Is there anything else I can try?
Regards
Fabio B.
|
|
|
Powered by
FUDForum. Page generated in 0.02990 seconds