本文整理汇总了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()));
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
示例14: canNavigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public boolean canNavigate() {
Navigatable navigatable = myBreakpoint.getNavigatable();
return navigatable != null && navigatable.canNavigate();
}
示例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);
}
}