Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 294651

Summary: [ExpandBar] Event cannot be fired programatically
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Benjamin Muskalla CLA 2009-11-09 14:08:43 EST
The event dispatching is missing from the UntypedEventAdapter to delegate the untyped events to the typed listeners of the ExpandBar.

  public void testExpandListener() {
    RWTFixture.fakePhase( PhaseId.PROCESS_ACTION );
    Display display = new Display();
    Shell shell = new Shell( display );
    ExpandBar expandBar = new ExpandBar( shell, SWT.NONE );
    final StringBuffer log = new StringBuffer();
    ExpandListener expandListener = new ExpandListener() {

      public void itemCollapsed( ExpandEvent e ) {
        log.append( "collapsed" );
      }

      public void itemExpanded( ExpandEvent e ) {
        log.append( "expanded|" );
      }
    };
    expandBar.addExpandListener( expandListener );
    expandBar.notifyListeners( SWT.Expand, new Event() );
    assertEquals( "expanded|", log.toString() );
    expandBar.notifyListeners( SWT.Collapse, new Event() );
    assertEquals( "expanded|collapsed", log.toString() );
  }
Comment 1 RĂ¼diger Herrmann CLA 2009-11-10 06:36:55 EST
Fixed in CVS HEAD