本文整理汇总了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();
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例11: getSpeedSearch
import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
public FileStructurePopup.MyTreeSpeedSearch getSpeedSearch() {
return (FileStructurePopup.MyTreeSpeedSearch)getPopup().getSpeedSearch();
}
示例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);
}
示例13: getAnonymousPropertyName
import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
private static String getAnonymousPropertyName() {
return FileStructurePopup.getPropertyName(JavaAnonymousClassesNodeProvider.JAVA_ANONYMOUS_PROPERTY_NAME);
}
示例14: getSpeedSearch
import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
protected FileStructurePopup.MyTreeSpeedSearch getSpeedSearch() {
return (FileStructurePopup.MyTreeSpeedSearch)myPopup.getSpeedSearch();
}
示例15: getHtml5OutlineModePropertyName
import com.intellij.ide.util.FileStructurePopup; //导入依赖的package包/类
private static String getHtml5OutlineModePropertyName() {
return FileStructurePopup.getPropertyName(Html5SectionsNodeProvider.HTML5_OUTLINE_PROVIDER_PROPERTY);
}