|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.editor.folding.DefaultFoldingModel
public class DefaultFoldingModel
Default implementation of FoldingModel.
Field Summary | |
---|---|
protected EventListenerList |
_listenerList
|
Constructor Summary | |
---|---|
DefaultFoldingModel(CodeEditor editor)
|
Method Summary | |
---|---|
FoldingSpan |
addFoldingSpan(int startOffset,
int endOffset,
String description)
Adds a folding span to FoldingModel. |
void |
addFoldingSpanListener(FoldingSpanListener l)
Add a listener to the list that's notified each time a change to the line marker occurs. |
void |
changedUpdate(DocumentEvent e)
|
void |
collapseAll()
Collapses all the foldings. |
void |
collapseFoldingSpan(FoldingSpan span)
Collapses the folding span. |
protected FoldingSpan |
createFoldingSpan(int startOffset,
int endOffset,
String description)
Creates the folding span. |
void |
expandAll()
Expands all the foldings. |
protected void |
expandAll(boolean expand)
|
void |
expandFoldingSpan(FoldingSpan span)
Expands the folding span. |
static FoldingSpan |
findFoldingSpanStartingAtLine(CodeEditor editor,
int line)
|
protected void |
fireFoldingSpanChanged(FoldingSpan foldingSpan,
int type,
boolean isAdjusting)
|
void |
foldingSpanUpdated(FoldingSpan span)
When a folding span start or end offset, call this method to tell the folding model. |
int |
getFoldedLinesCountBefore(int offset)
|
FoldingSpan[] |
getFoldedSpansAtOffset(int offset)
|
static FoldingSpan[] |
getFoldingSpanAtOffset(CodeEditor editor,
int i)
|
FoldingSpanListener[] |
getFoldingSpanListeners()
Returns an array of all the FoldingSpanListener s added
to this FoldingModel with addFoldingSpanListener(). |
FoldingSpan[] |
getFoldingSpans()
Gets all the folding spans. |
int |
getLastTopLevelIndexBefore(int offset)
|
FoldingSpan |
getOutermostSpanAtOffset(int offset)
|
FoldingSpan |
getOutermostSpanAtViewPosition(CaretPosition vp)
|
FoldingSpan[] |
getTopLevelSpans()
|
FoldingSpan[] |
getVisibleSpans()
|
boolean |
hasAnySpan(int startOffset,
int endOffset)
|
void |
insertUpdate(DocumentEvent e)
|
boolean |
isAdjusting()
Checks if the folding model is in adjusting model. |
boolean |
isEnabled()
Checks if the folding model is enabled. |
void |
rebuild()
|
void |
removeAllFoldingSpans()
Removes all folding spans that were added before. |
boolean |
removeFoldingSpan(FoldingSpan foldingSpan)
Removes a folding span that was added before. |
void |
removeFoldingSpanListener(FoldingSpanListener l)
Remove a listener from the list that's notified each time a change to the line marker occurs. |
void |
removeUpdate(DocumentEvent e)
|
void |
resetCaretPosition()
|
void |
setAdjusting(boolean adjusting)
Sets the folding model to or from the adjusting mode. |
void |
setEnabled(boolean enabled)
Enables or disables this folding model. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected EventListenerList _listenerList
Constructor Detail |
---|
public DefaultFoldingModel(CodeEditor editor)
Method Detail |
---|
public FoldingSpan addFoldingSpan(int startOffset, int endOffset, String description)
FoldingModel
FoldingSpanEvent.FOLDING_SPAN_ADDED
will be fired.
addFoldingSpan
in interface FoldingModel
startOffset
- the start offset, inclusiveendOffset
- the end offset, exclusivedescription
- the description of the folding span
protected FoldingSpan createFoldingSpan(int startOffset, int endOffset, String description)
startOffset
- the starting offset.endOffset
- the end offset.description
- the description of the span.
public boolean removeFoldingSpan(FoldingSpan foldingSpan)
FoldingModel
FoldingSpanEvent.FOLDING_SPAN_REMOVED
will be fired if the folding span is removed
successfully.
removeFoldingSpan
in interface FoldingModel
foldingSpan
- the folding span
public void removeAllFoldingSpans()
FoldingModel
removeAllFoldingSpans
in interface FoldingModel
public boolean isAdjusting()
FoldingModel
isAdjusting
in interface FoldingModel
public void setAdjusting(boolean adjusting)
FoldingModel
setAdjusting
in interface FoldingModel
adjusting
- the flagpublic void expandFoldingSpan(FoldingSpan span)
FoldingModel
expandFoldingSpan
in interface FoldingModel
span
- the folding spanpublic void collapseFoldingSpan(FoldingSpan span)
FoldingModel
collapseFoldingSpan
in interface FoldingModel
span
- the folding spanprotected void expandAll(boolean expand)
public void expandAll()
FoldingModel
expandAll
in interface FoldingModel
public void collapseAll()
FoldingModel
collapseAll
in interface FoldingModel
public void foldingSpanUpdated(FoldingSpan span)
FoldingModel
foldingSpanUpdated
in interface FoldingModel
span
- the folding spanpublic FoldingSpan[] getFoldingSpans()
FoldingModel
getFoldingSpans
in interface FoldingModel
public void setEnabled(boolean enabled)
FoldingModel
setEnabled
in interface FoldingModel
enabled
- the flagpublic boolean isEnabled()
FoldingModel
isEnabled
in interface FoldingModel
protected void fireFoldingSpanChanged(FoldingSpan foldingSpan, int type, boolean isAdjusting)
public void addFoldingSpanListener(FoldingSpanListener l)
FoldingModel
addFoldingSpanListener
in interface FoldingModel
l
- the FoldingSpanListenerpublic void removeFoldingSpanListener(FoldingSpanListener l)
FoldingModel
removeFoldingSpanListener
in interface FoldingModel
l
- the FoldingSpanListenerFoldingModel.addFoldingSpanListener(com.jidesoft.editor.folding.FoldingSpanListener)
public FoldingSpanListener[] getFoldingSpanListeners()
FoldingModel
FoldingSpanListener
s added
to this FoldingModel with addFoldingSpanListener().
getFoldingSpanListeners
in interface FoldingModel
FoldingSpanListener
s added or an empty
array if no listeners have been addedpublic String toString()
toString
in class Object
public void rebuild()
public int getLastTopLevelIndexBefore(int offset)
public int getFoldedLinesCountBefore(int offset)
public FoldingSpan[] getTopLevelSpans()
public FoldingSpan getOutermostSpanAtViewPosition(CaretPosition vp)
public FoldingSpan getOutermostSpanAtOffset(int offset)
public FoldingSpan[] getFoldedSpansAtOffset(int offset)
public boolean hasAnySpan(int startOffset, int endOffset)
public FoldingSpan[] getVisibleSpans()
public void insertUpdate(DocumentEvent e)
insertUpdate
in interface DocumentListener
public void removeUpdate(DocumentEvent e)
removeUpdate
in interface DocumentListener
public void changedUpdate(DocumentEvent e)
changedUpdate
in interface DocumentListener
public void resetCaretPosition()
public static FoldingSpan findFoldingSpanStartingAtLine(CodeEditor editor, int line)
public static FoldingSpan[] getFoldingSpanAtOffset(CodeEditor editor, int i)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |