Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7493153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:46:42+00:00 2026-05-29T16:46:42+00:00

I’m developing an application based on RCP. Recently, I have moved it to RAP.

  • 0

I’m developing an application based on RCP. Recently, I have moved it to RAP. Before, I used some untyped events in RCP to pass some necessary data for different purposes.
For example, I have a button called “Get Data” to get data from server. I have some tableviewer to hold data that were received from server.When user click this button, I want to raise an event, and in each table will listen that event. I did as following:

//Part 1

Button btgetData=new Button(compositeLabels,SWT.PUSH);
        btgetData.setText("Get Data");
        btgetData.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                //raise event here
                Event event =new Event();
                event.detail=12345;
            getRoot().getShell().notifyListeners(MYEVENTCONST, event);
            }           
        });

//Part 2: 
//In each composite that hold TableViewer , listen event

getShell().addListener(MYEVENTCONST, new Listener() 
            public void handleEvent(Event event) {
      if(event.detail==12345)
              doProcessing();               
        });

In RCP, each TableViewer listen normally that event each time user click button “Get Data”. But it didn’t work on RAP, I don’t know if RAP already supported this kind of untyped events. The function doProcessing() is never called :(.

I don’t want to change the way when passing data. Please let me know if I could keep going in the old way. I greatly appreciate for any comment.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:46:43+00:00Added an answer on May 29, 2026 at 4:46 pm

    Custom event types are currently not supported in RAP (mostly because of bug 334028).

    However, although you can do that in SWT, I would consider this a misuse of SWT Events. It might be acceptable for a custom widget, but these methods are reserved for events on the widget level while you use them on application level. Also, the JavaDoc of Widget#notifyListeners() and Widget#addListener() clearly states:

    The event type is one of the event constants defined in class SWT.

    Instead of using a custom event, you can let your composites implement a custom interface:

    public interface ProcessingControl {
    
      void doProcessing();
    
    }
    

    and define an update method that recursively traverses the children of a composite:

    static void updateChildren( Composite parent ) {
      for( Control child : parent.getChildren() ) {
        if( child instanceof ProcessingControl ) {
          ( ( ProcessingControl )child ).doProcessing();
        }
        if( child instanceof Composite ) {
          updateChildren( ( Composite )child );
        }
      }
    }
    

    Then you can call updateChildren( shell );.

    If you prefer to use events and listeners, you should use java.util.EventObject and EventListener for your purpose.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.