Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "5 Display"

Line 33: Line 33:
 
Will be implemented.
 
Will be implemented.
  
===Event Filters.===
+
===Event Filters===
 
Not yet implemented. Quote SWT book: "Filters are Powerful and Dangerous".
 
Not yet implemented. Quote SWT book: "Filters are Powerful and Dangerous".
 
One of the standard use cases for event filtering - large numbers of events - are not a good idea for RWT because of the distributed nature of RAP (and associated network latency).
 
One of the standard use cases for event filtering - large numbers of events - are not a good idea for RWT because of the distributed nature of RAP (and associated network latency).
  
===Runnable "Execs".===
+
===Runnable "Execs"===
 
Not yet implemented.  
 
Not yet implemented.  
  
===The Event Loop.===
+
===The Event Loop===
 
Not applicable. We have request / response cycles instead. Please see also the thread topic directly below.
 
Not applicable. We have request / response cycles instead. Please see also the thread topic directly below.
  
===Multithreaded Programming.===
+
===Multithreaded Programming===
 
Not yet implemented. The UI thread will be represented by the thread that services the browser (ajax) request.
 
Not yet implemented. The UI thread will be represented by the thread that services the browser (ajax) request.
  
Line 52: Line 52:
 
Threading requires extra care as we are executing them on a server!
 
Threading requires extra care as we are executing them on a server!
  
===Timers.===
+
===Timers===
 
Not yet implemented.
 
Not yet implemented.
  
===Putting It All Together: Multithreading, Timers, Events, and the Event Loop.===
+
===Putting It All Together: Multithreading, Timers, Events, and the Event Loop===
 
* Events are generated by the user and read and dispatched to widgets by the the thread that services the request.
 
* Events are generated by the user and read and dispatched to widgets by the the thread that services the request.
 
* Application code registers interest in events by adding event listeners to widgets. ...
 
* Application code registers interest in events by adding event listeners to widgets. ...
Line 62: Line 62:
 
* no timers yet ;-)
 
* no timers yet ;-)
  
===Monitors, Bounds, and Client Area.===
+
===Monitors, Bounds, and Client Area===
 
* Very likely no Monitors ...
 
* Very likely no Monitors ...
 
* Bounds / Client Area - implemented as the size of the browser window
 
* Bounds / Client Area - implemented as the size of the browser window
  
===The Active Shell, All Shells, and Focus Control.===
+
===The Active Shell, All Shells, and Focus Control===
 
Not yet implemented
 
Not yet implemented
  
===Cursor Control and Location.===
+
===Cursor Control and Location===
 +
Very unlikely to be implemented.
  
 +
===Display Depth and DPI===
 +
Sorry, but no;-)
  
===Display Depth and DPI.===
+
===Updating the Display===
 +
Updating the Display is not an issue in RWT. At the end of the request life cycle all changes are 'rendered' and sent to the client.
  
===Updating the Display.===
+
===Application Data===
 +
Not yet implemented, but will work as in SWT.
  
===Application Data.===
+
===Coordinate Mapping and Mirroring===
  
===Coordinate Mapping and Mirroring.===
+
===Miscellaneous===
 
+
===Miscellaneous.===
+

Revision as of 16:00, 8 January 2007

back to table of content

Display

The display creation in RWT is slightly different than in SWT. Instead of a main method RWT provides the IEntryPoint Interface in its createUI method. In this method you need to implement the creation of the display and the initial set of widgets to be displayed.

 public class Example implements IEntryPoint {
   public Display createUI() {
     Display display = new Display();
     final Shell shell = new Shell( display, RWT.NONE );
     shell.setBounds( 10, 10, 800, 600 );
   
     ToolBar toolBar = new ToolBar( shell, RWT.NONE );
     ToolItem item1 = new ToolItem( toolBar, RWT.PUSH );
   
     ...
   
     return display;
   }
 }

Naming Your Application

Not yet implemented. The HTML title could be used to mimic a minimal application naming.

Display Life Cycle

Similar, but the display lives as long as the browser session is active.

Events and Listeners

Will be implemented.

Event Filters

Not yet implemented. Quote SWT book: "Filters are Powerful and Dangerous". One of the standard use cases for event filtering - large numbers of events - are not a good idea for RWT because of the distributed nature of RAP (and associated network latency).

Runnable "Execs"

Not yet implemented.

The Event Loop

Not applicable. We have request / response cycles instead. Please see also the thread topic directly below.

Multithreaded Programming

Not yet implemented. The UI thread will be represented by the thread that services the browser (ajax) request.

Asynchonous execution requires some effort on the RWT side, as the client needs to be informed of UI changes. As http is a stateless protocol with request/response pushing of data is not intended by the creators of the protocol. There are two workarounds:

  • Polling (the client polls the server regulary while an async exec is running)
  • so called Comet - a http response is kept open / alive and can be used to push data to the browser. Latest developments in java servers promise to implement Comet with minimal overhead (Jetty, Glassfish).

Threading requires extra care as we are executing them on a server!

Timers

Not yet implemented.

Putting It All Together: Multithreading, Timers, Events, and the Event Loop

  • Events are generated by the user and read and dispatched to widgets by the the thread that services the request.
  • Application code registers interest in events by adding event listeners to widgets. ...
  • If the user interface thread is busy (in our case a request has not received its response) further events are queued (on the client side).
  • pushing UI updates to the user by calling a method like readAndDispatch() is not possible
  • no timers yet ;-)

Monitors, Bounds, and Client Area

  • Very likely no Monitors ...
  • Bounds / Client Area - implemented as the size of the browser window

The Active Shell, All Shells, and Focus Control

Not yet implemented

Cursor Control and Location

Very unlikely to be implemented.

Display Depth and DPI

Sorry, but no;-)

Updating the Display

Updating the Display is not an issue in RWT. At the end of the request life cycle all changes are 'rendered' and sent to the client.

Application Data

Not yet implemented, but will work as in SWT.

Coordinate Mapping and Mirroring

Miscellaneous

Back to the top