本文整理汇总了Java中com.intellij.util.containers.SortedList类的典型用法代码示例。如果您正苦于以下问题:Java SortedList类的具体用法?Java SortedList怎么用?Java SortedList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortedList类属于com.intellij.util.containers包,在下文中一共展示了SortedList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTellStatementResolveScope
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@NotNull
public static SortedList<PsiElement> getTellStatementResolveScope(PsiElement myElement) {
SortedList<PsiElement> resultList = new SortedList<>((e1, e2) -> e2.getTextOffset() - e1.getTextOffset());
PsiElement tellStatement = myElement;
while (tellStatement != null) {
tellStatement = tellStatement.getParent();
if (tellStatement instanceof AppleScriptTellSimpleStatement || tellStatement instanceof AppleScriptTellCompoundStatement) {
resultList.add(tellStatement);
}
}
return resultList;
}
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:13,代码来源:AppleScriptResolveUtil.java
示例2: getApplicationNameForElementInsideTellStatement
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
public static List<String> getApplicationNameForElementInsideTellStatement(PsiElement element) {
SortedList<PsiElement> resolveScope = AppleScriptResolveUtil.getTellStatementResolveScope(element);
List<String> result = new ArrayList<>();
for (PsiElement tellStatement : resolveScope) {
String appRef = findApplicationNameFromTellStatement(tellStatement);
if (!StringUtil.isEmpty(appRef)) {
result.add(appRef);
}
}
return result;
}
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:12,代码来源:AppleScriptPsiImplUtil.java
示例3: getChildren
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@NotNull
public Collection<DTree> getChildren() {
init();
if (myChildrenList == null) {
myChildrenList = new SortedList<DTree>(COMPARATOR);
myChildrenList.addAll(myChildren.values());
}
return myChildrenList;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:DTree.java
示例4: sorted
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
public static List<RatedResolveResult> sorted(List<RatedResolveResult> targets) {
if (targets.size() == 1) {
return targets;
}
List<RatedResolveResult> ret = new SortedList<RatedResolveResult>(new Comparator<RatedResolveResult>() {
public int compare(final RatedResolveResult one, final RatedResolveResult another) {
return another.getRate() - one.getRate();
}
});
ret.addAll(targets);
return ret;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:RatedResolveResult.java
示例5: CaptureRootNode
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
public CaptureRootNode() {
myTypes = new SortedList<CaptureTypeNode>(new Comparator<CaptureTypeNode>() {
@Override
public int compare(CaptureTypeNode a, CaptureTypeNode b) {
return a.getName().compareToIgnoreCase(b.getName());
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CaptureRootNode.java
示例6: CaptureTypeNode
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
public CaptureTypeNode(CaptureType type) {
myType = type;
myCaptureNodes = new SortedList<CaptureNode>(new Comparator<CaptureNode>() {
@Override
public int compare(CaptureNode a, CaptureNode b) {
return a.getName().compareToIgnoreCase(b.getName());
}
});
getTemplatePresentation().addText(type.getName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
setIcon(AllIcons.Modules.SourceFolder);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:CaptureTypeNode.java
示例7: addBeforeAfterTemplateFilesGutterIcon
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
private static void addBeforeAfterTemplateFilesGutterIcon(PsiElement highlightingElement,
PsiDirectory descriptionDirectory,
Collection<? super RelatedItemLineMarkerInfo> result) {
final List<PsiFile> templateFiles = new SortedList<PsiFile>(new Comparator<PsiFile>() {
@Override
public int compare(PsiFile o1, PsiFile o2) {
return o1.getName().compareTo(o2.getName());
}
});
for (PsiFile file : descriptionDirectory.getFiles()) {
final String fileName = file.getName();
if (fileName.endsWith(".template")) {
if (fileName.startsWith("after.") ||
fileName.startsWith("before.")) {
templateFiles.add(file);
}
}
}
if (templateFiles.isEmpty()) return;
final RelatedItemLineMarkerInfo<PsiElement> info = NavigationGutterIconBuilder
.create(AllIcons.Actions.Diff, CONVERTER, RELATED_ITEM_PROVIDER)
.setTargets(templateFiles)
.setPopupTitle("Select Template")
.setTooltipText("Before/After Templates")
.setAlignment(GutterIconRenderer.Alignment.RIGHT)
.createLineMarkerInfo(highlightingElement);
result.add(info);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:DescriptionTypeRelatedItemLineMarkerProvider.java
示例8: addChildren
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@Override
public void addChildren(@NotNull final XValueChildrenProvider children, final boolean last) {
DebuggerUIUtil.invokeLater(new Runnable() {
@Override
public void run() {
if (myValueChildren == null) {
if (!isAlreadySorted() && XDebuggerSettingsManager.getInstance().getDataViewSettings().isSortValues()) {
myValueChildren = new SortedList<XValueNodeImpl>(XValueNodeImpl.COMPARATOR);
}
else {
myValueChildren = new ArrayList<XValueNodeImpl>();
}
}
List<XValueContainerNode<?>> newChildren = new SmartList<XValueContainerNode<?>>();
for (int i = 0; i < children.size(); i++) {
XValueNodeImpl node = new XValueNodeImpl(myTree, XValueContainerNode.this, children.getName(i), children.getValue(i));
myValueChildren.add(node);
newChildren.add(node);
}
myCachedAllChildren = null;
fireNodesInserted(newChildren);
if (last) {
final int[] ints = getNodesIndices(myTemporaryMessageChildren);
final TreeNode[] removed = getChildNodes(ints);
myCachedAllChildren = null;
myTemporaryMessageChildren = null;
fireNodesRemoved(ints, removed);
}
myTree.childrenLoaded(XValueContainerNode.this, newChildren, last);
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:XValueContainerNode.java
示例9: computeLineNumbers
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@Nullable
private static Map<String, Integer> computeLineNumbers(FileAnnotation fileAnnotation) {
final SortedList<VcsFileRevision> revisions = new SortedList<VcsFileRevision>(new Comparator<VcsFileRevision>() {
@Override
public int compare(VcsFileRevision o1, VcsFileRevision o2) {
try {
final int result = o1.getRevisionDate().compareTo(o2.getRevisionDate());
return result != 0 ? result : o1.getRevisionNumber().compareTo(o2.getRevisionNumber());
}
catch (Exception e) {
return 0;
}
}
});
final Map<String, Integer> numbers = new HashMap<String, Integer>();
final List<VcsFileRevision> fileRevisionList = fileAnnotation.getRevisions();
if (fileRevisionList != null) {
revisions.addAll(fileRevisionList);
for (VcsFileRevision revision : fileRevisionList) {
final String revNumber = revision.getRevisionNumber().asString();
if (!numbers.containsKey(revNumber)) {
final int num = revisions.indexOf(revision);
if (num != -1) {
numbers.put(revNumber, num + 1);
}
}
}
}
return numbers.size() < 2 ? null : numbers;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:AnnotateToggleAction.java
示例10: toList
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
private String[] toList(PsiMethod[] beforeMethods) {
SortedList<String> result = new SortedList<String>(String.CASE_INSENSITIVE_ORDER);
for (PsiMethod method : beforeMethods) {
result.add(method.getName());
}
return result.toArray(new String[result.size()]);
}
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:8,代码来源:AbstractLombokParsingTestCase.java
示例11: getChildren
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@Nonnull
public Collection<DTree> getChildren() {
init();
if (myChildrenList == null) {
myChildrenList = new SortedList<DTree>(COMPARATOR);
myChildrenList.addAll(myChildren.values());
}
return myChildrenList;
}
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:DTree.java
示例12: promote
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@Override
public List<AnAction> promote(List<AnAction> actions, DataContext context) {
final SortedList<AnAction> result = new SortedList<AnAction>(ACTION_BUTTONS_SORTER);
result.addAll(actions);
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ToolbarDecoratorActionPromoter.java
示例13: addChildren
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@Override
public void addChildren(@NotNull final XValueChildrenList children, final boolean last) {
if (myObsolete) return;
invokeNodeUpdate(new Runnable() {
@Override
public void run() {
if (myObsolete) return;
List<XValueContainerNode<?>> newChildren;
if (children.size() > 0) {
newChildren = new ArrayList<XValueContainerNode<?>>(children.size());
if (myValueChildren == null) {
if (!myAlreadySorted && XDebuggerSettingsManager.getInstance().getDataViewSettings().isSortValues()) {
myValueChildren = new SortedList<XValueNodeImpl>(XValueNodeImpl.COMPARATOR);
}
else {
myValueChildren = new ArrayList<XValueNodeImpl>(children.size());
}
}
final InlineDebuggerHelper inlineHelper = getTree().getEditorsProvider().getInlineDebuggerHelper();
for (int i = 0; i < children.size(); i++) {
XValueNodeImpl node = new XValueNodeImpl(myTree, XValueContainerNode.this, children.getName(i), children.getValue(i));
myValueChildren.add(node);
newChildren.add(node);
if (Registry.is("ide.debugger.inline") && inlineHelper.shouldEvaluateChildrenByDefault(node) && isUseGetChildrenHack(myTree)) { //todo[kb]: try to generify this dirty hack
node.getChildren();
}
}
}
else {
newChildren = new SmartList<XValueContainerNode<?>>();
if (myValueChildren == null) {
myValueChildren = last ? Collections.<XValueNodeImpl>emptyList() : new SmartList<XValueNodeImpl>();
}
}
myTopGroups = createGroupNodes(children.getTopGroups(), myTopGroups, newChildren);
myBottomGroups = createGroupNodes(children.getBottomGroups(), myBottomGroups, newChildren);
myCachedAllChildren = null;
fireNodesInserted(newChildren);
if (last && myTemporaryMessageChildren != null) {
final int[] ints = getNodesIndices(myTemporaryMessageChildren);
final TreeNode[] removed = myTemporaryMessageChildren.toArray(new TreeNode[myTemporaryMessageChildren.size()]);
myCachedAllChildren = null;
myTemporaryMessageChildren = null;
fireNodesRemoved(ints, removed);
}
myTree.childrenLoaded(XValueContainerNode.this, newChildren, last);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:XValueContainerNode.java
示例14: getElements
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@Override
@NotNull
public Iterable<HistoryElement> getElements(@NotNull final List<SFinishedBuild> builds) {
final SortedList<SFinishedBuild> sortedBuilds = new SortedList<SFinishedBuild>(new Comparator<SFinishedBuild>() {
@Override
public int compare(final SFinishedBuild o1, final SFinishedBuild o2) {
return o1.getFinishDate().compareTo(o2.getFinishDate());
}
});
sortedBuilds.addAll(builds);
return new Iterable<HistoryElement>() {
@Override
public Iterator<HistoryElement> iterator() {
return new Iterator<HistoryElement>() {
private int index = 0;
@Override
public boolean hasNext() {
return index < sortedBuilds.size();
}
@Override
public HistoryElement next() {
final int curIndex = index++;
return new HistoryElement() {
@Nullable
@Override
public BigDecimal tryGetValue(@NotNull final String key) {
return myStorage.getValues(sortedBuilds.get(curIndex)).get(key);
}
};
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
开发者ID:JetBrains,项目名称:teamcity-dottrace,代码行数:44,代码来源:HistoryImpl.java
示例15: addChildren
import com.intellij.util.containers.SortedList; //导入依赖的package包/类
@Override
public void addChildren(@Nonnull final XValueChildrenList children, final boolean last) {
if (myObsolete) return;
invokeNodeUpdate(() -> {
if (myObsolete) return;
List<XValueContainerNode<?>> newChildren;
if (children.size() > 0) {
newChildren = new ArrayList<>(children.size());
if (myValueChildren == null) {
if (!myAlreadySorted && XDebuggerSettingsManager.getInstance().getDataViewSettings().isSortValues()) {
myValueChildren = new SortedList<>(XValueNodeImpl.COMPARATOR);
}
else {
myValueChildren = new ArrayList<>(children.size());
}
}
boolean valuesInline = XDebuggerSettingsManager.getInstance().getDataViewSettings().isShowValuesInline();
InlineDebuggerHelper inlineHelper = getTree().getEditorsProvider().getInlineDebuggerHelper();
for (int i = 0; i < children.size(); i++) {
XValueNodeImpl node = new XValueNodeImpl(myTree, this, children.getName(i), children.getValue(i));
myValueChildren.add(node);
newChildren.add(node);
if (valuesInline && inlineHelper.shouldEvaluateChildrenByDefault(node) && isUseGetChildrenHack(myTree)) { //todo[kb]: try to generify this dirty hack
node.getChildren();
}
}
}
else {
newChildren = new SmartList<>();
if (myValueChildren == null) {
myValueChildren = new SmartList<>();
}
}
myTopGroups = createGroupNodes(children.getTopGroups(), myTopGroups, newChildren);
myBottomGroups = createGroupNodes(children.getBottomGroups(), myBottomGroups, newChildren);
myCachedAllChildren = null;
fireNodesInserted(newChildren);
if (last && myTemporaryMessageChildren != null) {
final int[] ints = getNodesIndices(myTemporaryMessageChildren);
final TreeNode[] removed = myTemporaryMessageChildren.toArray(new TreeNode[myTemporaryMessageChildren.size()]);
myCachedAllChildren = null;
myTemporaryMessageChildren = null;
fireNodesRemoved(ints, removed);
}
myTree.childrenLoaded(this, newChildren, last);
});
}
开发者ID:consulo,项目名称:consulo,代码行数:50,代码来源:XValueContainerNode.java
注:本文中的com.intellij.util.containers.SortedList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论