| Summary: | No way to notify listeners when expand ExpandableComposite programmatically | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Viatcheslav Sysoltsev <Viatcheslav.Sysoltsev> |
| Component: | User Assistance | Assignee: | platform-ua-inbox <platform-ua-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, jaime.barragan, remy.suen |
| Version: | 4.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | stalebug | ||
|
Description
Viatcheslav Sysoltsev
Little demo program with ExpandableComposite and button to expand it:
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
public class tmp
{
Display display = new Display();
Shell shell = new Shell(display, SWT.CLOSE);
public tmp()
{
shell.setLayout(new GridLayout(2, false));
final ExpandableComposite label = new ExpandableComposite(shell, SWT.NULL);
label.setText("Title");
label.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e)
{
System.out.println("Listener notified");
}
});
Button btn = new Button(shell, SWT.NONE);
btn.setText("Expand");
btn.addSelectionListener(new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
label.setExpanded(!label.isExpanded());
}
});
shell.pack();
shell.open();
// Set up the event loop.
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
// If no more entries in event queue
display.sleep();
}
}
display.dispose();
}
public static void main(String[] args)
{
new tmp();
}
}
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag. I am getting the same problem with Eclipse RCP 2020-03, I have tried the demo code that is in the but the sout that is in the expansionStateChanged method is never printed, the only signal is the label icon changes. |