Best way to incorporate an existing visual class in another window [message #126998] |
Sat, 24 June 2006 01:48 |
Eclipse User |
|
|
|
Originally posted by: harel.ben-attia.comverse.com
Hi all,
i have a visual class which is working on its own as modeless window. The
application will have several instances of this visual class running
simultanously.
I'm currently trying to make this visual class a part of a "main" window in
order to reduce screen clutter (The main window will contain some kind of
tree structure and selecting a node will display the data that belongs to it
on another part of the main window).
I wanted to know whether there is a way to "integrate" the already-made
visual class to a composite in the main window. I'm trying to avoid
integrating the classes themselves into one visual class. There are two
reasons for this: 1. Separation of concerns 2. The visual class is already
written and tested.
I would appreciate any insight u might have regarding this issue.
Thanks a lot
RL
|
|
|
Re: Best way to incorporate an existing visual class in another window [message #127035 is a reply to message #126998] |
Mon, 26 June 2006 14:04 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You didn't say if this was SWT or AWT/Swing.
A modeless window is a separate window. It cannot be included physically
within another window. That is the way SWT and Swing work. A window is
separate. It is actually nothing more nor less than a Frame (Shell)
without a titlebar or frame around it.
You would instead need to take the contents of your modeless window
classes and put them in a subclass of JPanel (Composite). In that case
these classes can then be used in another class later on.
--
Thanks,
Rich Kulp
|
|
|
Re: Best way to incorporate an existing visual class in another window [message #127995 is a reply to message #127035] |
Sat, 08 July 2006 09:58 |
Eclipse User |
|
|
|
Originally posted by: harel.ben-attia.comverse.com
Hi Rich,
Is it possible to manually modify my visual class to inherit from Composite
instead of inheriting from Shell in order to achieve that ? I would like to
"transfer" my window to become part of another one, without the need to
rewrite anything (and i would also like to be able to edit them separately
and "combine" them only at runtime). Does VE allow me to do this manually,
or has any feature to convert a shell window to a composite ?
There are several problems about copying and pasting the components from one
window to another:
1. It can be done only for composites/groups (i cannot copy components which
are not part of a composite/group)
2. The component names are not saved between the source and target (possibly
a feature you might add in the future?)
3. I need to copy/paste my own private methods to the second visual class.
This, of course, can't be solved by VE itself, but i think that not being
able to perform this "separation of concern" causes the visual classes to
become more complex than they should (and cause other parsing errors...).
I would appreciate any comments u might have on this
Thanks a lot for the replies and your concern.
RL
"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:e7opij$844$1@utils.eclipse.org...
> You didn't say if this was SWT or AWT/Swing.
>
> A modeless window is a separate window. It cannot be included physically
> within another window. That is the way SWT and Swing work. A window is
> separate. It is actually nothing more nor less than a Frame (Shell)
> without a titlebar or frame around it.
>
> You would instead need to take the contents of your modeless window
> classes and put them in a subclass of JPanel (Composite). In that case
> these classes can then be used in another class later on.
>
> --
> Thanks,
> Rich Kulp
|
|
|
Re: Best way to incorporate an existing visual class in another window [message #128174 is a reply to message #127995] |
Mon, 10 July 2006 14:29 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
There is no morphing code. You can do it by hand by changing the parent
class to composite, out the
public YourClass(Composite parent, int style) {
initialize();
}
constructor in, and move the stuff from createComposite to the
initialize method. And clean up any syntax errors. This should do it.
--
Thanks,
Rich Kulp
|
|
|
Re: Best way to incorporate an existing visual class in another window [message #613412 is a reply to message #126998] |
Mon, 26 June 2006 14:04 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You didn't say if this was SWT or AWT/Swing.
A modeless window is a separate window. It cannot be included physically
within another window. That is the way SWT and Swing work. A window is
separate. It is actually nothing more nor less than a Frame (Shell)
without a titlebar or frame around it.
You would instead need to take the contents of your modeless window
classes and put them in a subclass of JPanel (Composite). In that case
these classes can then be used in another class later on.
--
Thanks,
Rich Kulp
|
|
|
|
Re: Best way to incorporate an existing visual class in another window [message #613495 is a reply to message #127995] |
Mon, 10 July 2006 14:29 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
There is no morphing code. You can do it by hand by changing the parent
class to composite, out the
public YourClass(Composite parent, int style) {
initialize();
}
constructor in, and move the stuff from createComposite to the
initialize method. And clean up any syntax errors. This should do it.
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03439 seconds