|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rwt.RWT
public final class RWT
This class provides access to aspects of RWT which are not
part of the SWT API as RAP needs some additions regarding
the server and client communication. It is responsible for
providing access to the ISessionStore
and the
HttpServletRequest
.
ILifeCycle
,
ISessionStore
,
IServiceStore
,
IApplicationStore
,
IBrowserHistory
,
IResourceManager
,
HttpServletRequest
,
HttpServletResponse
Nested Class Summary | |
---|---|
static class |
RWT.NLS
This utility class helps to provide a similar approach for compile safe native language support than NLS does. |
Field Summary | |
---|---|
static java.lang.String |
ACTIVE_KEYS
The property to use in Display.setData() in order to activate global key events
for certain key sequences. |
static java.lang.String |
CANCEL_KEYS
The property to use in Display.setData() in order to always cancel the client's
default operation associated with certain key sequences. |
static java.lang.String |
CUSTOM_ITEM_HEIGHT
The property to use in Control.setData() in order to set a custom item height. |
static java.lang.String |
DEFAULT_THEME_ID
The ID of the default theme. |
static java.lang.String |
FIXED_COLUMNS
Controls the number of fixed columns. |
static java.lang.String |
MARKUP_ENABLED
Controls whether the use of markup in text is enabled. |
Method Summary | |
---|---|
static IApplicationStore |
getApplicationStore()
Returns the IApplicationStore instance that represents the web context's
global data storage area. |
static IBrowserHistory |
getBrowserHistory()
Returns an instance if IBrowserHistory that provides support
for the browser's history. |
static ILifeCycle |
getLifeCycle()
Returns the instance of the life cycle which is currently processed. |
static java.util.Locale |
getLocale()
Returns the preferred Locale that the client will accept
content in. |
static HttpServletRequest |
getRequest()
Returns the HttpServletRequest that is currently processed. |
static IResourceManager |
getResourceManager()
Returns the instance of the currently available IResourceManager |
static HttpServletResponse |
getResponse()
Returns the HttpServletResponse that is mapped
to the currently processed request. |
static IServiceManager |
getServiceManager()
Returns a manager to add and remove IServiceHandler s. |
static IServiceStore |
getServiceStore()
Returns the IServiceStore that is mapped
to the currently processed request. |
static ISessionStore |
getSessionStore()
Returns the ISessionStore of the HttpSession
to which the currently processed request belongs. |
static ISettingStore |
getSettingStore()
Returns the setting store instance for this session. |
static void |
requestThreadExec(java.lang.Runnable runnable)
Executes the run method of the given runnable on the
request thread. |
static void |
setLocale(java.util.Locale locale)
Sets the preferred Locale that the client will accept
content in to current session. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ACTIVE_KEYS
Display.setData()
in order to activate global key events
for certain key sequences. The value for this property has to be an array of Strings, each
representing a key sequence. When this property is set on the display, the client will be
instructed to issue events for the given key sequences. These key events can be captured using
Display.addFilter()
.
The property can also be used in Control.setData()
. In this case, a key listener
that is attached to that control will only receive events for the specified key sequences.
Control without active keys set will issue events for all key strokes.
Valid strings for key sequences consist of one key and any number of modifier keys,
separated by +
. Keys can be identified by their character or by any of the
keywords below. Special characters (not a letter or digit) should not be combined with any
modifiers, and will issue events regardless of pressed modifiers.
The following keywords can be used to refer to special keys:
BACKSPACE
, TAB
, RETURN
,
ENTER
, ESCAPE
, SPACE
, PAGE_UP
,
PAGE_DOWN
, END
, HOME
, ARROW_LEFT
,
ARROW_UP
, ARROW_RIGHT
, ARROW_DOWN
, INSERT
,
DELETE
, F1
, F2
, F3
, F4
,
F5
, F6
, F7
, F8
, F9
,
F10
, F11
, F12
, Valid modifier keys are
SHIFT
, ALT
, and CTRL
.
"A"
, "#"
, "F12"
,
"CTRL+1"
, "ALT+ARROW_DOWN"
,
"ALT+SHIFT+X"
.
Example code for implementing a key binding:
display.setData( RWT.ACTIVE_KEYS, new String[] { "CTRL+1", "CTRL+2" } );
display.addFilter( SWT.KeyDown, new Listener() {
public void handleEvent( Event event ) {
boolean ctrlPressed = ( event.stateMask & SWT.Ctrl ) != 0;
if( ctrlPressed && event.character == '1' ) {
// handle Ctrl+1
}
}
} );
Display.setData(String,Object)
,
Display.addFilter(int, Listener)
,
CANCEL_KEYS
,
Constant Field Valuespublic static final java.lang.String CANCEL_KEYS
Display.setData()
in order to always cancel the client's
default operation associated with certain key sequences. It allows the same values as
ACTIVE_KEYS
. If a key sequences is given in CANCEL_KEYS
as well as
in ACTIVE_KEYS
, it will cancel its default operation, but still issue the event.
The property can also be used in Control.setData()
. In this case, the associated
default operation will only be cancelled if the control is focused.
Depending on the client, there may be certain keys that cannot be cancelled.
Display.setData(String,Object)
,
ACTIVE_KEYS
,
Constant Field Valuespublic static final java.lang.String CUSTOM_ITEM_HEIGHT
Control.setData()
in order to set a custom item height.
The custom item height must be specified as an Integer
and passed to
setData()
with this constant as the key.
For example:
table.setData( RWT.CUSTOM_ITEM_HEIGHT, new Integer( 45 ) );
Used By:
Table
Tree
List
Widget.setData(String,Object)
,
Constant Field Valuespublic static final java.lang.String MARKUP_ENABLED
setData()
with
a value of Boolean.TRUE
. The call to setData()
must be placed directly after the control is created. Once, the markup in text
is enabled it's not possible to disable it.
For example:
Table table = new Table( parent, SWT.NONE );
table.setData( RWT.MARKUP_ENABLED, Boolean.TRUE );
When markup is enabled, certain XHTML tags can be used in the text property
of the respective widget. Specifying an unsupported element will lead to an
IllegalArgumentException
when setting the text. The following table
lists the currently supported tags:
style
attribute.
Used By:
Table
Tree
List
Label
CLabel
Widget.setData(String,Object)
,
Constant Field Valuespublic static final java.lang.String FIXED_COLUMNS
setData()
together with an Integer
object. The given number of columns, starting
with the current leftmost one, will not scroll horizontally. The call to setData()
must be placed directly after the control is created.
For example:
Table table = new Table( parent, SWT.NONE );
table.setData( RWT.FIXED_COLUMNS, new Integer( 2 ) );
Table
Widget.setData(String,Object)
,
Constant Field Valuespublic static final java.lang.String DEFAULT_THEME_ID
Application.addStyleSheet(String, String)
,
Constant Field ValuesMethod Detail |
---|
public static ILifeCycle getLifeCycle()
ILifeCycle
public static IResourceManager getResourceManager()
IResourceManager
IResourceManager
public static IServiceManager getServiceManager()
IServiceHandler
s.
IServiceManager
public static ISettingStore getSettingStore()
ISettingStore
; never null
public static IServiceStore getServiceStore()
IServiceStore
that is mapped
to the currently processed request.
IServiceStore
public static ISessionStore getSessionStore()
ISessionStore
of the HttpSession
to which the currently processed request belongs.
ISessionStore
public static IApplicationStore getApplicationStore()
IApplicationStore
instance that represents the web context's
global data storage area.
IApplicationStore
public static HttpServletRequest getRequest()
HttpServletRequest
that is currently processed.
Typical application code rarely needs to call this method. It is meant mainly for service handlers obtain parameters of the request to process.
HttpServletRequest
IServiceHandler
public static HttpServletResponse getResponse()
HttpServletResponse
that is mapped
to the currently processed request.
Typical application code never needs to call this method. It is meant only for service handlers to be able to write output and control other aspects of the response. Calling this method from a UI request (e.g. in an SWT event listener) is almost certainly an error.
HttpServletResponse
IServiceHandler
public static java.util.Locale getLocale()
Locale
that the client will accept
content in. This is either the Locale
that was set in
session-scope using the setLocale(Locale)
method or the locale
based on the Accept-Language
HTTP header of the current
request. If neither the Locale
was set programmatically, nor
the client request provides an Accept-Language
header, this
method returns the default locale for the server.
Locale
for the client.setLocale(Locale)
public static void setLocale(java.util.Locale locale)
Locale
that the client will accept
content in to current session. The value set can be retrieved with
the getLocale()
method.
getLocale()
public static IBrowserHistory getBrowserHistory()
IBrowserHistory
that provides support
for the browser's history.
IBrowserHistory
public static void requestThreadExec(java.lang.Runnable runnable)
runnable
on the
request thread. This method may only be called from the UI thread.
NOTE: This API is provisional and may change without further notice.
runnable
- the code to be executed on the request thread
SWTException
-
|
Eclipse Rich Ajax Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.