RAP generally follows the rule “If it compiles, it works”. That means that all SWT API implemented in RWT is working within the requirements set by SWT. If an SWT feature is not implemented, the corresponding API is also missing. In some cases, SWT classes and methods are implemented as empty stubs in RWT to enable single-sourcing, but only where this is a valid implementation of the API. Examples are the Accessibility API or some SWT constants that are marked as HINT.
RWT also provides some additional features that are not part of SWT.
Partly, these are features related to web clients such as the browser history,
partly enhancements of SWT widgets such as the HTML markup support in widgets.
However, RWT does not add any new API to the classes adopted from SWT.
All RWT features are accessible by API in the package org.eclipse.rwt
.
Many of the additional features are activated using the widget's setData
method with a constant from the RWT
class as the key, for example
table.setData( RWT.MARKUP_ENABLED, Boolean.TRUE )
.
FileUpload
FileUpload
widget can be used. The widget looks like a
button and will open the filepicker dialog of the user's browser. After a file has been
selected, it can programmatically be send to any HTTP server.
ExternalBrowser
Label
, CLabel
, List
,
Tree
and Table
RWT.MARKUP_ENABLED
.
This may require a custom item height, which can be set using
RWT.CUSTOM_ITEM_HEIGHT
.
To achieve similar effects in SWT, the application would have to draw on the widget using a
PaintListener
, which is not supported in RWT except on Canvas.
Tree
and Table
RWT.FIXED_COLUMNS
, it is possible to exclude any number of leftmost
columns from scrolling, so that they always stick on the left border of the tree or table.
IBrowserHistory
RWT.getBrowserHistory()
to access it.
Note that there are known issues when using the browser history and the Browser
widget in the same application.
ISettingsStore
, IApplicationStore
,
ISessionStore
, IServiceStore
, SessionSingletonBase
StyledText
, Tracker
, TaskBar
, Tray
GC
, Canvas
and
PaintListener
Canvas
widget.
In some cases the drawText
, drawString
and drawImage
methods may disregard the drawing order and overlap elements that are drawn later.
Some methods are unimplemented, including copyArea
, drawPath
,
setClipping
, setTransform
, setInterpolation
setLineDash
and setXORMode
.
Performance and results of a drawing operations can differ depending on the browser.
Dialog
, ColorDialog
, FontDialog
, MessageBox
DialogUtil
.
Browser
Browser
widget is based on the HTML iframe element,
all security restrictions regarding cross-frame-scripting apply. This means for
execute()
, evaluate()
and BrowserFunction
to work,
the document loaded in the Browser
widget has to come from the
same domain and port that the RAP application is loaded from. This is automatically given
if the setText
method is used.
executeScript
and evaluate
methods will not block program
execution.
Like with dialogs, a workaround is possible using the class
BrowserUtil
.
MouseEvent
and KeyEvent
Mouse and Key Event Handling in RAP.
ModifyEvent
,
VerifyEvent
VerifyEvent
fields text
, start
and end
currently always report the entire text to have changed.
The ClientScripting was
created specifically to provide an alternative.
DragSourceEvent
, DropTargetEvent
DragSourceEvent
, the fields image
, offsetX
and
offsetY
have no effect. DropTargetEvent
s may be omitted while the
mouse cursor is still in motion.
Display
Display#syncExec()
or Display#asyncExec()
from a
background-thread, the UI may not be updated immediately. This is due to the client-server
architecture of RAP, in which only the client can send requests to the server.
There is a solution for this provided by the class
UICallBack
.
Read more about it here.
Note that as of RAP 1.5, timerExec
does not require a UICallBack anymore
(it uses UICallBack internally).