|
LPEX 4.4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LpexDocumentSectionListener
Interface LpexDocumentSectionListener can be implemented to manage the document section currently loaded in the editor. After loading a document section and setting information regarding the number of lines in the complete document, the application responds to the document-listener notifications by expanding the document section as requested.
Create a listener object using this class, and then register it with a
document view using the view's addLpexDocumentSectionListener()
method. When the editor determines that the currently-loaded document
section must be extended, the addLines() method in the listener
object is invoked.
Example:
lpexView.addLpexDocumentSectionListener(new LpexDocumentSectionListener() {
// we must extend the document section
public boolean addLines(LpexView view, int lineNeeded)
{
return loadItUp(view, lineNeeded);
}
}); |
Note: This feature is only provided for certain specific applications. Normally, the editor loads and operates on complete documents (files).
When an application only loads a section of the document, it should take certain features into consideration:
LpexView.addLpexDocumentSectionListener(com.ibm.lpex.core.LpexDocumentSectionListener),
LpexView.removeLpexDocumentSectionListener(com.ibm.lpex.core.LpexDocumentSectionListener),
LpexView.setLinesOutsideDocumentSection(int, int),
LpexView.linesBeforeStart(),
LpexView.linesAfterEnd()| Method Summary | |
|---|---|
boolean |
addLines(LpexView lpexView,
int lineNeeded)
This method is invoked when it was determined that the currently-loaded document section should be extended. |
| Method Detail |
|---|
boolean addLines(LpexView lpexView,
int lineNeeded)
Scroll down example:
before after
scroll down scroll down
----------------- -----------------
^ | | | | ^
| | | | | |
linesBeforeStart | | | | linesBeforeStart
|XXXXXXXXXXXXXXX| .. |XXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXX| |XXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXX| |XXXXXXXXXXXXXXX|
| cursor | |XXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXX| |XXXXXXXXXXXXXXX|
|XXXXXXXXXXXXXXX| |XXXXXXXXXXXXXXX|
linesAfterEnd | | |XXXXXXXXXXXXXXX|
| | | |XXXXXXXXXXXXXXX|
| | scroll target | .. | cursor |
| | | |XXXXXXXXXXXXXXX|
| | [threshold] | |XXXXXXXXXXXXXXX|
| | | |XXXXXXXXXXXXXXX|
| | lineNeeded | .. |XXXXXXXXXXXXXXX|
| | | | | linesAfterEnd
| | | | | |
v | | | | v
----------------- ----------------- |
lpexView - the view of the editor document which triggered the request
to add lineslineNeeded - the document line delimiting the new range needed to expand
the current document section in the implied direction. This is
true to indicate that the document section has been
updated (any other registered document-section listeners will
not be called)
|
LPEX 4.4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||