本文整理汇总了Java中com.intellij.openapi.editor.impl.EditorImpl.getFoldingModel方法的典型用法代码示例。如果您正苦于以下问题:Java EditorImpl.getFoldingModel方法的具体用法?Java EditorImpl.getFoldingModel怎么用?Java EditorImpl.getFoldingModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.editor.impl.EditorImpl
的用法示例。
在下文中一共展示了EditorImpl.getFoldingModel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EditorWindowImpl
import com.intellij.openapi.editor.impl.EditorImpl; //导入方法依赖的package包/类
private EditorWindowImpl(@Nonnull DocumentWindowImpl documentWindow,
@Nonnull final EditorImpl delegate,
@Nonnull PsiFile injectedFile,
boolean oneLine) {
myDocumentWindow = documentWindow;
myDelegate = delegate;
myInjectedFile = injectedFile;
myOneLine = oneLine;
myCaretModelDelegate = new CaretModelWindow(myDelegate.getCaretModel(), this);
mySelectionModelDelegate = new SelectionModelWindow(myDelegate, myDocumentWindow,this);
myMarkupModelDelegate = new MarkupModelWindow(myDelegate.getMarkupModel(), myDocumentWindow);
myDocumentMarkupModelDelegate = new MarkupModelWindow(myDelegate.getFilteredDocumentMarkupModel(), myDocumentWindow);
myFoldingModelWindow = new FoldingModelWindow(delegate.getFoldingModel(), documentWindow, this);
mySoftWrapModel = new SoftWrapModelWindow();
myInlayModel = new InlayModelWindow();
}
示例2: EditorWindowImpl
import com.intellij.openapi.editor.impl.EditorImpl; //导入方法依赖的package包/类
private EditorWindowImpl(@NotNull DocumentWindowImpl documentWindow,
@NotNull final EditorImpl delegate,
@NotNull PsiFile injectedFile,
boolean oneLine) {
myDocumentWindow = documentWindow;
myDelegate = delegate;
myInjectedFile = injectedFile;
myOneLine = oneLine;
myCaretModelDelegate = new CaretModelWindow(myDelegate.getCaretModel(), this);
mySelectionModelDelegate = new SelectionModelWindow(myDelegate, myDocumentWindow,this);
myMarkupModelDelegate = new MarkupModelWindow(myDelegate.getMarkupModel(), myDocumentWindow);
myFoldingModelWindow = new FoldingModelWindow(delegate.getFoldingModel(), documentWindow, this);
mySoftWrapModel = new SoftWrapModelWindow(this);
}
示例3: EditorWindow
import com.intellij.openapi.editor.impl.EditorImpl; //导入方法依赖的package包/类
private EditorWindow(@NotNull DocumentWindowImpl documentWindow, @NotNull final EditorImpl delegate, @NotNull PsiFile injectedFile, boolean oneLine) {
myDocumentWindow = documentWindow;
myDelegate = delegate;
myInjectedFile = injectedFile;
myOneLine = oneLine;
myCaretModelDelegate = new CaretModelWindow(myDelegate.getCaretModel(), this);
mySelectionModelDelegate = new SelectionModelWindow(myDelegate, myDocumentWindow,this);
myMarkupModelDelegate = new MarkupModelWindow((MarkupModelEx)myDelegate.getMarkupModel(), myDocumentWindow);
myFoldingModelWindow = new FoldingModelWindow(delegate.getFoldingModel(), documentWindow, this);
}
示例4: init
import com.intellij.openapi.editor.impl.EditorImpl; //导入方法依赖的package包/类
private void init(EditorView view, int startOffset, int startLogicalLine, int currentOrPrevWrapIndex, int nextFoldingIndex,
@Nullable Runnable quickEvaluationListener) {
myQuickEvaluationListener = quickEvaluationListener;
myView = view;
EditorImpl editor = view.getEditor();
myDocument = editor.getDocument();
FoldingModelEx foldingModel = editor.getFoldingModel();
FoldRegion[] regions = foldingModel.fetchTopLevel();
myRegions = regions == null ? FoldRegion.EMPTY_ARRAY : regions;
SoftWrapModelImpl softWrapModel = editor.getSoftWrapModel();
List<? extends SoftWrap> softWraps = softWrapModel.getRegisteredSoftWraps();
SoftWrap currentOrPrevWrap = currentOrPrevWrapIndex < 0 || currentOrPrevWrapIndex >= softWraps.size() ? null :
softWraps.get(currentOrPrevWrapIndex);
SoftWrap followingWrap = (currentOrPrevWrapIndex + 1) < 0 || (currentOrPrevWrapIndex + 1) >= softWraps.size() ? null :
softWraps.get(currentOrPrevWrapIndex + 1);
myVisualLineStartOffset = mySegmentStartOffset = startOffset;
myCurrentFoldRegionIndex = nextFoldingIndex;
myCurrentEndLogicalLine = startLogicalLine;
myCurrentX = myView.getInsets().left;
if (mySegmentStartOffset == 0) {
myCurrentX += myView.getPrefixTextWidthInPixels();
}
else if (currentOrPrevWrap != null && mySegmentStartOffset == currentOrPrevWrap.getStart()) {
myCurrentX += currentOrPrevWrap.getIndentInPixels();
myCurrentVisualColumn = currentOrPrevWrap.getIndentInColumns();
}
myNextWrapOffset = followingWrap == null ? Integer.MAX_VALUE : followingWrap.getStart();
setInlaysAndFragmentIterator();
}
示例5: VisualLineFragmentsIterator
import com.intellij.openapi.editor.impl.EditorImpl; //导入方法依赖的package包/类
private VisualLineFragmentsIterator(EditorView view, int offset, boolean beforeSoftWrap, @Nullable Runnable quickEvaluationListener) {
myQuickEvaluationListener = quickEvaluationListener;
myView = view;
EditorImpl editor = view.getEditor();
myDocument = editor.getDocument();
FoldingModelEx foldingModel = editor.getFoldingModel();
FoldRegion[] regions = foldingModel.fetchTopLevel();
myRegions = regions == null ? FoldRegion.EMPTY_ARRAY : regions;
int visualLineStartOffset = EditorUtil.getNotFoldedLineStartOffset(editor, offset);
SoftWrapModelImpl softWrapModel = editor.getSoftWrapModel();
List<? extends SoftWrap> softWraps = softWrapModel.getRegisteredSoftWraps();
int currentOrPrevWrapIndex = softWrapModel.getSoftWrapIndex(offset);
if (currentOrPrevWrapIndex < 0) {
currentOrPrevWrapIndex = - currentOrPrevWrapIndex - 2;
}
else if (beforeSoftWrap) {
currentOrPrevWrapIndex--;
}
SoftWrap currentOrPrevWrap = currentOrPrevWrapIndex < 0 || currentOrPrevWrapIndex >= softWraps.size() ? null :
softWraps.get(currentOrPrevWrapIndex);
SoftWrap followingWrap = (currentOrPrevWrapIndex + 1) >= softWraps.size() ? null : softWraps.get(currentOrPrevWrapIndex + 1);
if (currentOrPrevWrap != null && currentOrPrevWrap.getStart() > visualLineStartOffset) {
visualLineStartOffset = currentOrPrevWrap.getStart();
}
myVisualLineStartOffset = mySegmentStartOffset = visualLineStartOffset;
myCurrentFoldRegionIndex = foldingModel.getLastCollapsedRegionBefore(mySegmentStartOffset) + 1;
myCurrentEndLogicalLine = myDocument.getLineNumber(mySegmentStartOffset);
if (mySegmentStartOffset == 0) {
myCurrentX = myView.getPrefixTextWidthInPixels();
}
else if (currentOrPrevWrap != null && mySegmentStartOffset == currentOrPrevWrap.getStart()) {
myCurrentX = currentOrPrevWrap.getIndentInPixels();
myCurrentVisualColumn = currentOrPrevWrap.getIndentInColumns();
}
myNextWrapOffset = followingWrap == null ? Integer.MAX_VALUE : followingWrap.getStart();
setFragmentIterator();
}