Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » When to fire widget events?
When to fire widget events? [message #1227422] Sat, 04 January 2014 12:48 Go to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 165
Registered: July 2009
Senior Member
I tried to modify your ckeditor example to fire a "modify" event, that I use later in the databinding context to set the (Workbench-)editor dirty. The SaveAction gets setEnabled(true) but it seems somehow at the wrong time in the whole lifecycle, as this never gets rendered.

I tried to fire the event from my OperationHandler
private final OperationHandler operationHandler = new AbstractOperationHandler() {
    @Override
    public void handleSet( JsonObject properties ) {
      JsonValue textValue = properties.get( "text" );
      if( textValue != null ) {
    	String oldText = text;  
        text = textValue.asString();
        if(!text.equals(oldText)){
        	Event e = new Event();
			e.type = SWT.Modify;
			e.data = CKEditor.this.text;
			e.widget = CKEditor.this;
			for (Listener l : CKEditor.this.listeners ) {
				l.handleEvent(e);
			}
        }
      }
    }
  };


Any ideas why this doesn't play nice with the workbench?

Cheers
Thomas
Re: When to fire widget events? [message #1227736 is a reply to message #1227422] Sun, 05 January 2014 11:48 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Thomas,

you should use

CKEditor.this.notifyListeners(SWT.Modify, event);

instead. Does that help?

Cheers,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: When to fire widget events? [message #1227740 is a reply to message #1227736] Sun, 05 January 2014 12:00 Go to previous message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 165
Registered: July 2009
Senior Member
Thanks Ralf,

thats what I needed.

Now I only need to figure out how I get the CKEditor to trigger the send when changed.

Regards Thomas
Previous Topic:Radio Buttons not visible
Next Topic:How do you pass parameters to the factory method of a custom widget
Goto Forum:
  


Current Time: Thu Apr 25 04:47:40 GMT 2024

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

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

Back to the top