Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.common
Class ResourceUtils

java.lang.Object
  extended byoracle.jbo.common.ResourceUtils

public final class ResourceUtils
extends java.lang.Object

Utility class to make using resources easier.

Example use:

 
 JLabel lblUsername = new JLabel();
 JTextField tfUsername = new JTextField();
 ResourceUtils.resLabel( lblUserName, tfUserName, 
                         IdeArb.getString ( IdeArb.USERNAME ) );

 JButton b = new JButton();
 ResourceUtils.resButton( b, IdeArb.getString( IdeArb.SOME_STRING ) );

 

This class is not finalalized yet, please do not use it yet


Method Summary
static int getMnemonicKeyCode(java.lang.String string)
          Returns the key code for the mnemonic in the string.
static void resButton(javax.swing.AbstractButton button, java.lang.String labelText)
          Sets the resourcs on a subclass of AbstractButton.
static void resLabel(javax.swing.JLabel label, java.awt.Component labelFor, java.lang.String labelText)
          Sets the resources on a JLabel.
static java.lang.String stripMnemonic(java.lang.String string)
          Removes non-displayable inline mnemonic characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resLabel

public static void resLabel(javax.swing.JLabel label,
                            java.awt.Component labelFor,
                            java.lang.String labelText)
Sets the resources on a JLabel. It sets the text, mnemonic, and labelFor property.

Parameters:
label - The Label on which to set the properties
labelFor - the Component to set with the labelFor property on the label.
labelText - The text label to set on the label
See Also:
JLabel.setText(String), JLabel.setLabelFor(Component), JLabel#setMnemonic(int)

resButton

public static void resButton(javax.swing.AbstractButton button,
                             java.lang.String labelText)
Sets the resourcs on a subclass of AbstractButton. The common classes are JRadioButton, JButton, and JCheckBox

This method sets the text and mnemonic.

Parameters:
button - The button on which to set the text and mnemonoic
labelText - the text which contains the displayed text and mnemonic
See Also:
AbstractButton.setText(String), AbstractButton.setMnemonic(int)

getMnemonicKeyCode

public static int getMnemonicKeyCode(java.lang.String string)
Returns the key code for the mnemonic in the string. Returns VK_UNDEFINED if the string does not contain a mnemonic.


stripMnemonic

public static java.lang.String stripMnemonic(java.lang.String string)
Removes non-displayable inline mnemonic characters.

In order to specify a mnemonic character in a translatable string (eg. in a resource file), a special character is used to indicate which character in the string should be treated as the mnemonic. This method assumes that an ampersand ('&') character is used as the mnemonic indicator, and removes (single) ampersands from the input string. A double ampersand sequence is used to indicate that an ampersand should actually appear in the output stream, in which case one of the ampersands is removed.

See Also:
oracle.bali.ewt.util.StringUtils.#stripMnemonic(String)

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

Copyright © 1997, 2004, Oracle. All rights reserved.