iSeries Remote Systems
v6.0.1

com.ibm.etools.iseries.editor.language.model
Interface IDdsLanguageModel

All Known Implementing Classes:
DdsModelLpexAdapter

public interface IDdsLanguageModel

The DDS Language model embedded in the Lpex editor and synchronized with its contents


Method Summary
 IDdsParserAdapter getDdsCursorListener()
          Return the singleton cursor listener that implements IDdsAdaptable.
 com.ibm.etools.iseries.dds.dom.DdsModel getDdsModel()
          Retrieve DDS model corresponding to the source in the editor.
 boolean incrementallyUpdateModel(int iElement, boolean inserted, boolean updateLineContainerOnly)
          Update the model with the changed/inserted line If we could not do this return true
 void refreshModel()
          Refresh the model by reparsing the changed source in Lpex.
 void refreshModel(int sequenceUpdateRangeBottom, int sequenceUpdateRangeTop)
          Refresh the model by reparsing the changed source in Lpex.
 void reserveSequenceNumbers(int elementFirst, int changedLineCount)
          If inserting a number of lines make sure that the sequence numbers in the LineContainer in the model has room to insert them.
 

Method Detail

getDdsModel

public com.ibm.etools.iseries.dds.dom.DdsModel getDdsModel()
Retrieve DDS model corresponding to the source in the editor. Parse and create model if it does not exist.

Returns:

refreshModel

public void refreshModel()
Refresh the model by reparsing the changed source in Lpex.


refreshModel

public void refreshModel(int sequenceUpdateRangeBottom,
                         int sequenceUpdateRangeTop)
Refresh the model by reparsing the changed source in Lpex. The specified range of lines may have their sequence numbers out of sequence and they should be fixed up if necessary.

Parameters:
sequenceUpdateRangeBottom - element number of the first line to check for resequencing
sequenceUpdateRangeTop - element number of the last line to check for resequencing

getDdsCursorListener

public IDdsParserAdapter getDdsCursorListener()
Return the singleton cursor listener that implements IDdsAdaptable. Lazily create the singleton.


incrementallyUpdateModel

public boolean incrementallyUpdateModel(int iElement,
                                        boolean inserted,
                                        boolean updateLineContainerOnly)
Update the model with the changed/inserted line If we could not do this return true

Parameters:
iElement - - element number of line in Lpex that has been changed or inserted
inserted - - element was inserted if true
updateLineContainerOnly - = if inserting only update the LineContainer -typically because the file level will be reparse anyways but we need the line container to maintain the sequence numbers
Returns:
true if the model needs to be refreshed because we could not successfully update the model incrementally

reserveSequenceNumbers

public void reserveSequenceNumbers(int elementFirst,
                                   int changedLineCount)
If inserting a number of lines make sure that the sequence numbers in the LineContainer in the model has room to insert them. If not increment the sequence number of as many subsequent lines as necessary to accomodate them. By doing this once at the beginning we avoid having to do this for each inserted line, which is an O(n * m/2) operation where n = the number of lines inserted and m = the number of lines in the file.

Parameters:
elementFirst - - the element number of the first line being inserted
changedLineCount - - the number of lines that will be inserted

iSeries Remote Systems
v6.0.1

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.