本文整理匯總了Java中com.intellij.ide.structureView.StructureViewBuilder類的典型用法代碼示例。如果您正苦於以下問題:Java StructureViewBuilder類的具體用法?Java StructureViewBuilder怎麽用?Java StructureViewBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StructureViewBuilder類屬於com.intellij.ide.structureView包,在下文中一共展示了StructureViewBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Nullable
@Override
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
return new TreeBasedStructureViewBuilder() {
@Override
@NotNull
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new AppleScriptStructureViewModel(psiFile, editor);
}
@Override
public boolean isRootNodeShown() {
return true;
}
};
}
示例2: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Nullable
@Override
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
return new TreeBasedStructureViewBuilder() {
@NotNull
@Override
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new ProtoStructureViewModel((ProtoPsiFileRoot) psiFile, editor);
}
@Override
public boolean isRootNodeShown() {
return false;
}
};
}
示例3: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Override
@Nullable
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
if (!(psiFile instanceof PsiJavaFile)) return null;
return new TreeBasedStructureViewBuilder() {
@Override
@NotNull
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new JavaFileTreeModel((PsiJavaFile)psiFile, editor);
}
@Override
public boolean isRootNodeShown() {
return false;
}
};
}
示例4: doCreateEditorContext
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
private static SelectInContext doCreateEditorContext(Project project, FileEditor editor, @Nullable DataContext dataContext) {
if (project == null || editor == null) {
return null;
}
VirtualFile file = FileEditorManagerEx.getInstanceEx(project).getFile(editor);
if (file == null) {
file = dataContext == null ? null : CommonDataKeys.VIRTUAL_FILE.getData(dataContext);
if (file == null) {
return null;
}
}
final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
if (psiFile == null) {
return null;
}
if (editor instanceof TextEditor) {
return new TextEditorContext((TextEditor)editor, psiFile);
}
else {
StructureViewBuilder builder = editor.getStructureViewBuilder();
StructureView structureView = builder != null ? builder.createStructureView(editor, project) : null;
Object selectorInFile = structureView != null ? structureView.getTreeModel().getCurrentEditorElement() : null;
if (structureView != null) Disposer.dispose(structureView);
return new SimpleSelectInContext(psiFile, ObjectUtils.chooseNotNull(selectorInFile, psiFile));
}
}
示例5: checkModelsUpToDate
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
private synchronized void checkModelsUpToDate() {
if (myClassModel == null) {
myClassModel = new GotoClassModel2(project);
myFileModel = new GotoFileModel(project);
mySymbolsModel = new GotoSymbolModel2(project);
myFileChooseByName = ChooseByNamePopup.createPopup(project, myFileModel, (PsiElement)null);
myClassChooseByName = ChooseByNamePopup.createPopup(project, myClassModel, (PsiElement)null);
mySymbolsChooseByName = ChooseByNamePopup.createPopup(project, mySymbolsModel, (PsiElement)null);
project.putUserData(ChooseByNamePopup.CHOOSE_BY_NAME_POPUP_IN_PROJECT_KEY, null);
myActionProvider = createActionProvider();
myConfigurables.clear();
fillConfigurablesIds(null, ShowSettingsUtilImpl.getConfigurables(project, true));
}
if (myStructureModel == null && myFileEditor != null && Registry.is("search.everywhere.structure")) {
runReadAction(new Runnable() {
public void run() {
StructureViewBuilder structureViewBuilder = myFileEditor.getStructureViewBuilder();
if (structureViewBuilder == null) return;
StructureView structureView = structureViewBuilder.createStructureView(myFileEditor, project);
myStructureModel = structureView.getTreeModel();
}
}, true);
}
}
示例6: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Override
@Nullable
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
if (!(psiFile instanceof XmlFile)) {
return null;
}
StructureViewBuilder builder = getStructureViewBuilderForExtensions(psiFile);
if (builder != null) {
return builder;
}
for (XmlStructureViewBuilderProvider xmlStructureViewBuilderProvider : getStructureViewBuilderProviders()) {
final StructureViewBuilder structureViewBuilder = xmlStructureViewBuilderProvider.createStructureViewBuilder((XmlFile)psiFile);
if (structureViewBuilder != null) {
return structureViewBuilder;
}
}
return new TreeBasedStructureViewBuilder() {
@Override
@NotNull
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new XmlStructureViewTreeModel((XmlFile)psiFile, editor);
}
};
}
示例7: createStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Override
@Nullable
public StructureViewBuilder createStructureViewBuilder(@NotNull final XmlFile file) {
if (file.getViewProvider().getFileType() != HtmlFileType.INSTANCE) return null;
return new TreeBasedStructureViewBuilder() {
@Override
public boolean isRootNodeShown() {
return false;
}
@Override
@NotNull
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new HtmlStructureViewTreeModel(file, editor);
}
};
}
示例8: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Override
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
return new TreeBasedStructureViewBuilder() {
@Override
@NotNull
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new JavaFileTreeModel((GroovyFileBase)psiFile, editor) {
@NotNull
@Override
public Collection<NodeProvider> getNodeProviders() {
return Arrays.<NodeProvider>asList(new JavaInheritedMembersNodeProvider());
}
};
}
};
}
示例9: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Nullable
@Override
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
//TODO: uncomment later
return null;
// return new TreeBasedStructureViewBuilder() {
// @Override
// @NotNull
// public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
// return new HackStructureViewModel(psiFile, editor);
// }
//
// @Override
// public boolean isRootNodeShown() {
// return false;
// }
// };
}
示例10: createStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Override
@Nullable
public StructureViewBuilder createStructureViewBuilder(@NotNull final XmlFile file) {
if (file.getViewProvider().getVirtualFile().getFileType() != HtmlFileType.INSTANCE) return null;
return new TreeBasedStructureViewBuilder() {
@Override
public boolean isRootNodeShown() {
return false;
}
@Override
@NotNull
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new HtmlStructureViewTreeModel(file, editor);
}
};
}
示例11: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Nullable
@Override
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
return new TemplateLanguageStructureViewBuilder(psiFile) {
@Override
protected StructureViewComposite.StructureViewDescriptor createMainView(FileEditor fileEditor, PsiFile mainFile) {
StructureView mainView = (new TreeBasedStructureViewBuilder() {
@NotNull
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new StructureViewModelBase(psiFile, editor, new LatteStructureViewTreeElement(psiFile));
}
}).createStructureView(fileEditor, mainFile.getProject());
return new StructureViewComposite.StructureViewDescriptor("Latte", mainView, mainFile.getFileType().getIcon());
}
};
}
示例12: createStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
/**
* construct view builder
*
* @param xmlFile xml file
* @return structure view builder
*/
@Nullable public StructureViewBuilder createStructureViewBuilder(@NotNull final XmlFile xmlFile) {
final DomFileElement fileElement = getFileElement(xmlFile);
if (fileElement == null) {
return null;
}
return new TreeBasedStructureViewBuilder() {
@NotNull
public StructureView createStructureView(final FileEditor fileEditor, final Project project) {
return new StructureViewComponent(fileEditor, createStructureViewModel(), project);
}
@NotNull
public StructureViewModel createStructureViewModel() {
return new SqlMapConfigStructureViewTreeModel(xmlFile, fileElement.getRootElement());
}
};
}
示例13: createStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
/**
* construct view builder
*
* @param xmlFile xml file
* @return structure view builder
*/
@Nullable public StructureViewBuilder createStructureViewBuilder(@NotNull final XmlFile xmlFile) {
final DomFileElement fileElement = getFileElement(xmlFile);
if (fileElement == null) {
return null;
}
return new TreeBasedStructureViewBuilder() {
@NotNull
public StructureView createStructureView(final FileEditor fileEditor, final Project project) {
return new StructureViewComponent(fileEditor, createStructureViewModel(), project);
}
@NotNull
public StructureViewModel createStructureViewModel() {
return new SqlMapStructureViewTreeModel(xmlFile, fileElement.getRootElement());
}
};
}
示例14: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Nullable
@Override
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile)
{
if(psiFile instanceof CSharpFileImpl)
{
return new TreeBasedStructureViewBuilder()
{
@NotNull
@Override
public StructureViewModel createStructureViewModel(@Nullable Editor editor)
{
return new CSharpStructureViewModel(psiFile);
}
};
}
else
{
return null;
}
}
示例15: getStructureViewBuilder
import com.intellij.ide.structureView.StructureViewBuilder; //導入依賴的package包/類
@Override
public StructureViewBuilder getStructureViewBuilder(final PsiFile psiFile) {
if (!(psiFile instanceof HaxeFile)) {
return null;
}
return new TreeBasedStructureViewBuilder() {
@NotNull
@Override
public StructureViewModel createStructureViewModel(@Nullable Editor editor) {
return new HaxeStructureViewModel(psiFile, editor);
}
@Override
public boolean isRootNodeShown() {
return false;
}
};
}