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


Java OpenFileAction类代码示例

本文整理汇总了Java中com.intellij.ide.actions.OpenFileAction的典型用法代码示例。如果您正苦于以下问题:Java OpenFileAction类的具体用法?Java OpenFileAction怎么用?Java OpenFileAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: actionPerformed

import com.intellij.ide.actions.OpenFileAction; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
    PhpClass testedClass = getSwitchClass(e);
    if (null == testedClass) {
        return;
    }

    OpenFileAction.openFile(testedClass.getContainingFile().getVirtualFile().getPath(), e.getProject());
}
 
开发者ID:atoum,项目名称:phpstorm-plugin,代码行数:9,代码来源:SwitchContext.java

示例2: navigateToTargetOrFile

import com.intellij.ide.actions.OpenFileAction; //导入依赖的package包/类
/** Returns true if a target or BUILD file could be found and navigated to. */
private static void navigateToTargetOrFile(Project project, VirtualFile vf) {
  // First, find the parent BUILD file. We don't want to navigate to labels in other packages
  BlazePackage parentPackage = getBuildFile(project, vf);
  if (parentPackage == null) {
    return;
  }
  // first, look for a specific target which includes this source file
  PsiElement target = findBuildTarget(project, parentPackage, new File(vf.getPath()));
  if (target instanceof NavigatablePsiElement) {
    ((NavigatablePsiElement) target).navigate(true);
    return;
  }
  OpenFileAction.openFile(parentPackage.buildFile.getFile().getPath(), project);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:16,代码来源:OpenCorrespondingBuildFile.java

示例3: actionPerformed

import com.intellij.ide.actions.OpenFileAction; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(@NotNull AnActionEvent e)
{
	PsiElement psiElement = e.getData(CommonDataKeys.PSI_ELEMENT);
	if(!(psiElement instanceof DotNetVariable))
	{
		return;
	}

	DotNetTypeRef typeRef = ((DotNetVariable) psiElement).toTypeRef(true);

	DotNetTypeResolveResult typeResolveResult = typeRef.resolve();

	PsiElement element = typeResolveResult.getElement();
	if(!(element instanceof DotNetNamedElement))
	{
		return;
	}

	DotNetNamedElement extract = GenericUnwrapTool.extract((DotNetNamedElement) element, typeResolveResult.getGenericExtractor());

	List<StubBlock> stubBlocks = CSharpStubBuilderVisitor.buildBlocks(extract);

	CharSequence text = StubBlockUtil.buildText(stubBlocks);

	LightVirtualFile lightVirtualFile = new LightVirtualFile("dummy.cs", CSharpFileType.INSTANCE, text);

	OpenFileAction.openFile(lightVirtualFile, psiElement.getProject());
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:31,代码来源:OpenTypeFromVariableAction.java

示例4: doOKAction

import com.intellij.ide.actions.OpenFileAction; //导入依赖的package包/类
@Override
protected void doOKAction() {
  OpenFileAction.openFile(fileTextField.getSelectedFile(), project);
  super.doOKAction();
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:6,代码来源:OpenBlazeWorkspaceFileAction.java


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