Package com.intellij.ide.structureView

Examples of com.intellij.ide.structureView.StructureViewBuilder


    return new TemplateLanguageStructureViewBuilder(psiFile) {
      @Override
      protected StructureViewComposite.StructureViewDescriptor createMainView(FileEditor fileEditor, final PsiFile mainFile) {
        if (!psiFile.isValid()) return null;

        final StructureViewBuilder builder = new TreeBasedStructureViewBuilder() {
          @NotNull
          @Override
          public StructureViewModel createStructureViewModel() {
            return new HbStructureViewModel((HbPsiFile) mainFile);
          }
        };

        StructureView structureView = builder.createStructureView(fileEditor, psiFile.getProject());

        return new StructureViewComposite.StructureViewDescriptor(
          HbLanguage.INSTANCE.getDisplayName(), structureView, HbFileType.INSTANCE.getIcon());
      }
    };
View Full Code Here


   * {@inheritDoc}
   */
  @Nullable
  public StructureViewBuilder createStructureViewBuilder(@NotNull final XmlFile file)
  {
    StructureViewBuilder nestedViewBuilder = null;
    XmlStructureViewBuilderProvider[] viewBuilderProviders = getAllViewBuilderProviders();
    for (XmlStructureViewBuilderProvider viewBuilderProvider : viewBuilderProviders)
    {
      if (!viewBuilderProvider.equals(this))
      {
View Full Code Here

    return new TemplateLanguageStructureViewBuilder(psiFile) {
      @Override
      protected StructureViewComposite.StructureViewDescriptor createMainView(FileEditor fileEditor, PsiFile mainFile) {
        if (!psiFile.isValid()) return null;

        final StructureViewBuilder builder = new TreeBasedStructureViewBuilder() {
          @NotNull
          @Override
          public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
            return new HbStructureViewModel((HbPsiFile)psiFile, editor);
          }
        };

        StructureView structureView = builder.createStructureView(fileEditor, psiFile.getProject());

        return new StructureViewComposite.StructureViewDescriptor(
          HbLanguage.INSTANCE.getDisplayName(), structureView, HbFileType.INSTANCE.getIcon());
      }
    };
View Full Code Here

  }

  public void testStructureView(PsiFile file, Consumer<StructureViewComposite> consumer) {
    final VirtualFile vFile = file.getVirtualFile();
    final FileEditor fileEditor = FileEditorManager.getInstance(getProject()).getSelectedEditor(vFile);
    final StructureViewBuilder builder = LanguageStructureViewBuilder.INSTANCE.getStructureViewBuilder(file);
    assert builder != null;

    StructureViewComposite composite = null;
    try {
      composite = (StructureViewComposite) builder.createStructureView(fileEditor, file.getProject());
      consumer.consume(composite);
    }
    finally {
      if (composite != null) Disposer.dispose(composite);
    }
View Full Code Here

  private StructureView createStructureViewModel() {
    VirtualFile virtualFile = myFixture.getFile().getVirtualFile();

    final FileType fileType = virtualFile.getFileType();
    final StructureViewBuilder structureViewBuilder;

    if (fileType == CfmlFileType.INSTANCE) {
      CfmlFileViewProvider viewProvider = (CfmlFileViewProvider)myFixture.getFile().getViewProvider();
      structureViewBuilder = LanguageStructureViewBuilder.INSTANCE.forLanguage(viewProvider.getBaseLanguage())
        .getStructureViewBuilder(viewProvider.getPsi(viewProvider.getBaseLanguage()));
    } else {
      structureViewBuilder = StructureViewBuilder.PROVIDER.getStructureViewBuilder(fileType, virtualFile, getProject());
    }

    return structureViewBuilder.createStructureView(FileEditorManager.getInstance(getProject()).getSelectedEditor(virtualFile), getProject());
  }
View Full Code Here

  public static Rectangle getActualSize(Graph2DView view) {
    return view.getGraph2D().getBoundingBox();
  }

  public static StructureViewBuilder createStructureViewBuilder(final Overview overview) {
    return new StructureViewBuilder() {

      @NotNull
      public StructureView createStructureView(final FileEditor fileEditor, Project project) {
        return new StructureView() {
View Full Code Here

TOP

Related Classes of com.intellij.ide.structureView.StructureViewBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.