本文整理汇总了Java中com.intellij.pom.Navigatable.navigate方法的典型用法代码示例。如果您正苦于以下问题:Java Navigatable.navigate方法的具体用法?Java Navigatable.navigate怎么用?Java Navigatable.navigate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.pom.Navigatable
的用法示例。
在下文中一共展示了Navigatable.navigate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: navigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate(final boolean requestFocus) {
if (isPhysical()) {
super.navigate(requestFocus);
return;
}
final PsiNamedElement psiNamedElement = XmlUtil.findRealNamedElement(this);
Navigatable navigatable = PsiNavigationSupport.getInstance().getDescriptor(psiNamedElement);
if (psiNamedElement instanceof XmlEntityDecl) {
navigatable = PsiNavigationSupport.getInstance().createNavigatable(
psiNamedElement.getProject(),
psiNamedElement.getContainingFile().getVirtualFile(),
psiNamedElement.getTextRange().getStartOffset() + psiNamedElement.getText().indexOf(getName())
);
}
if (navigatable != null) {
navigatable.navigate(requestFocus);
}
}
示例2: navigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate( boolean requestFocus )
{
final Navigatable navigatable = PsiNavigationSupport.getInstance().getDescriptor( this );
if( navigatable != null )
{
navigatable.navigate( requestFocus );
}
}
示例3: navigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate(boolean requestFocus) {
final Navigatable navigatable = PsiNavigationSupport.getInstance().getDescriptor(this);
if (navigatable != null) {
navigatable.navigate(requestFocus);
}
}
示例4: 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);
}
示例5: navigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate(final boolean requestFocus) {
Navigatable navigatable = getNavigatableInTemplateLanguageFile();
if (navigatable != null) {
navigatable.navigate(requestFocus);
}
}
示例6: 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);
}
}
}
示例7: 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;
}
示例8: 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);
}
}
示例9: navigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate(boolean requestFocus) {
final Navigatable descriptor = PsiNavigationSupport.getInstance().getDescriptor(this);
if (descriptor != null) {
descriptor.navigate(requestFocus);
}
}
示例10: 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);
}
}
}
示例11: 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);
}
}
示例12: 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);
}
}
示例13: scrollToSource
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
protected void scrollToSource(Component tree) {
if (myAbstractTreeBuilder == null) return;
myAutoscrollFeedback = true;
Navigatable editSourceDescriptor = CommonDataKeys.NAVIGATABLE.getData(DataManager.getInstance().getDataContext(getTree()));
if (myFileEditor != null && editSourceDescriptor != null && editSourceDescriptor.canNavigateToSource()) {
editSourceDescriptor.navigate(false);
}
}
示例14: navigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate(boolean b) {
final Navigatable navigatable = ((Navigatable)myAttribute.getValueElement());
if (navigatable != null) {
navigatable.navigate(b);
}
}
示例15: navigate
import com.intellij.pom.Navigatable; //导入方法依赖的package包/类
@Override
public void navigate(boolean requestFocus) {
Navigatable descriptor = PsiNavigationSupport.getInstance().getDescriptor(this);
if (descriptor != null) {
descriptor.navigate(requestFocus);
}
}