Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.dataView
Class TokenSubstitutionAdapter

java.lang.Object
  |
  +--oracle.dss.dataView.TokenSubstitutionAdapter
All Implemented Interfaces:
TokenSubstitution

public class TokenSubstitutionAdapter
extends java.lang.Object
implements TokenSubstitution

This class supports replaceable text in a text component. This class maintains a list of items that can be chosen from the "Insert" drop-down list in the Title UI panel. The items are localizable strings. For example, "Dimension" is a list item. For each list item, this class also maintains the following:


Constructor Summary
TokenSubstitutionAdapter(DataviewCommon view)
          Constructor.

 

Method Summary
 java.lang.String getKey(java.lang.String listItem)
          Retrieves a keyword for a list item.
 java.lang.String getKeyString(java.lang.String tokenString)
          Retrieves a String that includes unlocalizable keywords instead of localizable tokens.
 java.lang.String[] getListItems()
          Retrieves an array of items for the "Insert" drop-down list box.
 java.lang.String getParsedString(java.lang.String keyString)
          Retrieves a parsed String that is displayed in the view.
 java.lang.String getToken(java.lang.String listItem)
          Retrieves a token that corresponds to a list item.
 java.lang.String getTokenString(java.lang.String keyString)
          Retrieves a String that includes localizable tokens instead of unlocalizable keywords.
 void setLocale(java.util.Locale locale)
          Specifies the Locale for this TokenSubstitution.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

TokenSubstitutionAdapter

public TokenSubstitutionAdapter(DataviewCommon view)
Constructor.
Parameters:
view - The DataviewCommon for which this adapter provides token substitution support.
Method Detail

getListItems

public java.lang.String[] getListItems()
Retrieves an array of items for the "Insert" drop-down list box.
Specified by:
getListItems in interface TokenSubstitution
Returns:
The array of items for the UI to display.

getToken

public java.lang.String getToken(java.lang.String listItem)
Retrieves a token that corresponds to a list item. The UI displays this token in the JTextField. The token usually includes an indicator that it will be replaced in the actual view. For example, if the list item is "Dimension", the token is "&Dimension". The UI places this token in the text field with any other text. For example, the text field might then display "Sales by &Dimension".
Specified by:
getToken in interface TokenSubstitution
Parameters:
listItem - The list item that the user selected from the drop-down list.
Returns:
A token for the UI to display in the JTextField. If listItem does not contain any items in the array that getListItems returns, then this method returns null.

getKeyString

public java.lang.String getKeyString(java.lang.String tokenString)
Retrieves a String that includes unlocalizable keywords instead of localizable tokens. When the view saves itself in XML, it uses this string to identify the text that it represents. Currently, this key string is also passed to setText methods in graph components. If you present your own UI that allows token substitution, and you call setText methods, you should call this method in your implementation of this interface to get the String to pass to setText.
Specified by:
getKeyString in interface TokenSubstitution
Parameters:
tokenString - The String that the JTextField displays. This is the String that the user has entered into the text field, including any tokens for replaceable text.
Returns:
The String that has unlocalizable keys instead of any localizable tokens. If tokenString does not contain any tokens, then this method returns tokenString.

getTokenString

public java.lang.String getTokenString(java.lang.String keyString)
Retrieves a String that includes localizable tokens instead of unlocalizable keywords. The String that this method returns is displayed in the JTextField. The view calls this method when it applies XML that includes a setting for the Text property. The view uses the key string as the Text value in XML.
Specified by:
getTokenString in interface TokenSubstitution
Parameters:
keyString - The String that can include unlocalizable keys.
Returns:
A String that contains localizable tokens instead of any keys in keyString. If keyString does not include any tokens, then this method returns keyString.

getParsedString

public java.lang.String getParsedString(java.lang.String keyString)
Retrieves a parsed String that is displayed in the view. The String that this method returns has replacement text in place of the keys in keyString. The setText methods in a graph call this method to retrieve the text to display in the graph text component. If you call setText, be sure to pass a key string and not a token string.
Specified by:
getParsedString in interface TokenSubstitution
Parameters:
keyString - The string that the view stores as the setting of the Text property.
Returns:
A parsed String that contains localized text instead of any keys in keyString. If keyString does not include any keys, then this method returns keyString.
See Also:
getKeyString(java.lang.String)

getKey

public java.lang.String getKey(java.lang.String listItem)
Retrieves a keyword for a list item. This method returns an empty String. This method is not used in the 1.5 graph.
Specified by:
getKey in interface TokenSubstitution
Parameters:
listItem - A String that represents a list item from the drop-down "Insert" list.
Returns:
An empty String.

setLocale

public void setLocale(java.util.Locale locale)
Specifies the Locale for this TokenSubstitution.
Specified by:
setLocale in interface TokenSubstitution
Parameters:
locale - The Locale for this TokenSubstitution.

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.