Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Examples » SWT Section can have focus(SWT Section can have focus)
SWT Section can have focus [message #735699] Wed, 12 October 2011 14:56
R.Murali Missing name is currently offline R.Murali Missing nameFriend
Messages: 30
Registered: November 2010
Member
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?
Previous Topic:Server Adapter for Orion Server
Next Topic:How to work with certificates in Eclipse?
Goto Forum:
  


Current Time: Fri Nov 28 08:53:23 GMT 2014

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

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