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


Java FileStructurePopup类代码示例

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


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

示例1: update

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
@Nullable
public FilteringTreeStructure.FilteringNode update() {
  final Ref<FilteringTreeStructure.FilteringNode> nodeRef = new Ref<FilteringTreeStructure.FilteringNode>();
  final FileStructurePopup popup = getPopup();
  popup.getTreeBuilder().refilter().doWhenProcessed(new Runnable() {
    @Override
    public void run() {
      getStructure().rebuild();
      updateTree();
      getBuilder().updateFromRoot();
      TreeUtil.expandAll(getTree());
      nodeRef.set(popup.selectPsiElement(popup.getCurrentElement(myFile)));
      getBuilder().getUi().select(nodeRef.get(), null);
    }
  });
  return nodeRef.get();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FileStructureTestFixture.java

示例2: getPopup

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
@NotNull
public FileStructurePopup getPopup() {
  if (myPopup == null || myFile != myFixture.getFile()) {
    if (myPopup != null) {
      Disposer.dispose(myPopup);
      myPopup = null;
    }
    myFile = myFixture.getFile();
    myPopup = ViewStructureAction.createPopup(myFixture.getProject(), TextEditorProvider.getInstance().getTextEditor(myFixture.getEditor()));
    assert myPopup != null;
    Disposer.register(this, myPopup);
    myPopup.createCenterPanel();
    myPopup.getTreeBuilder().getUi().getUpdater().setPassThroughMode(true);
  }
  return myPopup;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FileStructureTestFixture.java

示例3: installTree

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
private void installTree() {
  getTree().getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
  myAutoScrollToSourceHandler.install(getTree());
  myAutoScrollFromSourceHandler.install();

  TreeUtil.installActions(getTree());

  new TreeSpeedSearch(getTree(), new Convertor<TreePath, String>() {
    @Override
    public String convert(final TreePath treePath) {
      final DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent();
      final Object userObject = node.getUserObject();
      if (userObject != null) {
        return FileStructurePopup.getSpeedSearchText(userObject);
      }
      return null;
    }
  });

  addTreeKeyListener();
  addTreeMouseListeners();
  restoreState();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:StructureViewComponent.java

示例4: isHtml5SectionsMode

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
private boolean isHtml5SectionsMode() {
  final XmlFile xmlFile = getElement();
  if (xmlFile == null) return false;

  if (myInStructureViewPopup) {
    final String propertyName = FileStructurePopup.getPropertyName(Html5SectionsNodeProvider.HTML5_OUTLINE_PROVIDER_PROPERTY);
    if (PropertiesComponent.getInstance().getBoolean(propertyName, false)) {
      return true;
    }
  }
  else if (StructureViewFactoryEx.getInstanceEx(xmlFile.getProject()).isActionActive(Html5SectionsNodeProvider.ACTION_ID)) {
    return true;
  }

  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:HtmlFileTreeElement.java

示例5: actionPerformed

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return;
  final FileEditor fileEditor = e.getData(PlatformDataKeys.FILE_EDITOR);
  if (fileEditor == null) return;
  final VirtualFile virtualFile;

  final Editor editor = e.getData(CommonDataKeys.EDITOR);
  if (editor == null) {
    virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE);
  }
  else {
    PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
    PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
    if (psiFile == null) return;

    virtualFile = psiFile.getVirtualFile();
  }
  String title = virtualFile == null? fileEditor.getName() : virtualFile.getName();

  FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.popup.file.structure");

  FileStructurePopup popup = createPopup(project, fileEditor);
  if (popup == null) return;

  popup.setTitle(title);
  popup.show();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ViewStructureAction.java

示例6: createPopup

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
@Nullable
public static FileStructurePopup createPopup(@NotNull Project project, @NotNull FileEditor fileEditor) {
  StructureViewBuilder structureViewBuilder = fileEditor.getStructureViewBuilder();
  if (structureViewBuilder == null) return null;
  StructureView structureView = structureViewBuilder.createStructureView(fileEditor, project);
  StructureViewModel model = structureView.getTreeModel();
  if (model instanceof PlaceHolder) {
    //noinspection unchecked
    ((PlaceHolder)model).setPlace(TreeStructureUtil.PLACE);
  }
  return createStructureViewPopup(project, fileEditor, structureView);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ViewStructureAction.java

示例7: createPopup

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
@Nullable
public static FileStructurePopup createPopup(final Editor editor, Project project, @Nullable Navigatable navigatable, final FileEditor fileEditor) {
  final StructureViewBuilder structureViewBuilder = fileEditor.getStructureViewBuilder();
  if (structureViewBuilder == null) return null;
  StructureView structureView = structureViewBuilder.createStructureView(fileEditor, project);
  final StructureViewModel model = structureView.getTreeModel();
  if (model instanceof PlaceHolder) {
    //noinspection unchecked
    ((PlaceHolder)model).setPlace(PLACE);
  }
  return createStructureViewPopup(model, editor, project, navigatable, structureView);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:ViewStructureAction.java

示例8: createStructureViewPopup

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
public static FileStructurePopup createStructureViewPopup(final StructureViewModel structureViewModel,
                                                                 final Editor editor,
                                                                 final Project project,
                                                                 final Navigatable navigatable,
                                                                 final @NotNull Disposable alternativeDisposable) {
  return new FileStructurePopup(structureViewModel, editor, project, alternativeDisposable, true);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:ViewStructureAction.java

示例9: actionPerformed

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return;
  final FileEditor fileEditor = e.getData(PlatformDataKeys.FILE_EDITOR);
  if (fileEditor == null) return;
  final VirtualFile virtualFile;

  final Editor editor = e.getData(CommonDataKeys.EDITOR);
  if (editor == null) {
    virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE);
  }
  else {
    PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
    PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
    if (psiFile == null) return;

    virtualFile = psiFile.getVirtualFile();
  }
  String title = virtualFile == null? fileEditor.getName() : virtualFile.getName();

  FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.popup.file.structure");

  FileStructurePopup popup = createPopup(project, fileEditor);
  if (popup == null) return;

  popup.setTitle(title);
  popup.show();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:31,代码来源:ViewStructureAction.java

示例10: createPopup

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
@Nullable
public static FileStructurePopup createPopup(@Nonnull Project project, @Nonnull FileEditor fileEditor) {
  StructureViewBuilder structureViewBuilder = fileEditor.getStructureViewBuilder();
  if (structureViewBuilder == null) return null;
  StructureView structureView = structureViewBuilder.createStructureView(fileEditor, project);
  StructureViewModel model = structureView.getTreeModel();
  if (model instanceof PlaceHolder) {
    //noinspection unchecked
    ((PlaceHolder)model).setPlace(TreeStructureUtil.PLACE);
  }
  return createStructureViewPopup(project, fileEditor, structureView);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:ViewStructureAction.java

示例11: getSpeedSearch

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
public FileStructurePopup.MyTreeSpeedSearch getSpeedSearch() {
  return (FileStructurePopup.MyTreeSpeedSearch)getPopup().getSpeedSearch();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FileStructureTestFixture.java

示例12: createStructureViewPopup

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
private static FileStructurePopup createStructureViewPopup(Project project,
                                                           FileEditor fileEditor,
                                                           StructureView structureView) {
  return new FileStructurePopup(project, fileEditor, structureView, true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ViewStructureAction.java

示例13: getAnonymousPropertyName

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
private static String getAnonymousPropertyName() {
  return FileStructurePopup.getPropertyName(JavaAnonymousClassesNodeProvider.JAVA_ANONYMOUS_PROPERTY_NAME);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:JavaFileStructureTestCase.java

示例14: getSpeedSearch

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
protected FileStructurePopup.MyTreeSpeedSearch getSpeedSearch() {
  return (FileStructurePopup.MyTreeSpeedSearch)myPopup.getSpeedSearch();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:FileStructureTestBase.java

示例15: getHtml5OutlineModePropertyName

import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
private static String getHtml5OutlineModePropertyName() {
  return FileStructurePopup.getPropertyName(Html5SectionsNodeProvider.HTML5_OUTLINE_PROVIDER_PROPERTY);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:HtmlFileStructureTest.java


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