Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » addListner to a extended Class
addListner to a extended Class [message #465164] Wed, 07 December 2005 12:10 Go to next message
Eclipse UserFriend
Originally posted by: bp.maximuss.dk

Hi,

Ill see if i an explain it so you can understand me (not that easy, im from
Denmark)

I have a Class that i extender (Class A) in another Class (Class B) and in
Class A i have a lot of widgets and i need to addListener to several
widgets in Class A from Class B. I need to use Class A from several places
in my application so i think if i extend it would be good idea, but that
requires that i can add listeners to my widgets in Class A from Class B

Regards from Denmark
Bjarne Pedersen
Re: addListner to a extended Class [message #465303 is a reply to message #465164] Thu, 08 December 2005 17:42 Go to previous message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
Uh, is this what you mean?

<pseudocode>
class A {
public A() {
init();
decorate();
}

protected Widget _one;
protected Widget _two;

protected abstract void decorate();
...;
}


class B extends A {
protected void decorate() {
_one.addFocusListener(new FocusAdapter() {
System.err.println("Hello to Danmark!");
});
}
...;
}
</pseudocode>

If so, there should be no problem; I do more or less the same all the time.

HTH,
Paul
Previous Topic:tableItem
Next Topic:How to add check option in cell of table (not in first column)
Goto Forum:
  


Current Time: Sat Dec 07 14:57:02 GMT 2024

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

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

Back to the top