|
Eclipse Remote Application Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rap.rwt.RWT
public final class RWT
This class provides access to those parts of RWT which are not covered by the SWT API. For example, it provides access to the current UI session and the request.
ILifeCycle
,
UISession
,
ApplicationContext
,
ResourceManager
,
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 |
CUSTOM_VARIANT
Used to mark a widget as belonging to a custom variant in order to apply a different theming to it. |
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 int |
HYPERLINK
Used as extra detail information about the selection event. |
static java.lang.String |
MARKUP_ENABLED
Controls whether the use of markup in text is enabled. |
static java.lang.String |
MNEMONIC_ACTIVATOR
The property to use in Display.setData() in order to set the key combination for
mnemonics activation. |
Method Summary | |
---|---|
static ApplicationContext |
getApplicationContext()
Returns the ApplicationContext instance that represents the web context's
global data storage area. |
static ApplicationContext |
getApplicationStore()
Deprecated. Use getApplicationContext() instead. |
static BrowserNavigation |
getBrowserHistory()
Deprecated. use BrowserNavigation client service instead, see
Client.getService(Class) |
static Client |
getClient()
Returns a representation of the client that is connected with the server in the current UI session. |
static ILifeCycle |
getLifeCycle()
Deprecated. As of 2.0, PhaseListeners should only be registered in an ApplicationConfiguration . For new applications and custom widgets, consider
the RemoteObject API which is going to replace PhaseListener. |
static java.util.Locale |
getLocale()
Returns the preferred Locale for the current UI session. |
static HttpServletRequest |
getRequest()
Returns the HttpServletRequest that is currently processed. |
static ResourceManager |
getResourceManager()
Returns the instance of the resource manager for the current application context. |
static HttpServletResponse |
getResponse()
Returns the HttpServletResponse that will be sent to the client after processing
the current request. |
static ServiceManager |
getServiceManager()
Returns the instance of the service manager for the current application context. |
static IServiceStore |
getServiceStore()
Deprecated. The interface IServiceStore is deprecated and will be removed in a future
release without a replacement. If you need to store data in the scope of a request,
consider to use the request object (e.g.
HttpServletRequest#setAttribute(String, Object) ). |
static UISession |
getSessionStore()
Deprecated. Use getUISession() instead |
static SettingStore |
getSettingStore()
Returns the setting store instance for the current UI session. |
static UISession |
getUISession()
Returns the current UI session. |
static UISession |
getUISession(Display display)
Returns the UI session that is associated with the given display. |
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 for the current UI 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 upper case 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 MNEMONIC_ACTIVATOR
Display.setData()
in order to set the key combination for
mnemonics activation. The value for this property has to be a String.
Valid string for key sequence consist of any number of modifier keys, separated by
+
.
Mnemonics are currently supported by MenuItem
, Button
,
Label
, CLabel
, Group
, ToolItem
,
TabItem
and CTabItem
. Mnemonics are not supported on a widgets
with enabled markup.
Example code:
display.setData( RWT.MNEMONIC_ACTIVATOR, "ALT+CTRL" );
Display.setData(String,Object)
,
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)
,
HYPERLINK
,
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 Valuespublic static final java.lang.String CUSTOM_VARIANT
button.setData( RWT.CUSTOM_VARIANT, "mybutton" );For more information on custom variants, see the RAP help on theming.
Widget.setData(String,Object)
,
Constant Field Valuespublic static final int HYPERLINK
Used By:
Table
Tree
List
MARKUP_ENABLED
,
SelectionEvent.detail
,
SelectionEvent.text
,
Constant Field ValuesMethod Detail |
---|
@Deprecated public static ILifeCycle getLifeCycle()
ApplicationConfiguration
. For new applications and custom widgets, consider
the RemoteObject
API which is going to replace PhaseListener.
ILifeCycle
Application.addPhaseListener(PhaseListener)
public static ResourceManager getResourceManager()
RWT.getApplicationContext().getResourceManager()
.
ApplicationContext.getResourceManager()
public static ServiceManager getServiceManager()
RWT.getApplicationContext().getServiceManager()
.
ApplicationContext.getServiceManager()
public static SettingStore getSettingStore()
null
@Deprecated public static IServiceStore getServiceStore()
IServiceStore
is deprecated and will be removed in a future
release without a replacement. If you need to store data in the scope of a request,
consider to use the request object (e.g.
HttpServletRequest#setAttribute(String, Object)
).
getRequest()
public static UISession getUISession()
null
java.lang.IllegalStateException
- when called outside of the UI threadpublic static UISession getUISession(Display display)
null
@Deprecated public static UISession getSessionStore()
getUISession()
instead
public static ApplicationContext getApplicationContext()
ApplicationContext
instance that represents the web context's
global data storage area.
ApplicationContext
@Deprecated public static ApplicationContext getApplicationStore()
getApplicationContext()
instead.
public static HttpServletRequest getRequest()
HttpServletRequest
that is currently processed.
Note: This method is not recommended. Typical application code should not need to call this method. Processing requests from the client is up to the framework. In rare cases, an application may be wish to access request details such as certain HTTP headers.
public static HttpServletResponse getResponse()
HttpServletResponse
that will be sent to the client after processing
the current request.
Note: This method is not recommended. Typical application code should not need to call this method. The response should only be written and modified by the framework. In rare cases, an application may wish to access the response, e.g. to add a Cookie.
public static java.util.Locale getLocale()
Locale
for the current UI session.
This method is a shortcut for RWT.getUISession().getLocale()
.
Locale
for the current UI session.UISession.getLocale()
public static void setLocale(java.util.Locale locale)
Locale
for the current UI session. This method is a shortcut
for RWT.getUISession().setLocale( locale )
.
locale
- the locale to set, or null
to resetUISession.setLocale(Locale)
@Deprecated public static BrowserNavigation getBrowserHistory()
BrowserNavigation
client service instead, see
Client.getService(Class)
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
java.lang.IllegalStateException
- when called from a non-UI threadpublic static Client getClient()
RWT.getUISession().getClient()
.
java.lang.IllegalStateException
- when called outside of the request context
|
Eclipse Remote Application Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2013. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0