SWT Section can have focus [message #735699] |
Wed, 12 October 2011 10:56 |
Eclipse User |
|
|
|
I have created a section in my project..
If section got focus i have to write some code.
If section lost focus i have to write some other code.
My Code :
FormToolkit toolkit = new FormToolkit(display);
Section section = toolkit.createSection(shell, Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
section.setText("This is the title");
section.setDescription("-= This is a description -=");
Composite sectionComposite = toolkit.createComposite(section);
sectionComposite.setLayout(new GridLayout(2, false));
section.addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
System.err.println("Section is focused lost");
}
@Override
public void focusGained(FocusEvent e) {
System.err.println("Section is focused");
}
});
section.setClient(sectionComposite);
When running this code i couldnt find focusgain or focuslost for section...
whether section will have focus?
|
|
|
Powered by
FUDForum. Page generated in 0.23583 seconds