当前位置: 首页>>代码示例>>Java>>正文


Java Sorter类代码示例

本文整理汇总了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);

}
 
开发者ID:datathings,项目名称:greycat-idea-plugin,代码行数:20,代码来源:GCMStructureViewModel.java

示例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;
        }
    };
}
 
开发者ID:datathings,项目名称:greycat-idea-plugin,代码行数:31,代码来源:GCMStructureViewModel.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TreeStructureActionsOwner.java

示例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;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:ResourceBundleEditor.java

示例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
      );
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:16,代码来源:SchemaStructureViewBuilder.java

示例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};
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:JavaFileTreeModel.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:12,代码来源:HtmlStructureViewTreeModel.java

示例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
	};
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:12,代码来源:JavaFileTreeModel.java

示例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);
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:6,代码来源:AppleScriptStructureViewModel.java

示例10: getSorters

import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
    return new Sorter[]{Sorter.ALPHA_SORTER};
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:5,代码来源:StructureViewModel.java

示例11: getSorters

import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
	return new Sorter[]{Sorter.ALPHA_SORTER};
}
 
开发者ID:xylo,项目名称:intellij-postfix-templates,代码行数:5,代码来源:CptStructureViewModel.java

示例12: getSorters

import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@Override
@NotNull
public Sorter[] getSorters() {
    return Sorter.EMPTY_ARRAY;
}
 
开发者ID:SeeSharpSoft,项目名称:intellij-csv-validator,代码行数:6,代码来源:CsvStructureViewModel.java

示例13: getSorters

import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
  return new Sorter[]{Sorter.ALPHA_SORTER};
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:5,代码来源:LuaStructureViewModel.java

示例14: getSorters

import com.intellij.ide.util.treeView.smartTree.Sorter; //导入依赖的package包/类
@NotNull
public Sorter[] getSorters() {
    return new Sorter[] {Sorter.ALPHA_SORTER};
}
 
开发者ID:menshele,项目名称:smcplugin,代码行数:5,代码来源:SmcStructureViewModel.java

示例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};
}
 
开发者ID:cvette,项目名称:intellij-neos,代码行数:6,代码来源:FusionStructureViewModel.java


注:本文中的com.intellij.ide.util.treeView.smartTree.Sorter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。