• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EditorComponentImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.editor.impl.EditorComponentImpl的典型用法代码示例。如果您正苦于以下问题:Java EditorComponentImpl类的具体用法?Java EditorComponentImpl怎么用?Java EditorComponentImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EditorComponentImpl类属于com.intellij.openapi.editor.impl包,在下文中一共展示了EditorComponentImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: _accept

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
private static boolean _accept(final JComponent component) {
  if (!component.isEnabled() || !component.isVisible() || !component.isFocusable()) {
    return false;
  }

  /** TODO[anton,vova] implement Policy in Editor component instead */
  if (component instanceof EditorComponentImpl || component instanceof EditorWindowHolder) {
    return true;
  }

  if(component instanceof JTextComponent){
    return ((JTextComponent)component).isEditable();
  }

  return
    component instanceof AbstractButton ||
    component instanceof JList ||
    component instanceof JTree ||
    component instanceof JTable ||
    component instanceof JComboBox;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:IdeFocusTraversalPolicy.java


示例2: focusedComponentChanged

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Override
protected void focusedComponentChanged(final Component component, final AWTEvent cause) {
  if (myWindowManager.getCommandProcessor().getCommandCount() > 0 || component == null) {
    return;
  }
  final KeyboardFocusManager mgr = KeyboardFocusManager.getCurrentKeyboardFocusManager();
  final Component owner = mgr.getFocusOwner();

  if (owner instanceof EditorComponentImpl && cause instanceof FocusEvent) {
    JFrame frame = WindowManager.getInstance().getFrame(myProject);
    Component oppositeComponent = ((FocusEvent)cause).getOppositeComponent();
    if (oppositeComponent != null && UIUtil.getWindow(oppositeComponent) != frame) {
      return;
    }
  }

  IdeFocusManager.getInstance(myProject).doWhenFocusSettlesDown(new ExpirableRunnable.ForProject(myProject) {
    @Override
    public void run() {
      if (mgr.getFocusOwner() == owner) {
        activateEditorComponent(false);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ToolWindowManagerImpl.java


示例3: update

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  final LookupEx lookup;
  if (myInput instanceof EditorTextField) {
    lookup = LookupManager.getActiveLookup(((EditorTextField)myInput).getEditor());
  } else if (myInput instanceof EditorComponentImpl) {
    lookup = LookupManager.getActiveLookup(((EditorComponentImpl)myInput).getEditor());
  } else {
    lookup = null;
  }

  JComboBox comboBox = UIUtil.findComponentOfType(myInput, JComboBox.class);
  boolean popupMenuVisible = comboBox != null && comboBox.isPopupVisible();

  e.getPresentation().setEnabled(lookup == null && !popupMenuVisible);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:UpDownHandler.java


示例4: _accept

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
private static boolean _accept(final JComponent component) {
  if (!component.isEnabled() || !component.isVisible() || !component.isFocusable()) {
    return false;
  }

  /* TODO[anton,vova] implement Policy in Editor component instead */
  if (component instanceof EditorComponentImpl || component instanceof EditorWindowHolder) {
    return true;
  }

  if (component instanceof JTextComponent) {
    return ((JTextComponent)component).isEditable();
  }

  return component instanceof AbstractButton ||
         component instanceof JList ||
         component instanceof JTree ||
         component instanceof JTable ||
         component instanceof JComboBox;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:IdeFocusTraversalPolicy.java


示例5: focusedComponentChanged

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Override
protected void focusedComponentChanged(final Component component, final AWTEvent cause) {
  if (myCommandProcessor.getCommandCount() > 0 || component == null) {
    return;
  }
  final KeyboardFocusManager mgr = KeyboardFocusManager.getCurrentKeyboardFocusManager();
  final Component owner = mgr.getFocusOwner();

  if (owner instanceof EditorComponentImpl && cause instanceof FocusEvent) {
    JFrame frame = WindowManager.getInstance().getFrame(myProject);
    Component oppositeComponent = ((FocusEvent)cause).getOppositeComponent();
    if (oppositeComponent != null && UIUtil.getWindow(oppositeComponent) != frame) {
      return;
    }
  }

  IdeFocusManager.getInstance(myProject).doWhenFocusSettlesDown(new ExpirableRunnable.ForProject(myProject) {
    @Override
    public void run() {
      if (mgr.getFocusOwner() == owner) {
        activateEditorComponent();
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:DesktopToolWindowManagerImpl.java


示例6: getEditorFromFocus

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Nullable
private static Editor getEditorFromFocus() {
  final Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
  if (c instanceof EditorComponentImpl) {
    return ((EditorComponentImpl)c).getEditor();
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:RenameTo.java


示例7: moveFocusOnDelete

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
private static boolean moveFocusOnDelete() {
  final Window window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow();
  if (window != null) {
    final Component component = FocusTrackback.getFocusFor(window);
    if (component != null) {
      return component instanceof EditorComponentImpl;
    }
    return window instanceof IdeFrameImpl;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FileEditorManagerImpl.java


示例8: getEditorFromFocus

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Nullable
private static Editor getEditorFromFocus() {
    final Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (c instanceof EditorComponentImpl) {
        return ((EditorComponentImpl) c).getEditor();
    }
    return null;
}
 
开发者ID:vsch,项目名称:idea-multimarkdown,代码行数:9,代码来源:TypoRenameToQuickFix.java


示例9: calculate_position

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
private Point calculate_position(Component component, int imageWidth, int imageHeight) {
    Point p = new Point();

    Rectangle rect = ((EditorComponentImpl) component).getVisibleRect();
    int position_x = 0;
    switch (this.editorSetting.imageHorizonPositionNo) {
        // 右に表示
        case 0:
            position_x = rect.x;
            break;
        // 中央に表示
        case 1:
            position_x = rect.x + (rect.width - imageWidth) / 2;
            break;
        // 左に表示
        case 2:
            position_x = rect.x + rect.width - imageWidth;
            break;
    }
    int position_y = 0;
    switch (this.editorSetting.imageVerticalPositionNo) {
        // 上に表示
        case 0:
            position_y = rect.y;
            break;
        // 中央に表示
        case 1:
            position_y = rect.y + (rect.height - imageHeight) / 2;
            break;
        // 下に表示
        case 2:
            position_y = rect.y + rect.height - imageHeight;
            break;
    }

    p.setLocation(position_x, position_y);

    return p;
}
 
开发者ID:MitI-7,项目名称:IDEOM,代码行数:40,代码来源:WallPaper.java


示例10: getData

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Override
public Object getData(@NonNls String dataId) {
  if (myProject.isDisposed()) {
    throw new RuntimeException("TestDataProvider is already disposed for " + myProject + "\n" +
                               "If you closed a project in test, please reset IdeaTestApplication.setDataProvider.");
  }

  if (PlatformDataKeys.PROJECT.is(dataId)) {
    return myProject;
  }
  else if (PlatformDataKeys.EDITOR.is(dataId) || OpenFileDescriptor.NAVIGATE_IN_EDITOR.is(dataId)) {
    return FileEditorManager.getInstance(myProject).getSelectedTextEditor();
  }
  else {
    Editor editor = (Editor)getData(PlatformDataKeys.EDITOR.getName());
    if (editor != null) {
      FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(myProject);
      Object managerData = manager.getData(dataId, editor, manager.getSelectedFiles()[0]);
      if (managerData != null) {
        return managerData;
      }
      JComponent component = editor.getContentComponent();
      if (component instanceof EditorComponentImpl) {
        return ((EditorComponentImpl)component).getData(dataId);
      }
    }
    return null;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:TestDataProvider.java


示例11: update

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
  final LookupEx lookup;
  if (myInput instanceof EditorTextField) {
    lookup = LookupManager.getActiveLookup(((EditorTextField)myInput).getEditor());
  } else if (myInput instanceof EditorComponentImpl) {
    lookup = LookupManager.getActiveLookup(((EditorComponentImpl)myInput).getEditor());
  } else {
    lookup = null;
  }

  e.getPresentation().setEnabled(lookup == null);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:UpDownHandler.java


示例12: getData

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
@Override
public Object getData(@Nonnull Key<?> dataId) {
  if (myProject.isDisposed()) {
    throw new RuntimeException("TestDataProvider is already disposed for " + myProject + "\n" +
                               "If you closed a project in test, please reset IdeaTestApplication.setDataProvider.");
  }

  if (CommonDataKeys.PROJECT == dataId) {
    return myProject;
  }
  else if (PlatformDataKeys.EDITOR == dataId || OpenFileDescriptor.NAVIGATE_IN_EDITOR == dataId) {
    return FileEditorManager.getInstance(myProject).getSelectedTextEditor();
  }
  else {
    Editor editor = (Editor)getData(PlatformDataKeys.EDITOR);
    if (editor != null) {
      FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(myProject);
      Object managerData = manager.getData(dataId, editor, editor.getCaretModel().getCurrentCaret());
      if (managerData != null) {
        return managerData;
      }
      JComponent component = editor.getContentComponent();
      if (component instanceof EditorComponentImpl) {
        return ((EditorComponentImpl)component).getData(dataId);
      }
    }
    return null;
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:TestDataProvider.java


示例13: getComponentType

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
private static String getComponentType(JComponent component) {
  return component instanceof JTree ? "tree" :
         component instanceof JList ? "list" :
         component instanceof JTable ? "table" :
         component instanceof JViewport ? "viewport" :
         component instanceof ActionToolbar ? "toolbar" :
         component instanceof EditorComponentImpl ? "editor" :
         component instanceof EditorGutterComponentEx ? "editor" :
         component instanceof JBLoadingPanel ? "loading" :
         component instanceof JBTabs ? "tabs" :
         component instanceof JBPanelWithEmptyText ? "panel" :
         component instanceof JPanel && ourKnownNames.contains(component.getName()) ? component.getName() :
         null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:IdeBackgroundUtil.java


示例14: isEditorComponent

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
private boolean isEditorComponent(Object source) {
    return source.getClass() == EditorComponentImpl.class;
}
 
开发者ID:treytrahin,项目名称:force-shortcuts-intellij-plugin,代码行数:4,代码来源:ForceShortcuts.java


示例15: showHint

import com.intellij.openapi.editor.impl.EditorComponentImpl; //导入依赖的package包/类
protected boolean showHint(final JComponent component) {
  myInsideShow = true;
  if (myCurrentHint != null) {
    myCurrentHint.hide();
  }
  myCurrentHint = new LightweightHint(component) {
    @Override
    protected boolean canAutoHideOn(TooltipEvent event) {
      InputEvent inputEvent = event.getInputEvent();
      if (inputEvent instanceof MouseEvent) {
        Component comp = inputEvent.getComponent();
        if (comp instanceof EditorComponentImpl) {
          EditorImpl editor = ((EditorComponentImpl)comp).getEditor();
          return !isInsideCurrentRange(editor, ((MouseEvent)inputEvent).getPoint());
        }
      }
      return true;
    }
  };
  myCurrentHint.addHintListener(new HintListener() {
    @Override
    public void hintHidden(EventObject event) {
      if (myHideRunnable != null && !myInsideShow) {
        myHideRunnable.run();
      }
      onHintHidden();
    }
  });

  // editor may be disposed before later invokator process this action
  if (myEditor.isDisposed() || myEditor.getComponent().getRootPane() == null) {
    return false;
  }

  Point p = HintManagerImpl.getHintPosition(myCurrentHint, myEditor, myEditor.xyToLogicalPosition(myPoint), HintManager.UNDER);
  HintHint hint = HintManagerImpl.createHintHint(myEditor, p, myCurrentHint, HintManager.UNDER, true);
  hint.setShowImmediately(true);
  HintManagerImpl.getInstanceImpl().showEditorHint(myCurrentHint, myEditor, p,
                                                   HintManager.HIDE_BY_ANY_KEY |
                                                   HintManager.HIDE_BY_TEXT_CHANGE |
                                                   HintManager.HIDE_BY_SCROLLING, 0, false,
                                                   hint);
  myInsideShow = false;
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:AbstractValueHint.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JsonTypeResolver类代码示例发布时间:2022-05-22
下一篇:
Java FindAction类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap