SWT LPEX
v3.0.5

com.ibm.lpex.prop
Class PropertiesParser

java.lang.Object
  extended bycom.ibm.lpex.core.LpexCommonParser
      extended bycom.ibm.lpex.prop.PropertiesParser
All Implemented Interfaces:
LpexConstants, LpexParser

public class PropertiesParser
extends LpexCommonParser

Document parser for Java properties files.

Actions and assigned keys added by this document parser:

Keys already defined (for example, by the active base editor profile and by the user profile) to an action different from nullAction are not redefined in here.

Action modified by this document parser:

See Also:
Properties.load(java.io.InputStream)

Field Summary
 
Fields inherited from class com.ibm.lpex.core.LpexCommonParser
ATTRIBUTES_COMMENT, ATTRIBUTES_COMMENT_KEYWORD, ATTRIBUTES_COMMENT1, ATTRIBUTES_DEFAULT, ATTRIBUTES_DIRECTIVE, ATTRIBUTES_ERROR, ATTRIBUTES_KEYWORD, ATTRIBUTES_KEYWORD1, ATTRIBUTES_LIBRARY, ATTRIBUTES_NONSOURCE, ATTRIBUTES_NUMERAL, ATTRIBUTES_STRING, ATTRIBUTES_STRING1, BACKGROUND_COLOR, CLASS_MESSAGE, LANGUAGE_CCPP, LANGUAGE_CICS, LANGUAGE_CL, LANGUAGE_COBOL, LANGUAGE_DDS, LANGUAGE_DLI, LANGUAGE_FORTRAN, LANGUAGE_HLASM, LANGUAGE_HTML, LANGUAGE_JAVA, LANGUAGE_JCL, LANGUAGE_LISP, LANGUAGE_PERL, LANGUAGE_PLI, LANGUAGE_REXX, LANGUAGE_RPG, LANGUAGE_SABRETALK, LANGUAGE_SQL, LANGUAGE_XMI, LANGUAGE_XML, LANGUAGE_XSL, LEXER_RC_END, LEXER_RC_EOF, LEXER_RC_MORE, LEXER_RC_OK, POPUP_END, POPUP_FILTERVIEW, POPUP_SOURCE, POPUP_TOP, PROTOKEY_EMPTY, STYLE_MESSAGE, STYLE_NAME, view
 
Fields inherited from interface com.ibm.lpex.core.LpexConstants
HELP_COMMAND_MAP, LPEX_VERSION, MSG_POPUP_ERRORS, MSG_POPUP_EXCLUDESELECTION, MSG_POPUP_FILTERVIEWMENU, MSG_POPUP_INSERTMENU, MSG_POPUP_SELECTEDMENU, MSG_POPUP_SHOWALL, MSG_POPUP_SOURCEMENU, PARSE_PENDING_CHANGE_MASK, PARSE_PENDING_INSERT_MASK, PARSE_PENDING_NEXT_DELETED_MASK, PARSE_PENDING_NEXT_SHOW_DELETED_MASK, PARSE_PENDING_PREV_DELETED_MASK, PARSE_PENDING_PREV_SHOW_DELETED_MASK, PLATFORM_AWT, PLATFORM_SWT, PLATFORM_SWT_KEY, STATUS_FILE_ERRORREADING, STATUS_FILE_INCORRECTENCODING, STATUS_FILE_NOTFOUND, STATUS_FINDTEXT_INVALIDPATTERN, STATUS_FINDTEXT_NOTFOUND, STATUS_FINDTEXT_ONLYOCCURRENCE, STATUS_FINDTEXT_READONLY, STATUS_FINDTEXT_WRAPPED, STATUS_LOCATE_NOSEQUENCETEXT, STATUS_LOCATE_NOTFOUND, STATUS_LOCATE_WRAPPED, STATUS_SAVE_CANCELLED, STATUS_SAVE_FAILED, STATUS_TEXTLIMIT_ENFORCED
 
Constructor Summary
PropertiesParser(LpexView lpexView)
          Constructor.
 
Method Summary
 String getCommentStyleCharacters()
          Returns the style character used for styling comments ("c").
 String getLanguage()
          Returns "properties", the document type supported by this parser.
protected  String getPopupItems(int popupLocation)
          Returns this parser's contribution to the popup.
 ResourceBundle getProfile()
          Returns this parser's profile resource bundle for the install parser properties.
 void parseAll()
          Total parse of the entire document.
 void parseElement(int element)
          Incremental parse.
protected  void parseOneElement(int element)
          Parses one non-show element in the document.
protected  void setStyleAttributes()
          Defines this parser's style attributes.
 
Methods inherited from class com.ibm.lpex.core.LpexCommonParser
addDocumentMessage, addMessage, addMessage, addMessage, blockMarkWord, copyDocumentMessages, cursorIndent, defineFilterAction, expandProtoKeyword, getInstallStyleAttributes, getLanguage, getLshToken, getPopupParserItems, getPopupViewItems, getProperty, getStyleName, getStyles, getTextIndent, getToken, getTokenLocation, indentText, indentText, indentText, isDebuggable, isTokenDelimiter, lineComment, lpexView, matchToken, newLine, openLine, parse, propertySet, removeDocumentMessages, removeMessages, removeMessages, resetParser, setProperty, setStyle, splitLine, styleString, terminateParser, tokenBegin, tokenEnd, totalParse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesParser

public PropertiesParser(LpexView lpexView)
Constructor. Adds all of the parser specifics to the LPEX document view. Initializes the view for the parser: sets up all the style attributes, classes, etc. for the language-sensitive edit features supported.

Parameters:
lpexView - the document view associated with this parser
Method Detail

getPopupItems

protected String getPopupItems(int popupLocation)
Returns this parser's contribution to the popup. This parser contributes to the "Filter view" submenu (Keys), and to the "Source" submenu (Comment, Uncomment, Compare keys).

Overrides:
getPopupItems in class LpexCommonParser
Parameters:
popupLocation - the location on the pop-up menu of the items requested, one of:
LpexCommonParser.POPUP_TOP, LpexCommonParser.POPUP_FILTERVIEW, LpexCommonParser.POPUP_SOURCE, LpexCommonParser.POPUP_END
Returns:
this parser's contribution to the pop-up menu, or
null if none
See Also:
LpexCommonParser.defineFilterAction(java.lang.String, java.lang.String)

setStyleAttributes

protected void setStyleAttributes()
Defines this parser's style attributes. The following style characters are set: '_' (layout blanks) 'k' (key) '=' (equal) 'v' (value) 'a' (ampersand in value) 'c' (comment).


getCommentStyleCharacters

public String getCommentStyleCharacters()
Returns the style character used for styling comments ("c").

Overrides:
getCommentStyleCharacters in class LpexCommonParser

getLanguage

public String getLanguage()
Returns "properties", the document type supported by this parser.

Overrides:
getLanguage in class LpexCommonParser
See Also:
LpexCommonParser.getProperty(java.lang.String), LpexCommonParser.setProperty(java.lang.String, java.lang.String)

getProfile

public ResourceBundle getProfile()
Returns this parser's profile resource bundle for the install parser properties.

Overrides:
getProfile in class LpexCommonParser
See Also:
LpexCommonParser.getProperty(java.lang.String), Parser properties

parseAll

public void parseAll()
Total parse of the entire document. Done initially, after a document has been loaded in the editor, and after an updateProfile command.

Specified by:
parseAll in class LpexCommonParser
See Also:
Total and incremental parse

parseElement

public void parseElement(int element)
Incremental parse.

Specified by:
parseElement in class LpexCommonParser
Parameters:
element - an element affected by a committed change in this view
See Also:
LpexView.parsePending(int), LpexView.elementParsed(int), Total and incremental parse

parseOneElement

protected void parseOneElement(int element)
Parses one non-show element in the document.

Parameters:
element - one document element to parse

SWT LPEX
v3.0.5

(C) Copyright IBM Corporation 1998, 2005.  All Rights Reserved.