|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectza.co.bluesphere.sens.internal.ui.Policy
public class Policy
Internationlization convience methods, with specific help for actions and monitors.
The following binding methods are of interest:
Example use:
label.setText( Policy.bind( "SearchView.searchLabel" );
label.setTooltipText( Policy.bind( "SearchView.searchTooltip" );
With the following entires in messages.properties:
SearchView.searchLabel=Search: Searchview.searchTooltip=Search for diagram
Please visit initAction for more details on how to set up message.properties for effective use of Actions.
You can use the Source > ExternalizeStrings wizard targeted against this class with the following settings:
Your plug-in needs to call the Policy lifecycle methods:
| Field Summary | |
|---|---|
protected static java.util.ResourceBundle |
bundle
The resource bundle to get strings from. |
| Constructor Summary | |
|---|---|
Policy()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
bind(java.lang.String key)
Gets a string from the resource bundle. |
static java.lang.String |
bind(java.lang.String id,
java.lang.Object binding)
Lookup the message with the given ID in this catalog and bind its substitution locations with the given string. |
static java.lang.String |
bind(java.lang.String key,
java.lang.Object[] args)
Gets a string from the resource bundle and binds it with the given arguments. |
static java.lang.String |
bind(java.lang.String id,
java.lang.Object binding1,
java.lang.Object binding2)
Lookup the message with the given ID in this catalog and bind its substitution locations with the given strings. |
static java.lang.String |
bind(java.lang.String id,
java.lang.Object binding1,
java.lang.Object binding2,
java.lang.Object binding3)
Lookup the message with the given ID in this catalog and bind its substitution locations with the given strings. |
static java.lang.String |
bind(java.lang.String key,
java.util.ResourceBundle b)
Gets a string from the resource bundle. |
static void |
checkCanceled(org.eclipse.core.runtime.IProgressMonitor monitor)
Checks if the progress monitor is canceled. |
static void |
cleanup()
TODO summary sentence for cleanup ... |
static java.util.ResourceBundle |
getBundle()
Gets a ResourceBundle. |
static void |
initAction(org.eclipse.jface.action.IAction a,
java.lang.String id)
Initialize the given Action from a ResourceBundle. |
static void |
localize(java.lang.String bundleName)
Creates a NLS catalog for the given locale. |
static org.eclipse.core.runtime.IProgressMonitor |
monitorFor(org.eclipse.core.runtime.IProgressMonitor monitor)
Returns a monitor for the given monitor |
static org.eclipse.core.runtime.IProgressMonitor |
subMonitorFor(org.eclipse.core.runtime.IProgressMonitor monitor,
int ticks)
Sets up IProgressMonitor for the current locale. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.util.ResourceBundle bundle
| Constructor Detail |
|---|
public Policy()
| Method Detail |
|---|
public static void localize(java.lang.String bundleName)
bundleName - the name of the bundlepublic static void cleanup()
public static java.lang.String bind(java.lang.String id,
java.lang.Object binding)
id - the id to look upbinding - the string to bind to the result
public static java.lang.String bind(java.lang.String id,
java.lang.Object binding1,
java.lang.Object binding2)
id - the id to look upbinding1 - the first string to bind to the resultbinding2 - the second string to bind to the result
public static java.lang.String bind(java.lang.String id,
java.lang.Object binding1,
java.lang.Object binding2,
java.lang.Object binding3)
id - the id to look upbinding1 - the first string to bind to the resultbinding2 - the second string to bind to the resultbinding3 - the third string to bind to the result
public static java.lang.String bind(java.lang.String key,
java.util.ResourceBundle b)
key - the id to look upb - the ResourceBundle to get the key from.
public static java.lang.String bind(java.lang.String key)
key - the id to look up
public static java.lang.String bind(java.lang.String key,
java.lang.Object[] args)
key - the id to look upargs - the strings to bind to the result
public static void initAction(org.eclipse.jface.action.IAction a,
java.lang.String id)
Makes use of the following keys:
Note: The use of a single image value is mapped to images for both the enabled and distabled state of the IAction. the Local toolbar (elcl16/ and dlcl16/) is assumed if a path has not been provided.
add_co.gif (prefix.image)
enabled: elcl16/add_co.gif
disabled: dlcl/remove_co.gif
tool16/discovery_wiz.16 (prefix.image)
enabled: etool16/discovery_wiz.16
disabled: etool16/discovery_wiz.16
a - id - public static void checkCanceled(org.eclipse.core.runtime.IProgressMonitor monitor)
monitor - the monitor to check for cancellation
org.eclipse.core.runtime.OperationCanceledException - if the monitor is canceledpublic static org.eclipse.core.runtime.IProgressMonitor monitorFor(org.eclipse.core.runtime.IProgressMonitor monitor)
monitor - the monitor to return a monitor for
public static org.eclipse.core.runtime.IProgressMonitor subMonitorFor(org.eclipse.core.runtime.IProgressMonitor monitor,
int ticks)
monitor - ticks -
public static java.util.ResourceBundle getBundle()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||