本文整理汇总了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());
}
}
}
示例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());
}
}
}
}
示例3: fromQuickSearch
import com.intellij.ide.util.gotoByName.ChooseByNameBase; //导入方法依赖的package包/类
private boolean fromQuickSearch() {
return myPreviouslyFocused != null && myPreviouslyFocused.getParent() instanceof ChooseByNameBase.JPanelProvider;
}
示例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;
}