Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.6.0)

E12063-07

oracle.dss.dataView
Class TokenSubstitutionAdapter

java.lang.Object
  extended by oracle.dss.dataView.TokenSubstitutionAdapter
All Implemented Interfaces:
TokenSubstitution, BaseTokenSubstitution
Direct Known Subclasses:
TokenSubstitutionExtendedAdapter

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:


Field Summary
static int ALL
          Support all tokens.
protected  oracle.dss.dataView.TokenSubstitutionAdapter.Variable date
           
static int DATE
          Support token for Date
protected  java.lang.String DATE_KEY
           
protected  oracle.dss.dataView.TokenSubstitutionAdapter.Variable dim_mem
           
protected  java.lang.String DIM_MEM_KEY
           
protected  oracle.dss.dataView.TokenSubstitutionAdapter.Variable dimension
           
static int DIMENSION
          Support token for Dimension.
protected  java.lang.String DIMENSION_KEY
           
static int DIMENSION_MEMBER
          Support token for Dimension_Member.
protected  DataviewCommon m_dataview
           
protected  int m_item
           
protected  java.util.Locale m_locale
           
protected  oracle.dss.dataView.TokenSubstitutionAdapter.Variable[] m_variable
           
protected  oracle.dss.dataView.TokenSubstitutionAdapter.Variable member
           
static int MEMBER
          Support token for Member.
protected  java.lang.String MEMBER_KEY
           
protected  oracle.dss.dataView.TokenSubstitutionAdapter.Variable page
           
static int PAGE
          Support token for Page.
protected  java.lang.String PAGE_KEY
           
protected  oracle.dss.dataView.TokenSubstitutionAdapter.Variable time
           
static int TIME
          Support token for Time.
protected  java.lang.String TIME_KEY
           
 
Constructor Summary
TokenSubstitutionAdapter()
           
TokenSubstitutionAdapter(DataviewCommon view)
          Constructor.
TokenSubstitutionAdapter(ViewPrinter printer, int item)
          Deprecated. use TokenSubstitutionExtendedAdapter instead
 
Method Summary
protected  void _init()
          initialize member variables
 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.
protected  java.lang.String getParsedKey(java.lang.String subStr)
          given a key return the parsed string
 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.
protected  void localizeVariablesArray()
           
 void setLocale(java.util.Locale locale)
          Specifies the Locale for this TokenSubstitution.
 void updateResourceBundle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_variable

protected oracle.dss.dataView.TokenSubstitutionAdapter.Variable[] m_variable

m_dataview

protected DataviewCommon m_dataview

m_locale

protected java.util.Locale m_locale

m_item

protected int m_item

DIMENSION_KEY

protected final java.lang.String DIMENSION_KEY
See Also:
Constant Field Values

MEMBER_KEY

protected final java.lang.String MEMBER_KEY
See Also:
Constant Field Values

DIM_MEM_KEY

protected final java.lang.String DIM_MEM_KEY
See Also:
Constant Field Values

DATE_KEY

protected final java.lang.String DATE_KEY
See Also:
Constant Field Values

TIME_KEY

protected final java.lang.String TIME_KEY
See Also:
Constant Field Values

PAGE_KEY

protected final java.lang.String PAGE_KEY
See Also:
Constant Field Values

dimension

protected oracle.dss.dataView.TokenSubstitutionAdapter.Variable dimension

member

protected oracle.dss.dataView.TokenSubstitutionAdapter.Variable member

dim_mem

protected oracle.dss.dataView.TokenSubstitutionAdapter.Variable dim_mem

date

protected oracle.dss.dataView.TokenSubstitutionAdapter.Variable date

time

protected oracle.dss.dataView.TokenSubstitutionAdapter.Variable time

page

protected oracle.dss.dataView.TokenSubstitutionAdapter.Variable page

DIMENSION

public static final int DIMENSION
Support token for Dimension.

See Also:
Constant Field Values

MEMBER

public static final int MEMBER
Support token for Member.

See Also:
Constant Field Values

DIMENSION_MEMBER

public static final int DIMENSION_MEMBER
Support token for Dimension_Member.

See Also:
Constant Field Values

DATE

public static final int DATE
Support token for Date

See Also:
Constant Field Values

TIME

public static final int TIME
Support token for Time.

See Also:
Constant Field Values

PAGE

public static final int PAGE
Support token for Page.

See Also:
Constant Field Values

ALL

public static final int ALL
Support all tokens.

See Also:
Constant Field Values
Constructor Detail

TokenSubstitutionAdapter

public TokenSubstitutionAdapter()

TokenSubstitutionAdapter

public TokenSubstitutionAdapter(ViewPrinter printer,
                                int item)
Deprecated. use TokenSubstitutionExtendedAdapter instead

Parameters:
printer -
item -
For internal use only. Application developers should not use this

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 BaseTokenSubstitution
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 BaseTokenSubstitution
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 BaseTokenSubstitution
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 BaseTokenSubstitution
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 BaseTokenSubstitution
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 BaseTokenSubstitution
Parameters:
listItem - A String that represents a list item from the drop-down "Insert" list.
Returns:
An empty String.

getParsedKey

protected java.lang.String getParsedKey(java.lang.String subStr)
given a key return the parsed string


_init

protected void _init()
initialize member variables


setLocale

public void setLocale(java.util.Locale locale)
Specifies the Locale for this TokenSubstitution.

Specified by:
setLocale in interface BaseTokenSubstitution
Parameters:
locale - The Locale for this TokenSubstitution.

updateResourceBundle

public void updateResourceBundle()

localizeVariablesArray

protected void localizeVariablesArray()

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.6.0)

E12063-07

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