iSeries Remote Systems
v6.0.0

com.ibm.etools.iseries.editor
Class ISeriesEditorUtilities

java.lang.Object
  extended bycom.ibm.etools.iseries.editor.ISeriesEditorUtilities
All Implemented Interfaces:
IISeriesEditorConstants, IISeriesEditorConstantsColors, IISeriesEditorConstantsRPG

public class ISeriesEditorUtilities
extends Object
implements IISeriesEditorConstantsRPG, IISeriesEditorConstants

Utilities class for iSeries Remote Systems LPEX Editor


Nested Class Summary
protected static class ISeriesEditorUtilities.RunnableSignon
           
 
Field Summary
protected static ResourceBundle _bundle
          the resource bundle
static String copyright
           
 
Fields inherited from interface com.ibm.etools.iseries.editor.IISeriesEditorConstantsRPG
_straSQLWords, CMD_SETFIELDS, CMD_SETFIELDSBLANK, CMD_SETFORMATLINETEXT, CMD_SETTABS, COLUMN_C_FREE, COLUMN_C_OPCODE, COLUMN_COMMENT, COLUMN_FACTOR1, COLUMN_FACTOR2, COLUMN_KEYWORDS, COLUMN_PROC_NAME_BEGIN, COLUMN_PROC_NAME_END, COLUMN_PROC_SPEC, COLUMN_SPEC, FIELD_FACTOR1, FIELD_FACTOR2, FIELD_FROM, FIELD_OPCODE, FIELD_TOLENGTH, OPM_COLUMN_FACTOR1
 
Fields inherited from interface com.ibm.etools.iseries.editor.IISeriesEditorConstantsColors
COLOR_BLACK_WHITE, COLOR_BLUE_WHITE, COLOR_BRIGHTBLUE_WHITE, COLOR_BRIGHTGREEN_WHITE, COLOR_BRIGHTGREY_WHITE, COLOR_BRIGHTPINK_WHITE, COLOR_BRIGHTRED_WHITE, COLOR_BROWN_WHITE, COLOR_CYAN_WHITE, COLOR_ERROR_HIGHLIGHT, COLOR_GREEN_WHITE, COLOR_GREY_WHITE, COLOR_HIGHLIGHT, COLOR_MAGENTA_WHITE, COLOR_PINK_WHITE, COLOR_RED_WHITE, COLOR_WHITE_BRIGHTRED
 
Fields inherited from interface com.ibm.etools.iseries.editor.IISeriesEditorConstants
ACTION_COMPILE_ID, ACTION_VERIFYPROGRAM_ID, FILE_TYPE_CL, FILE_TYPE_DDS, FILE_TYPE_OTHER, FILE_TYPE_RPGILE, FILE_TYPE_RPGOPM, PREF_AUTO_FORMAT, PREF_AUTO_FORMAT_T, PREF_AUTO_UPPER, PREF_AUTO_UPPER_T, PREF_BASE_PREFIX, PREF_BLANK, PREF_BLANK_SUFFIX, PREF_BLANK_T, PREF_COLSEDIT_T, PREF_COMMAND_POS, PREF_COMMAND_POS_T, PREF_DATE, PREF_DATE_T, PREF_HIGHLIGHT, PREF_HIGHLIGHT_BACKGROUND, PREF_HIGHLIGHT_BACKGROUND_T, PREF_HIGHLIGHT_T, PREF_INDENT, PREF_INDENT_T, PREF_INDENTATION, PREF_INDENTATION_T, PREF_LABEL_ABOVE_CMD, PREF_LABEL_ABOVE_CMD_T, PREF_LABEL_POS, PREF_LABEL_POS_T, PREF_ONE_PARM_PER_LINE, PREF_ONE_PARM_PER_LINE_T, PREF_RESEQ_INCR, PREF_RESEQ_INCR_T, PREF_RESEQ_SAVE, PREF_RESEQ_SAVE_T, PREF_RESEQ_START, PREF_RESEQ_START_T, PREF_SIGNATURE_T, PREF_SQL_SYNTAX_CHECK, PREF_SQL_SYNTAX_CHECK_T, PREF_SYNTAX_CHECK, PREF_SYNTAX_CHECK_T, PREF_TAB, PREF_TAB_GENERAL, PREF_TAB_GENERAL_T, PREF_TAB_T, PREF_TOOLTIP_SUFFIX
 
Constructor Summary
ISeriesEditorUtilities()
           
 
Method Summary
static void cleanupMenuBar(IMenuManager menuManager, ISeriesEditorConnectListener cl)
          Method cleanupMenuBar.
static void cleanupToolbar(IToolBarManager toolBarManager)
          Method cleanupToolbar.
static ISeriesFile COBOLgetFieldFile(com.ibm.lpex.core.LpexView view, IISeriesEditorParser parser)
          Method COBOLgetFieldFile.
static ISeriesMember COBOLgetIncludeMember(com.ibm.lpex.core.LpexView view, IISeriesEditorParser parser, boolean ILE)
          Method COBOLgetIncludeMember.
static boolean COBOLisValidFieldAction(com.ibm.lpex.core.LpexView view)
          Method COBOLisValidFieldAction.
static boolean COBOLisValidIncludeAction(com.ibm.lpex.core.LpexView view)
          Method COBOLisValidIncludeAction.
static void compileMemberInEditor(ISeriesMember mbr, com.ibm.etools.systems.editor.SystemTextEditor editor)
          Compile the member that is in the editor using the last used compile command for the member type Prompts if the editor is dirty (unsaved changes)
static void contributeBaseToolbarItems(ITextEditor editor, IToolBarManager toolBarManager)
          Method contributeBaseToolbarItems.
static void contributeCompileMenuItems(ITextEditor editor, IMenuManager menuCompile, Shell shell)
          Method contributeCompileMenuItems.
static IMenuManager createCompileMenu(ITextEditor editor, IMenuManager menuManager, IMenuManager compileMenu, IISeriesEditorParser parser)
          Method createCompileMenu.
static IMenuManager createLanguageHelpMenu(ITextEditor editor, IMenuManager menuManager, String strPrefix, IMenuManager langHelpMenu)
          Method createLangaugeHelpMenu.
static IMenuManager createSourceMenu(ITextEditor editor, IMenuManager menuManager, IMenuManager sourceMenu)
          Method createSourceMenu.
static String determineRPGCFreeSpecOpcode(String strLineText)
          Determine the opcode of a C free spec line (returned uppercased)
static String determineRPGCSpecOpcode(String strLineText, boolean bILE)
          Determine the opcode of a C spec line (returned uppercased)
static String determineRPGCSpecOpcode(String strLineText, boolean bILE, boolean bPreserveCase)
          Determine the opcode of a C spec line (preserve case)
static String determineRPGOpcode(String strLineText, boolean bILE)
          Determine the opcode of a RPG line (returned uppercased)
static void doSaving(com.ibm.lpex.core.LpexView view)
          Method doSaving.
static void enableMultipleViews(com.ibm.lpex.core.LpexView view)
          Enable multiple views in LPEX Editor
static void ensureVisible(com.ibm.lpex.core.LpexView lpexView, int element)
           
static String generateTabString(int[] iatabs)
          generateTabString From an Integer array, generate a string representing the int array
static com.ibm.lpex.core.LpexView[] getAllLpexViews(com.ibm.lpex.alef.LpexTextEditor editor)
          Retrieves a list of all the view open in an editor.
static TextEditorAction getBaseEditorAction(ITextEditor editor, String actionId)
          Method getBaseEditorAction.
static int getCCSID(IFile iFile, ISeriesConnection connection)
          Method getCCSID.
static String getCommonFilterMenuItems()
          Method getCommonFilterMenuItems.
static StructuredSelection getCompileSelectionObject(ITextEditor editor)
          Method getCompileSelectionObject.
static int getCurrentLine(com.ibm.lpex.core.LpexView view)
          Deprecated.  
static int getDataLength(String[] straDataWords, String strLine)
          Returns the length of a data word, or zero if not a data word.
static int getDocumentElementBottom(com.ibm.lpex.core.LpexView view)
          Get the bottom most element
static int getDocumentElementNext(com.ibm.lpex.core.LpexView view, int iElement)
          Get the next element that is not a show line
static int getDocumentElementPrevious(com.ibm.lpex.core.LpexView view, int iElement)
          Get the previous line that is not a show line
static String getDocumentElementText(com.ibm.lpex.core.LpexView view, int iElement)
          Returns the view element's text appended with a null.
static String getDocumentElementTextDBCS(com.ibm.lpex.core.LpexView view, int iElement, boolean bPadDoubleByteCharacters)
          Returns a zero terminated line of text.
static int getDocumentElementTop(com.ibm.lpex.core.LpexView view)
          Returns the top most Element
static int getDocumentLineBottom(com.ibm.lpex.core.LpexView view)
          Deprecated. Get the bottom most line that is not a show line
static int getDocumentLineNext(com.ibm.lpex.core.LpexView view, int iLine)
          Deprecated.  
static int getDocumentLinePrevious(com.ibm.lpex.core.LpexView view, int iLine)
          Deprecated.  
static String getDocumentLineText(com.ibm.lpex.core.LpexView view, int iLine)
          Deprecated.  
static String getDocumentLineTextDBCS(com.ibm.lpex.core.LpexView view, int iLine, boolean bPadDoubleByteCharacters)
          Deprecated.  
static int getDocumentLineTop(com.ibm.lpex.core.LpexView view)
          Deprecated.  
static int getDocumentNumberOfLines(com.ibm.lpex.core.LpexView view)
          Method getDocumentNumberOfLines.
static String getElementTextDBCS(com.ibm.lpex.core.LpexView view, int iElement, boolean bPadDoubleByteCharacters)
          Returns a line of text.
static String getFullFilePath(ITextEditor editor)
          Method getFullFilePath.
static ISeriesConnection getHostConnectionForLocalFile(boolean bPromptAllowed)
          Method getHostConnectionForLocalFile.
static IFile getIFile(ITextEditor editor)
          Method getIFile.
static ISeriesConnection getISeriesConnection(ITextEditor editor)
          Method getISeriesConnection.
static ISeriesMember getISeriesMember(ITextEditor editor)
          Method getISeriesMember.
static String getLineText(com.ibm.lpex.core.LpexView view, int iLine)
          Deprecated. use _view.elementText(iElement)
static String getLineTextDBCS(com.ibm.lpex.core.LpexView view, int iLine, boolean bPadDoubleByteCharacters)
          Deprecated. use getElementTextDBCS
static com.ibm.lpex.alef.LpexTextEditor getLpexEditor()
           
static int getMacroLength(String[] straMacroWords, String strLine)
          Returns the macro length or zero if not a macro
static int getMacroType(String[] straMacroWords, String strLine)
          Returns the macro type
static IPath getParseFilePath(IFile sourceFile)
           
static URL getParseFileURL(IFile sourceFile)
           
static IISeriesEditorParser getParserForPrimaryLpexView(com.ibm.lpex.alef.LpexTextEditor editor)
          Determine the parser for the primary lpex view for the lpex editor
static com.ibm.lpex.core.LpexView getPrimaryLpexView(com.ibm.lpex.alef.LpexTextEditor editor)
          Used to retrieve the primary view in an editor
static int getRecordLength(com.ibm.lpex.core.LpexView view)
          Method getRecordLength.
static int getRPGILEAutoIndentValue()
          get RPG ILE auto indent preference value
static IRunnableContext getRunnableContext()
          Returns a progress monitor context.
static String getSignature()
          Get the signature
static int getSQLLength(String[] straSQLWords, String strLine)
          Returns the length of the SQL word, or zero if not an SQL word
static boolean hasSemicolon(String strLine)
          Check for any semi-colon before a comment Port of evfritok.c, semiFound
static boolean indentRPGILECFreeOpcode(String strOpcode)
          determines if the opcode should have the following line indented
static void initializeBasePreferences(com.ibm.lpex.core.LpexView view, IISeriesEditorParser parser)
          Method initializeBasePreferences.
static boolean isCFEnd(String strLine)
          Returns true if CF-Spec start
static boolean isCFStart(String strLine)
          Returns true if CF-Spec end
static boolean isData(String[] straDataWords, String strLine)
          Returns true if line is a DATA statement
static boolean isExtendedFactorTwoOpcode(String[] straXF2_opcodes, String[] straXF2_possible_opcodes, String strLine)
          Returns whether 'C' line an extended Factor2 C spec.
static boolean isMacro(String[] straMacroWords, String strLine)
           
static boolean isNumeric(String strNumeric)
          Returns whether a string is base 10 numeric.
static boolean isPrimaryLpexView(com.ibm.lpex.core.LpexView lpexView)
          Returns if Lpex view is the primary view
static boolean isSlashComment(String strLine, int iIndex)
           
static boolean isSQL(String[] straSQLWords, String strLine)
          Returns true if line is an SQL statement
static boolean isSQLEnd(String strLine)
          Returns true if end of SQL Statement
static boolean isSQLStart(String strLine)
          Returns true if start of SQL Statement
static boolean isWhiteSpace(char c)
          Returns whether a character is white space
static boolean outdentRPGILECFreeOpcode(String strOpcode)
          determines if the opcode should have the current line outdented
static String prependLineWithSignature(String strLine)
          Prepend line with signature (if enabled)
static void refreshAllViews(com.ibm.lpex.alef.LpexTextEditor editor)
          This method refreshs all the views open in an editor.
static void refreshBasePreferences(com.ibm.lpex.core.LpexView view)
          Method refreshBasePreferences.
static void removeAllShowLines(com.ibm.lpex.core.LpexView view)
          Removes all show lines from the bottom of the document to the top, including compile errors.
static void removeAllShowLines(com.ibm.lpex.core.LpexView view, boolean ignoreCompileErrors, com.ibm.lpex.alef.LpexTextEditor editor)
           
static void removeMessages(com.ibm.lpex.alef.LpexTextEditor editor, int iElementStart, int iElementEnd)
           
static void removeMessages(com.ibm.lpex.alef.LpexTextEditor editor, int iElementStart, int iElementEnd, boolean ignoreCompileErrors)
           
static void selectionLinesChanged(com.ibm.lpex.alef.LpexTextEditor _editor, int iLineOrigin, int iLineExtent, int iLineCursor, int startPosition, int selectedLength)
          Called when the selection has changed in the content outline view.
static void selectionLinesChanged(com.ibm.lpex.alef.LpexTextEditor _editor, com.ibm.lpex.core.LpexView _view, int iLineOrigin, int iLineExtent, int iLineCursor, int startPosition, int selectedLength)
          Called when the selection has changed in the content outline view.
static void setDateArea(com.ibm.lpex.alef.LpexTextEditor editor)
          Method setDateArea for multiple views Configures the window to show the date area as appropriate.
static void setDateArea(com.ibm.lpex.core.LpexView view)
          Method setDateArea.
static void setDateArea(com.ibm.lpex.core.LpexView view, IISeriesEditorParser iSeriesParser)
          Method setDateArea.
static void setDocumentElementText(com.ibm.lpex.core.LpexView view, int iElement, String strElement)
          Associates the text with the editor element line Removes the null at the end of the string
static void setDocumentLineText(com.ibm.lpex.core.LpexView view, int iLine, String strLine)
          Deprecated.  
static void setElementColors(com.ibm.lpex.core.LpexView view, int iElement, String strStyles, boolean bFixedLengthFields)
          Sets an Lpex element's color style.
static void setEncoding(com.ibm.lpex.core.LpexView view, int iCCSID)
          Method setEncoding.
static void setLineColors(com.ibm.lpex.core.LpexView view, int iLine, String strStyles, boolean bFixedLengthFields)
          Deprecated.  
static void setMessageElementColors(com.ibm.lpex.core.LpexView view, int iElement, String strStyles)
          Sets the style colours for a message element where everything is in Unicode, so no DBCS considerations are applied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

_bundle

protected static ResourceBundle _bundle
the resource bundle

Constructor Detail

ISeriesEditorUtilities

public ISeriesEditorUtilities()
Method Detail

cleanupMenuBar

public static void cleanupMenuBar(IMenuManager menuManager,
                                  ISeriesEditorConnectListener cl)
Method cleanupMenuBar. used to remove the menu items when switching editors

Parameters:
menuManager - the menu to remove items from

cleanupToolbar

public static void cleanupToolbar(IToolBarManager toolBarManager)
Method cleanupToolbar. used to clean up toolbar items

Parameters:
toolBarManager - the toolbar to remove items from

compileMemberInEditor

public static void compileMemberInEditor(ISeriesMember mbr,
                                         com.ibm.etools.systems.editor.SystemTextEditor editor)
Compile the member that is in the editor using the last used compile command for the member type Prompts if the editor is dirty (unsaved changes)

Parameters:
mbr -
editor -

getFullFilePath

public static String getFullFilePath(ITextEditor editor)
Method getFullFilePath. retrieves the full file path from the IFile

Parameters:
editor - the editor that the file is open in
Returns:
String the full path name

getCompileSelectionObject

public static StructuredSelection getCompileSelectionObject(ITextEditor editor)
Method getCompileSelectionObject. retrieves the object needed for the compile actions

Parameters:
editor - the editor that the source is open in
Returns:
StructuredSelection the selection object to pass to the compile actions

getCCSID

public static int getCCSID(IFile iFile,
                           ISeriesConnection connection)
Method getCCSID. Retrieves the CCSID for a parser. Called by the parsers AND the verifiers! CCSID is retrieved in the following manner:

the iFile properties are retrieved and the CCSID stored within is checked

1) if the CCSID is not 0, and not 65535, then that is the CCSID used 2) If the CCSID is 0 or 65535, then

a) if the user is connected, then the active job CCSID is used. b) if the user is disconnected, the cache is first checked for CCSID, if found then that CCSID is used

c) if the user is disconnected and if the cache doesn't contain a CCSID (the user never signed on), then the session property is used

d) if the user is disconnected and if the session property doesn't exist then the user is prompted to signon (unless working offline). If signon successful, then the job CCSID is used. The Session property is set to this CCSID.

e) If the signon failed (user pressed cancel) then the CCSID defaults to 37, and the session CCSID is set to 37.

Returns:
int the CCSID that the parser should use.

contributeCompileMenuItems

public static void contributeCompileMenuItems(ITextEditor editor,
                                              IMenuManager menuCompile,
                                              Shell shell)
Method contributeCompileMenuItems. Add the menu items to the compile menu

Parameters:
editor - the editor that the source is open in
menuCompile - the compile menu

contributeBaseToolbarItems

public static void contributeBaseToolbarItems(ITextEditor editor,
                                              IToolBarManager toolBarManager)
Method contributeBaseToolbarItems. add toolbar items if necessary

Parameters:
editor - the editor for the items
toolBarManager - the toolbar manager

doSaving

public static void doSaving(com.ibm.lpex.core.LpexView view)
Method doSaving. Called by the parsers before saving

Parameters:
view -

createCompileMenu

public static IMenuManager createCompileMenu(ITextEditor editor,
                                             IMenuManager menuManager,
                                             IMenuManager compileMenu,
                                             IISeriesEditorParser parser)
Method createCompileMenu. Creates the compile menu

Parameters:
editor - the lpex text editor to add the source menu
menuManager - the menu manager
Returns:
IMenuManager the source menu, so additional items can be added by the parser

createLanguageHelpMenu

public static IMenuManager createLanguageHelpMenu(ITextEditor editor,
                                                  IMenuManager menuManager,
                                                  String strPrefix,
                                                  IMenuManager langHelpMenu)
Method createLangaugeHelpMenu. Creates the language help menu on the Help menu

Parameters:
editor -
menuManager - the menu manager
strPrefix - the prefix for the item from the resource bundle
Returns:
IMenuManager the language help menu, so additional items can be added by the parser

createSourceMenu

public static IMenuManager createSourceMenu(ITextEditor editor,
                                            IMenuManager menuManager,
                                            IMenuManager sourceMenu)
Method createSourceMenu. Creates the source menu and adds the common menu items

Parameters:
editor - the lpex text editor to add the source menu
menuManager - the menu manager
Returns:
IMenuManager the source menu, so additional items can be added by the parser

determineRPGCSpecOpcode

public static String determineRPGCSpecOpcode(String strLineText,
                                             boolean bILE)
Determine the opcode of a C spec line (returned uppercased)

Parameters:
strLineText - - a c spec line
bILE - - true if ILE RPG
Returns:
opcode - uppercased opcode or ""

determineRPGCSpecOpcode

public static String determineRPGCSpecOpcode(String strLineText,
                                             boolean bILE,
                                             boolean bPreserveCase)
Determine the opcode of a C spec line (preserve case)

Parameters:
strLineText - - a c spec line
bILE - - true if ILE RPG
bPreserveCase - - indicates if case should be preserved
Returns:
opcode - uppercased opcode or ""

determineRPGCFreeSpecOpcode

public static String determineRPGCFreeSpecOpcode(String strLineText)
Determine the opcode of a C free spec line (returned uppercased)

Parameters:
strLineText - - a c free spec line
Returns:
opcode - uppercased opcode or ""

determineRPGOpcode

public static String determineRPGOpcode(String strLineText,
                                        boolean bILE)
Determine the opcode of a RPG line (returned uppercased)

Parameters:
strLineText - - a line
Returns:
opcode - uppercased opcode or ""

generateTabString

public static String generateTabString(int[] iatabs)
generateTabString From an Integer array, generate a string representing the int array


getBaseEditorAction

public static TextEditorAction getBaseEditorAction(ITextEditor editor,
                                                   String actionId)
Method getBaseEditorAction. Retrieves and creates (if necessary) the common editor action needed to put in the source menu

Parameters:
editor - the editor to which the action belongs to
actionId - the id of the action to retrieve
Returns:
TextEditorAction the action retrieved from or created for the editor

getCurrentLine

public static int getCurrentLine(com.ibm.lpex.core.LpexView view)
Deprecated.  

Returns the current line


getDataLength

public static int getDataLength(String[] straDataWords,
                                String strLine)
Returns the length of a data word, or zero if not a data word.


setDateArea

public static void setDateArea(com.ibm.lpex.alef.LpexTextEditor editor)
Method setDateArea for multiple views Configures the window to show the date area as appropriate.

Since:
6.0 57887

setDateArea

public static void setDateArea(com.ibm.lpex.core.LpexView view)
Method setDateArea. Configures the window to show the date area as appropriate.


setDateArea

public static void setDateArea(com.ibm.lpex.core.LpexView view,
                               IISeriesEditorParser iSeriesParser)
Method setDateArea. Configures the window to show the date area as appropriate. Normally setDateArea(LpexView) is called. This method is used when the view is being initialized and the parser has not been set in the view yet

Since:
6.0 58407

getDocumentLineBottom

public static int getDocumentLineBottom(com.ibm.lpex.core.LpexView view)
Deprecated. Get the bottom most line that is not a show line


getDocumentElementBottom

public static int getDocumentElementBottom(com.ibm.lpex.core.LpexView view)
Get the bottom most element


getDocumentLineNext

public static int getDocumentLineNext(com.ibm.lpex.core.LpexView view,
                                      int iLine)
Deprecated.  

Get the next line that is not a show line


getDocumentElementNext

public static int getDocumentElementNext(com.ibm.lpex.core.LpexView view,
                                         int iElement)
Get the next element that is not a show line


getDocumentLinePrevious

public static int getDocumentLinePrevious(com.ibm.lpex.core.LpexView view,
                                          int iLine)
Deprecated.  

Get the previous line that is not a show line


getDocumentElementPrevious

public static int getDocumentElementPrevious(com.ibm.lpex.core.LpexView view,
                                             int iElement)
Get the previous line that is not a show line


getDocumentLineText

public static String getDocumentLineText(com.ibm.lpex.core.LpexView view,
                                         int iLine)
Deprecated.  

Returns the view element's text appended with a null.


getDocumentElementText

public static String getDocumentElementText(com.ibm.lpex.core.LpexView view,
                                            int iElement)
Returns the view element's text appended with a null.


getDocumentLineTextDBCS

public static String getDocumentLineTextDBCS(com.ibm.lpex.core.LpexView view,
                                             int iLine,
                                             boolean bPadDoubleByteCharacters)
Deprecated.  

Returns a zero terminated line of text. If the source encoding is DBCS,


getDocumentElementTextDBCS

public static String getDocumentElementTextDBCS(com.ibm.lpex.core.LpexView view,
                                                int iElement,
                                                boolean bPadDoubleByteCharacters)
Returns a zero terminated line of text. If the source encoding is DBCS,


getDocumentLineTop

public static int getDocumentLineTop(com.ibm.lpex.core.LpexView view)
Deprecated.  

Returns the top most line that is not a show line


getDocumentElementTop

public static int getDocumentElementTop(com.ibm.lpex.core.LpexView view)
Returns the top most Element


getDocumentNumberOfLines

public static int getDocumentNumberOfLines(com.ibm.lpex.core.LpexView view)
Method getDocumentNumberOfLines. Retrieve the number of lines in a document

Parameters:
view - the view in which the document is open
Returns:
int the number of lines in a document

getLineText

public static String getLineText(com.ibm.lpex.core.LpexView view,
                                 int iLine)
Deprecated. use _view.elementText(iElement)

Returns the text of the given line. If the codepage is a DBCS codepage, then, shift in, shift out and padding characters are added.


getLineTextDBCS

public static String getLineTextDBCS(com.ibm.lpex.core.LpexView view,
                                     int iLine,
                                     boolean bPadDoubleByteCharacters)
Deprecated. use getElementTextDBCS

Returns a line of text. If the source encoding is DBCS,


getElementTextDBCS

public static String getElementTextDBCS(com.ibm.lpex.core.LpexView view,
                                        int iElement,
                                        boolean bPadDoubleByteCharacters)
Returns a line of text. If the source encoding is DBCS,


getMacroLength

public static int getMacroLength(String[] straMacroWords,
                                 String strLine)
Returns the macro length or zero if not a macro


getMacroType

public static int getMacroType(String[] straMacroWords,
                               String strLine)
Returns the macro type


getIFile

public static IFile getIFile(ITextEditor editor)
Method getIFile. retrieves the IFile object for source open in an editor

Parameters:
editor - the editor in which the source is open
Returns:
IFile the IFile found

getISeriesConnection

public static ISeriesConnection getISeriesConnection(ITextEditor editor)
Method getISeriesConnection. Given a text editor, determine the connection (if any) for the source

Parameters:
editor - the text editor to find the connection for
Returns:
ISeriesConnection the connection found, or null if there is no ISeriesConnection for the source (ie local source)

getISeriesMember

public static ISeriesMember getISeriesMember(ITextEditor editor)
Method getISeriesMember. Returns the ISeriesMember given the text editor

Parameters:
editor - the editor that the member is open in
Returns:
ISeriesMember the ISeriesMember object for this editor, null if source is not a member

getCommonFilterMenuItems

public static String getCommonFilterMenuItems()
Method getCommonFilterMenuItems. returns the list of common filter items as pairs of (menu string, LpexAction name)

Returns:
String the list of common filter item: By Date

getParserForPrimaryLpexView

public static IISeriesEditorParser getParserForPrimaryLpexView(com.ibm.lpex.alef.LpexTextEditor editor)
Determine the parser for the primary lpex view for the lpex editor

Parameters:
editor -
Returns:
parser

getRecordLength

public static int getRecordLength(com.ibm.lpex.core.LpexView view)
Method getRecordLength. Returns the record length for the source

Parameters:
view - the view which contains the source
Returns:
int the record length, 0 if there is no record length (ie local file)

getRunnableContext

public static IRunnableContext getRunnableContext()
Returns a progress monitor context.


getRPGILEAutoIndentValue

public static int getRPGILEAutoIndentValue()
get RPG ILE auto indent preference value

Returns:
0-20

getSignature

public static String getSignature()
Get the signature

Returns:
null if signature not enabled, otherwise 5 character signature

getSQLLength

public static int getSQLLength(String[] straSQLWords,
                               String strLine)
Returns the length of the SQL word, or zero if not an SQL word


hasSemicolon

public static boolean hasSemicolon(String strLine)
Check for any semi-colon before a comment Port of evfritok.c, semiFound


indentRPGILECFreeOpcode

public static boolean indentRPGILECFreeOpcode(String strOpcode)
determines if the opcode should have the following line indented

Returns:
true if should indent

initializeBasePreferences

public static void initializeBasePreferences(com.ibm.lpex.core.LpexView view,
                                             IISeriesEditorParser parser)
Method initializeBasePreferences. initializes the base parser preferences and applies it to the view

Parameters:
view - the view used to apply the preferences to
parser - the parser for the view

enableMultipleViews

public static void enableMultipleViews(com.ibm.lpex.core.LpexView view)
Enable multiple views in LPEX Editor

Parameters:
view -

isCFEnd

public static boolean isCFEnd(String strLine)
Returns true if CF-Spec start


isCFStart

public static boolean isCFStart(String strLine)
Returns true if CF-Spec end


isSQLStart

public static boolean isSQLStart(String strLine)
Returns true if start of SQL Statement


isSQLEnd

public static boolean isSQLEnd(String strLine)
Returns true if end of SQL Statement


isData

public static boolean isData(String[] straDataWords,
                             String strLine)
Returns true if line is a DATA statement


isExtendedFactorTwoOpcode

public static boolean isExtendedFactorTwoOpcode(String[] straXF2_opcodes,
                                                String[] straXF2_possible_opcodes,
                                                String strLine)
Returns whether 'C' line an extended Factor2 C spec. XF2_opcodes contains the list of opcodes which could take an extended factor 2. (such as CALLP, EVAL, EVALR, RETURN etc.) note: "FOR " is in list instead of "FOR" to account for "FORCE" XF2_possible_opcodes contains the list of opcodes which could or could not take an an extended factor 2 depending on what follows it. Therefore, if the opcode falls into this category, you have to look at the next character to determine whether or not it can take an extended factor 2 (such as DOWxx, DOUxx, IFxx, WHENxx) OUTPUT: returns TRUE if the opcode can take an extended factor 2 FALSE otherwise.


isMacro

public static boolean isMacro(String[] straMacroWords,
                              String strLine)

isNumeric

public static boolean isNumeric(String strNumeric)
Returns whether a string is base 10 numeric.


isPrimaryLpexView

public static boolean isPrimaryLpexView(com.ibm.lpex.core.LpexView lpexView)
Returns if Lpex view is the primary view

Returns:
true if it is the primary view

getLpexEditor

public static com.ibm.lpex.alef.LpexTextEditor getLpexEditor()

getAllLpexViews

public static com.ibm.lpex.core.LpexView[] getAllLpexViews(com.ibm.lpex.alef.LpexTextEditor editor)
Retrieves a list of all the view open in an editor.

Parameters:
editor - the editor to retrieve the view.
Returns:
an array of LpexView. If the view was not split, then there will only be the primary view in the list.
Since:
6.0 57887A

getPrimaryLpexView

public static com.ibm.lpex.core.LpexView getPrimaryLpexView(com.ibm.lpex.alef.LpexTextEditor editor)
Used to retrieve the primary view in an editor

Parameters:
editor - the editor to search for a primary view
Returns:
the primary view if found, null otherwise
Since:
6.0 57887A

refreshAllViews

public static void refreshAllViews(com.ibm.lpex.alef.LpexTextEditor editor)
This method refreshs all the views open in an editor.

It is needed because adding text programmatically (ie wizards)to one view doesn't trigger a parse in all the views.

Parameters:
editor - The editor to refresh all its view.
Since:
6.0 57887A

isSlashComment

public static boolean isSlashComment(String strLine,
                                     int iIndex)
Parameters:
strLine -
iIndex -
Returns:

isSQL

public static boolean isSQL(String[] straSQLWords,
                            String strLine)
Returns true if line is an SQL statement


isWhiteSpace

public static boolean isWhiteSpace(char c)
Returns whether a character is white space


outdentRPGILECFreeOpcode

public static boolean outdentRPGILECFreeOpcode(String strOpcode)
determines if the opcode should have the current line outdented

Returns:
true if should outdent

prependLineWithSignature

public static String prependLineWithSignature(String strLine)
Prepend line with signature (if enabled)

Returns:
updated line

refreshBasePreferences

public static void refreshBasePreferences(com.ibm.lpex.core.LpexView view)
Method refreshBasePreferences. refreshes the base parser preferences and applies them to the specified view

Parameters:
view - the view to apply the preferences to

removeAllShowLines

public static void removeAllShowLines(com.ibm.lpex.core.LpexView view)
Removes all show lines from the bottom of the document to the top, including compile errors.


removeAllShowLines

public static void removeAllShowLines(com.ibm.lpex.core.LpexView view,
                                      boolean ignoreCompileErrors,
                                      com.ibm.lpex.alef.LpexTextEditor editor)

removeMessages

public static void removeMessages(com.ibm.lpex.alef.LpexTextEditor editor,
                                  int iElementStart,
                                  int iElementEnd,
                                  boolean ignoreCompileErrors)

removeMessages

public static void removeMessages(com.ibm.lpex.alef.LpexTextEditor editor,
                                  int iElementStart,
                                  int iElementEnd)

setDocumentLineText

public static void setDocumentLineText(com.ibm.lpex.core.LpexView view,
                                       int iLine,
                                       String strLine)
Deprecated.  

Associates the text with the editor element line Removes the null at the end of the string


setDocumentElementText

public static void setDocumentElementText(com.ibm.lpex.core.LpexView view,
                                          int iElement,
                                          String strElement)
Associates the text with the editor element line Removes the null at the end of the string


setElementColors

public static void setElementColors(com.ibm.lpex.core.LpexView view,
                                    int iElement,
                                    String strStyles,
                                    boolean bFixedLengthFields)
Sets an Lpex element's color style.


setEncoding

public static void setEncoding(com.ibm.lpex.core.LpexView view,
                               int iCCSID)
Method setEncoding. Sets the encoding for a view based on the CCSID

Parameters:
view - the view to set the encoding
iCCSID - the ccsid to convert

setLineColors

public static void setLineColors(com.ibm.lpex.core.LpexView view,
                                 int iLine,
                                 String strStyles,
                                 boolean bFixedLengthFields)
Deprecated.  

Sets an Lpex line's color style.


setMessageElementColors

public static void setMessageElementColors(com.ibm.lpex.core.LpexView view,
                                           int iElement,
                                           String strStyles)
Sets the style colours for a message element where everything is in Unicode, so no DBCS considerations are applied.


getHostConnectionForLocalFile

public static ISeriesConnection getHostConnectionForLocalFile(boolean bPromptAllowed)
Method getHostConnectionForLocalFile. Helper method to retrieve a connection to use for a local file

Parameters:
bPromptAllowed - whether or not the user should be prompted
Returns:
ISeriesConnection the connection specified by the user.

COBOLgetFieldFile

public static ISeriesFile COBOLgetFieldFile(com.ibm.lpex.core.LpexView view,
                                            IISeriesEditorParser parser)
Method COBOLgetFieldFile. Does the getFieldFile logic for all COBOL parsers

Parameters:
view - the view that the show fields action is running in
parser - the parser for the view
Returns:
ISeriesFile the file to show fields

COBOLisValidFieldAction

public static boolean COBOLisValidFieldAction(com.ibm.lpex.core.LpexView view)
Method COBOLisValidFieldAction. returns whether or not the show fields action is valid for a COBOL source

Parameters:
view - the view that the source is open in
Returns:
boolean true if show fields can be run

COBOLisValidIncludeAction

public static boolean COBOLisValidIncludeAction(com.ibm.lpex.core.LpexView view)
Method COBOLisValidIncludeAction. returns whether or not copy book can be edited or browsed for a COBOL source

Parameters:
view - the view that the source is open in
Returns:
boolean true if the action is valid, false otherwise

COBOLgetIncludeMember

public static ISeriesMember COBOLgetIncludeMember(com.ibm.lpex.core.LpexView view,
                                                  IISeriesEditorParser parser,
                                                  boolean ILE)
Method COBOLgetIncludeMember.

Parameters:
view -
parser -
ILE -
Returns:
ISeriesMember

getParseFilePath

public static IPath getParseFilePath(IFile sourceFile)

getParseFileURL

public static URL getParseFileURL(IFile sourceFile)

ensureVisible

public static void ensureVisible(com.ibm.lpex.core.LpexView lpexView,
                                 int element)

selectionLinesChanged

public static void selectionLinesChanged(com.ibm.lpex.alef.LpexTextEditor _editor,
                                         com.ibm.lpex.core.LpexView _view,
                                         int iLineOrigin,
                                         int iLineExtent,
                                         int iLineCursor,
                                         int startPosition,
                                         int selectedLength)
Called when the selection has changed in the content outline view. The line numbers are used to highlight the editor's vertical ruler.

Parameters:
iLineOrigin - - begin of higlighted range
iLineExtent - - number of lines in highlighted range
iLineCursor - - cursored line
startPosition - - column of begin of selection

selectionLinesChanged

public static void selectionLinesChanged(com.ibm.lpex.alef.LpexTextEditor _editor,
                                         int iLineOrigin,
                                         int iLineExtent,
                                         int iLineCursor,
                                         int startPosition,
                                         int selectedLength)
Called when the selection has changed in the content outline view. The line numbers are used to highlight the editor's vertical ruler. Convenience method that selects text in the active view of the given editor

Parameters:
iLineOrigin - - begin of higlighted range
iLineExtent - - number of lines in highlighted range
iLineCursor - - cursored line
startPosition - - column of begin of selection

iSeries Remote Systems
v6.0.0

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.