本文整理汇总了Java中com.intellij.openapi.editor.actionSystem.EditorAction类的典型用法代码示例。如果您正苦于以下问题:Java EditorAction类的具体用法?Java EditorAction怎么用?Java EditorAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EditorAction类属于com.intellij.openapi.editor.actionSystem包,在下文中一共展示了EditorAction类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compare
import com.intellij.openapi.editor.actionSystem.EditorAction; //导入依赖的package包/类
@Override
public int compare(AnAction o1, AnAction o2) {
if (o1 instanceof EditorAction && o2 instanceof EditorAction) {
return 0;
}
if (o1 instanceof TextComponentEditorAction) {
return -1;
}
if (o2 instanceof TextComponentEditorAction) {
return 1;
}
if (o1 instanceof EditorAction) {
return 1;
}
if (o2 instanceof EditorAction) {
return -1;
}
return 0;
}
示例2: compare
import com.intellij.openapi.editor.actionSystem.EditorAction; //导入依赖的package包/类
@Override
public int compare(AnAction o1, AnAction o2) {
boolean textFieldAction1 = o1 instanceof TextComponentEditorAction;
boolean textFieldAction2 = o2 instanceof TextComponentEditorAction;
boolean plainEditorAction1 = o1 instanceof EditorAction && !textFieldAction1;
boolean plainEditorAction2 = o2 instanceof EditorAction && !textFieldAction2;
if (textFieldAction1 && plainEditorAction2) return -1;
if (textFieldAction2 && plainEditorAction1) return 1;
return 0;
}