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


Java ChooseByNameBase.JPanelProvider方法代码示例

本文整理汇总了Java中com.intellij.ide.util.gotoByName.ChooseByNameBase.JPanelProvider方法的典型用法代码示例。如果您正苦于以下问题:Java ChooseByNameBase.JPanelProvider方法的具体用法?Java ChooseByNameBase.JPanelProvider怎么用?Java ChooseByNameBase.JPanelProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ide.util.gotoByName.ChooseByNameBase的用法示例。


在下文中一共展示了ChooseByNameBase.JPanelProvider方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: beforeShown

import com.intellij.ide.util.gotoByName.ChooseByNameBase; //导入方法依赖的package包/类
@Override
public void beforeShown(final LightweightWindowEvent windowEvent) {
  final Lookup activeLookup = LookupManager.getInstance(myProject).getActiveLookup();
  if (activeLookup != null) {
    activeLookup.addLookupListener(new LookupAdapter() {
      @Override
      public void currentItemChanged(LookupEvent event) {
        if (windowEvent.asPopup().isVisible()) { //was not canceled yet
          final LookupElement item = event.getItem();
          if (item != null) {
            PsiElement targetElement = CompletionUtil.getTargetElement(item);
            if (targetElement == null) {
              targetElement = DocumentationManager.getInstance(myProject).getElementFromLookup(activeLookup.getEditor(), activeLookup.getPsiFile());
            }

            updatePopup(targetElement); //open next
          }
        } else {
          activeLookup.removeLookupListener(this);
        }
      }
    });
  }
  else {
    final Component focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent(myProject);
    boolean fromQuickSearch = focusedComponent != null && focusedComponent.getParent() instanceof ChooseByNameBase.JPanelProvider;
    if (fromQuickSearch) {
      ChooseByNameBase.JPanelProvider panelProvider = (ChooseByNameBase.JPanelProvider)focusedComponent.getParent();
      panelProvider.registerHint(windowEvent.asPopup());
    }
    else if (focusedComponent instanceof JComponent) {
      HintUpdateSupply supply = HintUpdateSupply.getSupply((JComponent)focusedComponent);
      if (supply != null) supply.registerHint(windowEvent.asPopup());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:PopupUpdateProcessor.java

示例2: beforeShown

import com.intellij.ide.util.gotoByName.ChooseByNameBase; //导入方法依赖的package包/类
@Override
public void beforeShown(final LightweightWindowEvent windowEvent) {
  final Lookup activeLookup = LookupManager.getInstance(myProject).getActiveLookup();
  if (activeLookup != null) {
    activeLookup.addLookupListener(new LookupAdapter() {
      @Override
      public void currentItemChanged(LookupEvent event) {
        if (windowEvent.asPopup().isVisible()) { //was not canceled yet
          final LookupElement item = event.getItem();
          if (item != null) {
            PsiElement targetElement = CompletionUtil.getTargetElement(item);
            if (targetElement == null) {
              targetElement = DocumentationManager.getInstance(myProject).getElementFromLookup(activeLookup.getEditor(), activeLookup.getPsiFile());
            }

            updatePopup(targetElement); //open next
          }
        } else {
          activeLookup.removeLookupListener(this);
        }
      }
    });
  }
  else {
    final Component focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent(myProject);
    boolean fromQuickSearch = focusedComponent != null && focusedComponent.getParent() instanceof ChooseByNameBase.JPanelProvider;
    if (fromQuickSearch) {
      ChooseByNameBase.JPanelProvider panelProvider = (ChooseByNameBase.JPanelProvider)focusedComponent.getParent();
      panelProvider.registerHint(windowEvent.asPopup());
    } else if (focusedComponent != null) {
      if (focusedComponent instanceof JBListWithHintProvider) {
        ((JBListWithHintProvider)focusedComponent).registerHint(windowEvent.asPopup());
      } else if (focusedComponent instanceof JBTableWithHintProvider) {
        ((JBTableWithHintProvider)focusedComponent).registerHint(windowEvent.asPopup());
      } else if (focusedComponent instanceof JBTreeWithHintProvider) {
        ((JBTreeWithHintProvider)focusedComponent).registerHint(windowEvent.asPopup());
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:41,代码来源:PopupUpdateProcessor.java

示例3: fromQuickSearch

import com.intellij.ide.util.gotoByName.ChooseByNameBase; //导入方法依赖的package包/类
private boolean fromQuickSearch() {
  return myPreviouslyFocused != null && myPreviouslyFocused.getParent() instanceof ChooseByNameBase.JPanelProvider;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DocumentationManager.java

示例4: value

import com.intellij.ide.util.gotoByName.ChooseByNameBase; //导入方法依赖的package包/类
@Override
public boolean value(final Project project) {
  final Component focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent(project);
  boolean fromQuickSearch =  focusedComponent != null && focusedComponent.getParent() instanceof ChooseByNameBase.JPanelProvider;
  return !fromQuickSearch && LookupManager.getInstance(project).getActiveLookup() == null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:NotLookupOrSearchCondition.java


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