本文整理汇总了Java中com.intellij.openapi.editor.actions.TextComponentEditorAction类的典型用法代码示例。如果您正苦于以下问题:Java TextComponentEditorAction类的具体用法?Java TextComponentEditorAction怎么用?Java TextComponentEditorAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextComponentEditorAction类属于com.intellij.openapi.editor.actions包,在下文中一共展示了TextComponentEditorAction类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: compare
点赞 3
import com.intellij.openapi.editor.actions.TextComponentEditorAction; //导入依赖的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;
}
开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:20,
代码来源:EditorTextFieldProviderImpl.java
示例2: compare
点赞 2
import com.intellij.openapi.editor.actions.TextComponentEditorAction; //导入依赖的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;
}
开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:11,
代码来源:EditorTextFieldActionPromoter.java
示例3: update
点赞 2
import com.intellij.openapi.editor.actions.TextComponentEditorAction; //导入依赖的package包/类
public void update(AnActionEvent event){
Presentation presentation = event.getPresentation();
Editor editor = TextComponentEditorAction.getEditorFromContext(event.getDataContext());
presentation.setEnabled(editor != null);
}
开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:6,
代码来源:SelectAllAction.java
示例4: updatePopup
点赞 2
import com.intellij.openapi.editor.actions.TextComponentEditorAction; //导入依赖的package包/类
@SuppressWarnings("SSBasedInspection")
private void updatePopup() {
check();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
myListModel.update();
myList.revalidate();
myList.repaint();
myRenderer.recalculateWidth();
if (myBalloon == null || myBalloon.isDisposed()) {
return;
}
if (myPopup == null || !myPopup.isVisible()) {
final ActionCallback callback = ListDelegationUtil.installKeyboardDelegation(getField().getTextEditor(), myList);
JBScrollPane content = new JBScrollPane(myList);
content.setMinimumSize(new Dimension(myBalloon.getSize().width, 30));
final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(content, null);
myPopup = builder.setRequestFocus(false).setCancelKeyEnabled(false).setCancelCallback(new Computable<Boolean>() {
@Override
public Boolean compute() {
return myBalloon == null || myBalloon.isDisposed() || (!getField().getTextEditor().hasFocus() && !mySkipFocusGain);
}
}).createPopup();
myPopup.setMinimumSize(new Dimension(myBalloon.getSize().width, 30));
myPopup.getContent().setBorder(new EmptyBorder(0, 0, 0, 0));
Disposer.register(myPopup, new Disposable() {
@Override
public void dispose() {
callback.setDone();
resetFields();
myNonProjectCheckBox.setSelected(false);
ActionToolbarImpl.updateAllToolbarsImmediately();
if (myActionEvent != null && myActionEvent.getInputEvent() instanceof MouseEvent) {
final Component component = myActionEvent.getInputEvent().getComponent();
if (component != null) {
final JLabel label = UIUtil.getParentOfType(JLabel.class, component);
if (label != null) {
label.setIcon(AllIcons.Actions.FindPlain);
}
}
}
myActionEvent = null;
}
});
myPopup.show(new RelativePoint(getField().getParent(), new Point(0, getField().getParent().getHeight())));
//updatePopupBounds();
ActionManager.getInstance().addAnActionListener(new AnActionListener.Adapter() {
@Override
public void beforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
if (action instanceof TextComponentEditorAction) {
return;
}
myPopup.cancel();
}
}, myPopup);
}
else {
myList.revalidate();
myList.repaint();
}
ScrollingUtil.ensureSelectionExists(myList);
if (myList.getModel().getSize() > 0) {
updatePopupBounds();
}
}
});
}
开发者ID:consulo,
项目名称:consulo,
代码行数:71,
代码来源:SearchEverywhereAction.java