本文整理汇总了Java中com.intellij.ide.util.treeView.smartTree.Sorter类的典型用法代码示例。如果您正苦于以下问题:Java Sorter类的具体用法?Java Sorter怎么用?Java Sorter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Sorter类属于com.intellij.ide.util.treeView.smartTree包,在下文中一共展示了Sorter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GCMStructureViewModel
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
public GCMStructureViewModel(@NotNull PsiFile psiFile, @NotNull final GCMStructureViewRootElement root, Editor editor) {
super(psiFile, root);
withSorters(typeSorter, Sorter.ALPHA_SORTER);
editor.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent event) {
synchronized (needRefresh) {
needRefresh = true;
}
}
});
executor.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
GCMStructureViewModel.this.refreshView();
}
}, 15, 5, TimeUnit.SECONDS);
}
示例2: getComparator
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@Override
public Comparator getComparator() {
return new Comparator() {
@Override
public int compare(Object o1, Object o2) {
if (o1.getClass() == o2.getClass()) {
if (o1 instanceof GCMStructureViewReferenceElement) {
if (((GCMStructureViewReferenceElement) o1).isAttribute() && !((GCMStructureViewReferenceElement) o2).isAttribute()) { //atr <-> !attr
return -1;
} else if (!((GCMStructureViewReferenceElement) o1).isAttribute() && ((GCMStructureViewReferenceElement) o2).isAttribute()) {// !atr <-> attr
return 1;
}
}
return Sorter.ALPHA_SORTER.getComparator().compare(o1, o2);
}
if (o1 instanceof GCMStructureViewClassElement) {
return 1;
} else if (o1 instanceof GCMStructureViewPackageElement) {
return -1;
} else if (o1 instanceof GCMStructureViewReferenceElement) {
return 1;
} else if (o1 instanceof GCMStructureViewParentElement) {
return -1;
}
return 0;
}
};
}
示例3: isActionActive
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@Override
public boolean isActionActive(String name) {
for (final Sorter sorter : myModel.getSorters()) {
if (sorter.getName().equals(name)) {
if (!sorter.isVisible()) return true;
}
}
for(TreeAction action: myActions) {
if (action.getName().equals(name)) return true;
}
return Sorter.ALPHA_SORTER_ID.equals(name);
}
示例4: selectNextIncompleteProperty
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
public void selectNextIncompleteProperty() {
if (getSelectedNodes().size() != 1) {
return;
}
final IProperty selectedProperty = getSelectedProperty();
if (selectedProperty == null) {
return;
}
final ResourceBundleFileStructureViewElement root =
(ResourceBundleFileStructureViewElement)myStructureViewComponent.getTreeModel().getRoot();
final Set<String> propertyKeys = ResourceBundleFileStructureViewElement.getPropertiesMap(myResourceBundle, root.isShowOnlyIncomplete()).keySet();
final boolean isAlphaSorted = myStructureViewComponent.isActionActive(Sorter.ALPHA_SORTER_ID);
final List<String> keysOrder = new ArrayList<String>(propertyKeys);
if (isAlphaSorted) {
Collections.sort(keysOrder);
}
final String currentKey = selectedProperty.getKey();
final int idx = keysOrder.indexOf(currentKey);
LOG.assertTrue(idx != -1);
final IgnoredPropertiesFilesSuffixesManager
ignoredPropertiesFilesSuffixesManager = IgnoredPropertiesFilesSuffixesManager.getInstance(myProject);
for (int i = 1; i < keysOrder.size(); i++) {
int trimmedIndex = (i + idx) % keysOrder.size();
final String key = keysOrder.get(trimmedIndex);
if (!ignoredPropertiesFilesSuffixesManager.isPropertyComplete(myResourceBundle, key)) {
selectProperty(key);
return;
}
}
}
示例5: createStructureViewModel
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
@Override
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new SchemaStructureViewModel(schemaFile, editor, new SchemaStructureViewElement(schemaFile))
.withSorters(Sorter.ALPHA_SORTER)
.withSuitableClasses(
SchemaFile.class,
SchemaTypeDef.class,
SchemaSupplementDef.class,
SchemaFieldDecl.class,
SchemaEntityTagDecl.class,
SchemaEnumMemberDecl.class,
SchemaAnnotation.class
);
}
示例6: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@Override
@NotNull
public Sorter[] getSorters() {
return new Sorter[] {
ViewStructureAction.isInStructureViewPopup(this) ? KindSorter.POPUP_INSTANCE : KindSorter.INSTANCE,
VisibilitySorter.INSTANCE,
AnonymousClassesSorter.INSTANCE,
Sorter.ALPHA_SORTER};
}
示例7: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@Override
@NotNull
public Sorter[] getSorters()
{
if(TreeStructureUtil.isInStructureViewPopup(this))
{
return Sorter.EMPTY_ARRAY; // because in popup there's no option to disable sorter
}
return ourSorters;
}
示例8: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@Override
@NotNull
public Sorter[] getSorters()
{
return new Sorter[]{
TreeStructureUtil.isInStructureViewPopup(this) ? KindSorter.POPUP_INSTANCE : KindSorter.INSTANCE,
VisibilitySorter.INSTANCE,
AnonymousClassesSorter.INSTANCE,
Sorter.ALPHA_SORTER
};
}
示例9: AppleScriptStructureViewModel
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
AppleScriptStructureViewModel(@NotNull PsiFile psiFile, @Nullable Editor editor) {
super(psiFile, editor, new AppleScriptStructureViewElement(psiFile));
withSorters(Sorter.ALPHA_SORTER);
withSuitableClasses(AppleScriptScriptBody.class, AppleScriptScriptObject.class);
}
示例10: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
return new Sorter[]{Sorter.ALPHA_SORTER};
}
示例11: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
return new Sorter[]{Sorter.ALPHA_SORTER};
}
示例12: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@Override
@NotNull
public Sorter[] getSorters() {
return Sorter.EMPTY_ARRAY;
}
示例13: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
return new Sorter[]{Sorter.ALPHA_SORTER};
}
示例14: getSorters
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
return new Sorter[] {Sorter.ALPHA_SORTER};
}
示例15: FusionStructureViewModel
import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
public FusionStructureViewModel(Editor editor, PsiFile file) {
super(editor, file);
this.fusionFile = (FusionFile) file;
this.mySorters = new Sorter[]{Sorter.ALPHA_SORTER};
}