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


Java Navigatable.canNavigate方法代码示例

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


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

示例1: actionPerformed

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  if (project == null) return;

  OccurenceNavigator navigator = getNavigator(e.getDataContext());
  if (navigator == null) {
    return;
  }
  if (!hasOccurenceToGo(navigator)) {
    return;
  }
  OccurenceNavigator.OccurenceInfo occurenceInfo = go(navigator);
  if (occurenceInfo == null) {
    return;
  }
  Navigatable descriptor = occurenceInfo.getNavigateable();
  if (descriptor != null && descriptor.canNavigate()) {
    descriptor.navigate(false);
  }
  if(occurenceInfo.getOccurenceNumber()==-1||occurenceInfo.getOccurencesCount()==-1){
    return;
  }
  WindowManager.getInstance().getStatusBar(project).setInfo(
    IdeBundle.message("message.occurrence.N.of.M", occurenceInfo.getOccurenceNumber(), occurenceInfo.getOccurencesCount()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:OccurenceNavigatorActionBase.java

示例2: doubleClick

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
private void doubleClick(final Object object) {
  if (object instanceof Navigatable) {
    Navigatable navigatable = (Navigatable)object;
    if (navigatable.canNavigate()) {
      navigatable.navigate(true);
    }
  }
  else if (object instanceof Module) {
    ProjectView projectView = ProjectView.getInstance(myProject);
    AbstractProjectViewPane projectViewPane = projectView.getProjectViewPaneById(projectView.getCurrentViewId());
    if (projectViewPane != null) {
      projectViewPane.selectModule((Module)object, true);
    }
  }
  else if (object instanceof Project) {
    return;
  }
  hideHint(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:NavBarPanel.java

示例3: navigate

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
public void navigate(final Project project) {
  DefaultPsiElementListCellRenderer renderer = new DefaultPsiElementListCellRenderer();

  final JList list = new JBList(myPsiFiles);
  list.setCellRenderer(renderer);

  final PopupChooserBuilder builder = new PopupChooserBuilder(list);
  renderer.installSpeedSearch(builder);

  final Runnable runnable = new Runnable() {
    public void run() {
      int[] ids = list.getSelectedIndices();
      if (ids == null || ids.length == 0) return;
      Object[] selectedElements = list.getSelectedValues();
      for (Object element : selectedElements) {
        Navigatable descriptor = EditSourceUtil.getDescriptor((PsiElement)element);
        if (descriptor != null && descriptor.canNavigate()) {
          descriptor.navigate(true);
        }
      }
    }
  };

  final Editor editor = CommonDataKeys.EDITOR.getData(DataManager.getInstance().getDataContext());

  builder.
    setTitle("Choose file").
    setItemChoosenCallback(runnable).
    createPopup().showInBestPositionFor(editor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:YourkitFilter.java

示例4: getNavigatableForNode

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Nullable
private static Navigatable getNavigatableForNode(@NotNull DefaultMutableTreeNode node) {
  Object userObject = node.getUserObject();
  if (userObject instanceof Navigatable) {
    final Navigatable navigatable = (Navigatable)userObject;
    return navigatable.canNavigate() ? navigatable : null;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:UsageViewImpl.java

示例5: navigate

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
public static void navigate(final boolean requestFocus, final Navigatable...navigatables) {
  if (navigatables == null) return;
  for (Navigatable navigatable : navigatables) {
    if (navigatable.canNavigate()) {
      navigatable.navigate(requestFocus);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:OpenSourceUtil.java

示例6: performEditAction

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
protected boolean performEditAction() {
  Navigatable data = CommonDataKeys.NAVIGATABLE.getData(DataManager.getInstance().getDataContext(myList));
  if (data != null && data.canNavigate()) {
    data.navigate(true);
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:FinderRecursivePanel.java

示例7: navigateToSource

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
private void navigateToSource(final boolean focusEditor) {
  NavigatableMessageElement element = getSelectedMessageElement();
  if (element == null) {
    return;
  }
  final Navigatable navigatable = element.getNavigatable();
  if (navigatable.canNavigate()) {
    navigatable.navigate(focusEditor);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:NewErrorTreeViewPanel.java

示例8: findTargetForUpdate

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Nullable
private Navigatable findTargetForUpdate(@NotNull DataContext dataContext) {
  Navigatable[] navigatables = getNavigatables(dataContext);
  if (navigatables == null) return null;

  for (Navigatable navigatable : navigatables) {
    if (navigatable.canNavigate()) {
      return navigatable instanceof PomTargetPsiElement ? ((PomTargetPsiElement)navigatable).getTarget() : navigatable;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:BaseNavigateToSourceAction.java

示例9: navigate

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate(boolean requestFocus) {
  Navigatable navigatable = myBreakpoint.getNavigatable();
  if (navigatable != null && navigatable.canNavigate()) {
    navigatable.navigate(requestFocus);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:XBreakpointItem.java

示例10: selectElement

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void selectElement(PsiElement element) {
  myPanel.getModel().updateModel(element);

  if (element instanceof Navigatable) {
    final Navigatable navigatable = (Navigatable)element;
    if (navigatable.canNavigate()) {
      ((Navigatable)element).navigate(true);
    }
  }
  myPanel.hideHint();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:NavBarIdeView.java

示例11: execute

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
protected void execute(@NotNull Project project) {
  Navigatable openFile = new OpenFileDescriptor(project, myFileLocation.file, myFileLocation.lineNumber, myFileLocation.column, false);
  if (openFile.canNavigate()) {
    openFile.navigate(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:BuildFileComponentVersionReader.java

示例12: execute

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
protected void execute(@NotNull Project project) {
  VirtualFile projectFile = project.getProjectFile();
  if (projectFile == null) {
    // This is the default project. This will NEVER happen.
    return;
  }
  VirtualFile file = projectFile.getParent().getFileSystem().findFileByPath(myFilePath);
  if (file != null) {
    Navigatable openFile = new OpenFileDescriptor(project, file, myLineNumber, myColumn, false);
    if (openFile.canNavigate()) {
      openFile.navigate(true);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:OpenFileHyperlink.java

示例13: navigateToSource

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
private void navigateToSource(boolean focusEditor) {
  NavigatableMessageElement element = getSelectedMessageElement();
  if (element == null) {
    return;
  }
  Navigatable navigatable = element.getNavigatable();
  if (navigatable.canNavigate()) {
    navigatable.navigate(focusEditor);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GradleBuildTreeViewPanel.java

示例14: canNavigate

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public boolean canNavigate() {
  Navigatable navigatable = myBreakpoint.getNavigatable();
  return navigatable != null && navigatable.canNavigate();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:XBreakpointItem.java

示例15: gotoTargetElement

import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
private static void gotoTargetElement(PsiElement element) {
  Navigatable navigatable = element instanceof Navigatable ? (Navigatable)element : EditSourceUtil.getDescriptor(element);
  if (navigatable != null && navigatable.canNavigate()) {
    navigatable.navigate(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:GotoDeclarationAction.java


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