Skip navigation links


com.essbase.eas.ui.editor.misc
Class StatementCommand

java.lang.Object
  extended by com.essbase.eas.ui.editor.misc.StatementCommand

All Implemented Interfaces:
StatementToken, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AlphaFnTemplateTree.AlphaFunctionCommand, MDXFunctionTree.MDXFunctionCommand, ScriptingCommand

public class StatementCommand
extends java.lang.Object
implements StatementToken, java.lang.Cloneable, java.io.Serializable

Title: Description: Copyright: Copyright (c) 2001 Company: Hyperion Solutions Corporation

Version:
1.0
Author:
Sree Menon
See Also:
Serialized Form

Nested Class Summary
static class StatementCommand.WordListWindowPopup
           

 

Field Summary
static java.lang.String ADDPROPERTY
           
static java.lang.String BRACKETED
           
static java.lang.String CLASS
           
static java.lang.String COMMAND
           
static java.lang.String COMMANDS
           
static java.lang.String DONOTLIST
           
static java.lang.String EOL
           
static java.lang.String FORCE
           
static java.lang.String ISFUNCTION
           
protected  java.util.ArrayList list
           
static java.lang.String LOOP
           
static java.lang.String LOOPCOMMAND
           
static java.lang.String NAME
           
protected  java.lang.Object[] nameTokens
           
protected  java.lang.Object[] next
           
static java.lang.String NEXT_COMMAND
           
static java.lang.String NOTIFYCLASS
           
static java.lang.String NOTIFYMETHOD
           
static java.lang.String NOTIFYOBJECT
           
static java.lang.String OPT_PROPERTY
           
static java.lang.String OPTIONAL
           
protected  java.lang.Object[] options
           
static java.lang.String OPTIONS
           
protected  java.lang.Object[][] optionTokens
           
static java.lang.String PARAN
           
protected  java.lang.Object parent
           
static java.lang.String PREFIX
           
protected  java.lang.Object[] prefixTokens
           
static java.lang.String QUOTED
           
static java.lang.String REGISTER
           
static java.lang.String SUFFIX
           
protected  java.lang.Object[] suffixTokens
           
protected  java.util.Hashtable table
           
static java.lang.String TEXT
           
static java.lang.String TRIGGER_NEXT
           

 

Constructor Summary
StatementCommand()
           
StatementCommand(java.lang.Object parent, java.lang.String name)
           
StatementCommand(java.lang.String name)
           

 

Method Summary
 void addAttribute(java.lang.Object key, java.lang.Object value)
           
 void addCommand(StatementToken command)
          adds next set of token commands
 void addCommandOptions(java.util.List list)
          This will add any options the command has
protected  java.lang.Object[] addNameTokens(java.lang.String text)
           
protected  void addNextCommands()
           
protected  void addOptionCommands(StatementContext context)
           
 void addOptions(StatementContext context)
          adds the options available for this command token
protected  java.lang.Object[] addOptionsTokens(java.lang.String text)
           
 void canceledCommand(TextEditor editor, int startoffset)
          invoked when the user cancels a command;
protected  int checkFix(java.util.List tokenList, java.lang.Object[] o, int startindex, java.util.Properties properties)
           
 void clearAttributes()
           
 java.lang.Object clone()
           
protected  StatementCommand createOptionCommand(int index)
           
 void exportXml(java.lang.StringBuffer buf)
           
protected  StatementToken findCommand(java.lang.String loopCommand)
           
 void generateSpaces(java.lang.StringBuffer buf, int offset)
           
 java.lang.String getAttribute(java.lang.Object key)
          gets the attribute
 java.util.Hashtable getAttributes()
           
 java.lang.Object[] getCommands()
           
protected  StatementCommands getCommandsParent()
           
protected  java.util.Hashtable getCommandTable()
           
protected  java.util.Iterator getElements()
           
 java.lang.String getEndOfStatement()
          Returns the string that represents the end of statement
 java.lang.String getKey(java.lang.Object key)
           
 StatementToken getLastStatementToken(StatementContext context, int startindex)
          getLastStatementToken is a forward traversal of the list looking for the last token
 java.lang.String getLineSep()
           
protected  java.util.ArrayList getList()
           
 java.lang.String getName()
          Returns the name of the Token
 java.lang.Object getParent()
           
protected  java.lang.String getSafeKey(java.lang.Object key)
           
 boolean hasKey(java.lang.Object key)
           
 void insertCommand(int index, StatementToken command)
           
 int isCommand(StatementContext context)
          Given a token list, returns whether it represent the command 0 means its not and any other number means the number of tokens that make up the command
 boolean isForcedOption()
           
 boolean isLastToken()
          Returns true if its the last token of the command syntax
protected  boolean isListEmpty()
           
 boolean isOptional()
          returns true, if this command is an optional one
 int isToken(java.util.List tokenList, int startindex, java.util.Properties properties)
           
 int isToken(StatementContext context, int startindex)
          Returns the number of tokens matched by this command from the token list
protected  EditToken newEditToken(java.lang.String text)
           
 void put(java.lang.Object key, java.lang.Object value)
          puts an attribute
 void removeAllCommands()
           
 void removeAttribute(java.lang.Object key)
           
 boolean removeCommand(java.lang.Object command)
           
protected  java.lang.String removeQuoteString(java.lang.String name)
           
 void resetParent()
          Walks the children and reset their parent to be this
protected  boolean resetSelection(TextEditor editor, int start, int end)
           
 void setCompleteText(StatementContext context, int startoffset)
          sets the completed word into the editor
 void setCompleteText(TextEditor editor, int startoffset)
           
 void setCompleteText(TextEditor editor, java.lang.String text, int startoffset)
          sets the completed word into the editor
 void setForcedOption(boolean force)
           
 void setName(java.lang.String name)
           
 void setOptions(StatementContext context)
          Returns a list of options for a given command token
 void setParent(java.lang.Object parent)
          sets the token command's parent
 void setWordCompleteText(TextEditor editor, java.lang.String text, int startoffset)
           
 void showOptions(StatementContext context)
          Shows the options
protected  int tokenListSize(StatementContext context, int startindex)
           
 java.lang.String toString()
          gets the display string
 void writeKeywordsToFile()
           

 

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

 

Field Detail

COMMANDS

public static final java.lang.String COMMANDS
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

EOL

public static final java.lang.String EOL
See Also:
Constant Field Values

CLASS

public static final java.lang.String CLASS
See Also:
Constant Field Values

LOOP

public static final java.lang.String LOOP
See Also:
Constant Field Values

COMMAND

public static final java.lang.String COMMAND
See Also:
Constant Field Values

TEXT

public static final java.lang.String TEXT
See Also:
Constant Field Values

PREFIX

public static final java.lang.String PREFIX
See Also:
Constant Field Values

SUFFIX

public static final java.lang.String SUFFIX
See Also:
Constant Field Values

OPTIONAL

public static final java.lang.String OPTIONAL
See Also:
Constant Field Values

NOTIFYCLASS

public static final java.lang.String NOTIFYCLASS
See Also:
Constant Field Values

NOTIFYMETHOD

public static final java.lang.String NOTIFYMETHOD
See Also:
Constant Field Values

NOTIFYOBJECT

public static final java.lang.String NOTIFYOBJECT
See Also:
Constant Field Values

PARAN

public static final java.lang.String PARAN
See Also:
Constant Field Values

QUOTED

public static final java.lang.String QUOTED
See Also:
Constant Field Values

BRACKETED

public static final java.lang.String BRACKETED
See Also:
Constant Field Values

ISFUNCTION

public static final java.lang.String ISFUNCTION
See Also:
Constant Field Values

DONOTLIST

public static final java.lang.String DONOTLIST
See Also:
Constant Field Values

ADDPROPERTY

public static final java.lang.String ADDPROPERTY
See Also:
Constant Field Values

LOOPCOMMAND

public static final java.lang.String LOOPCOMMAND
See Also:
Constant Field Values

FORCE

public static final java.lang.String FORCE
See Also:
Constant Field Values

OPTIONS

public static final java.lang.String OPTIONS
See Also:
Constant Field Values

OPT_PROPERTY

public static final java.lang.String OPT_PROPERTY
See Also:
Constant Field Values

NEXT_COMMAND

public static final java.lang.String NEXT_COMMAND
See Also:
Constant Field Values

REGISTER

public static final java.lang.String REGISTER
See Also:
Constant Field Values

TRIGGER_NEXT

public static final java.lang.String TRIGGER_NEXT
See Also:
Constant Field Values

list

protected java.util.ArrayList list

prefixTokens

protected java.lang.Object[] prefixTokens

suffixTokens

protected java.lang.Object[] suffixTokens

nameTokens

protected java.lang.Object[] nameTokens

options

protected java.lang.Object[] options

optionTokens

protected java.lang.Object[][] optionTokens

next

protected java.lang.Object[] next

table

protected java.util.Hashtable table

parent

protected transient java.lang.Object parent

Constructor Detail

StatementCommand

public StatementCommand()

StatementCommand

public StatementCommand(java.lang.String name)

StatementCommand

public StatementCommand(java.lang.Object parent,
                        java.lang.String name)

Method Detail

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()
Description copied from interface: StatementToken
Returns the name of the Token
Specified by:
getName in interface StatementToken
Returns:
the name of the command

newEditToken

protected EditToken newEditToken(java.lang.String text)

addNameTokens

protected java.lang.Object[] addNameTokens(java.lang.String text)

addOptionsTokens

protected java.lang.Object[] addOptionsTokens(java.lang.String text)

getCommandsParent

protected StatementCommands getCommandsParent()

getCommandTable

protected java.util.Hashtable getCommandTable()

addNextCommands

protected void addNextCommands()

getList

protected java.util.ArrayList getList()

tokenListSize

protected int tokenListSize(StatementContext context,
                            int startindex)

getLastStatementToken

public StatementToken getLastStatementToken(StatementContext context,
                                            int startindex)
Description copied from interface: StatementToken
getLastStatementToken is a forward traversal of the list looking for the last token
Specified by:
getLastStatementToken in interface StatementToken
startindex - is the token index to start processing the tokens from the list
Returns:
the last token

setOptions

public void setOptions(StatementContext context)
Description copied from interface: StatementToken
Returns a list of options for a given command token
Specified by:
setOptions in interface StatementToken

createOptionCommand

protected StatementCommand createOptionCommand(int index)

addOptionCommands

protected void addOptionCommands(StatementContext context)

addOptions

public void addOptions(StatementContext context)
Description copied from interface: StatementToken
adds the options available for this command token
Specified by:
addOptions in interface StatementToken
Parameters:
context - statement context

toString

public java.lang.String toString()
Description copied from interface: StatementToken
gets the display string
Specified by:
toString in interface StatementToken
Overrides:
toString in class java.lang.Object
Returns:
string to display

checkFix

protected int checkFix(java.util.List tokenList,
                       java.lang.Object[] o,
                       int startindex,
                       java.util.Properties properties)

isToken

public int isToken(StatementContext context,
                   int startindex)
Description copied from interface: StatementToken
Returns the number of tokens matched by this command from the token list
Specified by:
isToken in interface StatementToken

isToken

public int isToken(java.util.List tokenList,
                   int startindex,
                   java.util.Properties properties)

removeQuoteString

protected java.lang.String removeQuoteString(java.lang.String name)

isLastToken

public boolean isLastToken()
Description copied from interface: StatementToken
Returns true if its the last token of the command syntax
Specified by:
isLastToken in interface StatementToken

getLineSep

public java.lang.String getLineSep()

getEndOfStatement

public java.lang.String getEndOfStatement()
Description copied from interface: StatementToken
Returns the string that represents the end of statement
Specified by:
getEndOfStatement in interface StatementToken

canceledCommand

public void canceledCommand(TextEditor editor,
                            int startoffset)
Description copied from interface: StatementToken
invoked when the user cancels a command;
Specified by:
canceledCommand in interface StatementToken

setWordCompleteText

public void setWordCompleteText(TextEditor editor,
                                java.lang.String text,
                                int startoffset)
Specified by:
setWordCompleteText in interface StatementToken

resetSelection

protected boolean resetSelection(TextEditor editor,
                                 int start,
                                 int end)

setCompleteText

public void setCompleteText(TextEditor editor,
                            java.lang.String text,
                            int startoffset)
Description copied from interface: StatementToken
sets the completed word into the editor
Specified by:
setCompleteText in interface StatementToken

setCompleteText

public void setCompleteText(StatementContext context,
                            int startoffset)
Description copied from interface: StatementToken
sets the completed word into the editor
Specified by:
setCompleteText in interface StatementToken

setCompleteText

public void setCompleteText(TextEditor editor,
                            int startoffset)
Specified by:
setCompleteText in interface StatementToken

showOptions

public void showOptions(StatementContext context)
Shows the options
Specified by:
showOptions in interface StatementToken

getElements

protected java.util.Iterator getElements()

isListEmpty

protected boolean isListEmpty()

isOptional

public boolean isOptional()
Description copied from interface: StatementToken
returns true, if this command is an optional one
Specified by:
isOptional in interface StatementToken

isCommand

public int isCommand(StatementContext context)
Description copied from interface: StatementToken
Given a token list, returns whether it represent the command 0 means its not and any other number means the number of tokens that make up the command
Specified by:
isCommand in interface StatementToken

isForcedOption

public boolean isForcedOption()

setForcedOption

public void setForcedOption(boolean force)

getSafeKey

protected java.lang.String getSafeKey(java.lang.Object key)

getAttribute

public java.lang.String getAttribute(java.lang.Object key)
Description copied from interface: StatementToken
gets the attribute
Specified by:
getAttribute in interface StatementToken
Parameters:
key - attribute key
Returns:
the value, could be null

getKey

public java.lang.String getKey(java.lang.Object key)

hasKey

public boolean hasKey(java.lang.Object key)
Specified by:
hasKey in interface StatementToken
Parameters:
key - usually a string object
Returns:
true if token has object set

removeAttribute

public void removeAttribute(java.lang.Object key)

clearAttributes

public void clearAttributes()

addAttribute

public void addAttribute(java.lang.Object key,
                         java.lang.Object value)

put

public void put(java.lang.Object key,
                java.lang.Object value)
Description copied from interface: StatementToken
puts an attribute
Specified by:
put in interface StatementToken
Parameters:
key - attribute key
value - attribute value

addCommandOptions

public void addCommandOptions(java.util.List list)
Description copied from interface: StatementToken
This will add any options the command has
Specified by:
addCommandOptions in interface StatementToken

addCommand

public void addCommand(StatementToken command)
Description copied from interface: StatementToken
adds next set of token commands
Specified by:
addCommand in interface StatementToken
Parameters:
command - one of the next command that follows this

insertCommand

public void insertCommand(int index,
                          StatementToken command)

removeCommand

public boolean removeCommand(java.lang.Object command)

removeAllCommands

public void removeAllCommands()

setParent

public void setParent(java.lang.Object parent)
Description copied from interface: StatementToken
sets the token command's parent
Specified by:
setParent in interface StatementToken
Parameters:
parent - the parent

findCommand

protected StatementToken findCommand(java.lang.String loopCommand)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

resetParent

public void resetParent()
Description copied from interface: StatementToken
Walks the children and reset their parent to be this
Specified by:
resetParent in interface StatementToken

getCommands

public java.lang.Object[] getCommands()

getParent

public java.lang.Object getParent()
Specified by:
getParent in interface StatementToken

getAttributes

public java.util.Hashtable getAttributes()

generateSpaces

public void generateSpaces(java.lang.StringBuffer buf,
                           int offset)

exportXml

public void exportXml(java.lang.StringBuffer buf)

writeKeywordsToFile

public void writeKeywordsToFile()

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.