public class ProjectViewImpl extends ProjectView implements PersistentStateComponent<Element>, QuickActionProvider
UNLOADED_MODULES_CONTEXT_KEY
KEY
Constructor and Description |
---|
ProjectViewImpl(Project project) |
Modifier and Type | Method and Description |
---|---|
void |
addProjectPane(AbstractProjectViewPane pane) |
void |
changeView() |
void |
changeView(java.lang.String viewId) |
void |
changeView(java.lang.String viewId,
java.lang.String subId) |
ActionCallback |
changeViewCB(java.lang.String viewId,
java.lang.String subId)
Changes currently selected view and subview (if any).
|
protected void |
createTitleActions(java.util.List<? super AnAction> titleActions) |
java.util.List<AnAction> |
getActions(boolean originalProvider) |
javax.swing.JComponent |
getComponent() |
ContentManager |
getContentManager() |
AbstractProjectViewPane |
getCurrentProjectViewPane() |
java.lang.String |
getCurrentViewId()
e.g.
|
java.lang.String |
getDefaultViewId() |
java.lang.String |
getName() |
java.util.Collection<java.lang.String> |
getPaneIds() |
PsiElement |
getParentOfCurrentSelection() |
AbstractProjectViewPane |
getProjectViewPaneById(java.lang.String id) |
ActionCallback |
getReady(java.lang.Object requestor) |
java.util.Collection<SelectInTarget> |
getSelectInTargets() |
Element |
getState() |
boolean |
isAbbreviatePackageNames(java.lang.String paneId) |
boolean |
isAutoscrollFromSource(java.lang.String paneId) |
boolean |
isAutoscrollToSource(java.lang.String paneId) |
boolean |
isCompactDirectories(java.lang.String paneId) |
boolean |
isFlattenModules(java.lang.String paneId) |
boolean |
isFlattenPackages(java.lang.String paneId) |
boolean |
isFoldersAlwaysOnTop()
Deprecated.
use
ProjectView.isFoldersAlwaysOnTop(String) instead |
boolean |
isFoldersAlwaysOnTop(java.lang.String paneId) |
boolean |
isHideEmptyMiddlePackages(java.lang.String paneId) |
boolean |
isManualOrder(java.lang.String paneId) |
boolean |
isShowExcludedFiles(java.lang.String paneId) |
boolean |
isShowLibraryContents(java.lang.String paneId) |
boolean |
isShowMembers(java.lang.String paneId) |
protected boolean |
isShowMembersOptionSupported() |
boolean |
isShowModules(java.lang.String paneId) |
boolean |
isShowURL(java.lang.String paneId) |
boolean |
isShowVisibilityIcons(java.lang.String paneId) |
boolean |
isSortByType(java.lang.String paneId) |
void |
loadState(Element parentNode)
This method is called when new component state is loaded.
|
void |
refresh() |
void |
removeProjectPane(AbstractProjectViewPane pane) |
void |
select(java.lang.Object element,
VirtualFile file,
boolean requestFocus) |
ActionCallback |
selectCB(java.lang.Object element,
VirtualFile file,
boolean requestFocus) |
void |
selectPsiElement(PsiElement element,
boolean requestFocus) |
void |
setAbbreviatePackageNames(java.lang.String paneId,
boolean abbreviatePackageNames) |
void |
setAutoscrollFromSource(boolean autoscrollMode,
java.lang.String paneId) |
void |
setAutoscrollToSource(boolean autoscrollMode,
java.lang.String paneId) |
void |
setCompactDirectories(java.lang.String paneId,
boolean compactDirectories) |
void |
setFlattenModules(java.lang.String paneId,
boolean flattenModules) |
void |
setFlattenPackages(java.lang.String paneId,
boolean flattenPackages) |
void |
setFoldersAlwaysOnTop(boolean foldersAlwaysOnTop) |
void |
setHideEmptyPackages(java.lang.String paneId,
boolean hideEmptyPackages) |
void |
setManualOrder(java.lang.String paneId,
boolean enabled) |
void |
setShowLibraryContents(java.lang.String paneId,
boolean showLibraryContents) |
void |
setShowModules(java.lang.String paneId,
boolean showModules) |
void |
setSortByType(java.lang.String paneId,
boolean sortByType) |
void |
setupImpl(ToolWindow toolWindow) |
void |
setupImpl(ToolWindow toolWindow,
boolean loadPaneExtensions) |
getInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeComponent, noStateLoaded
isCycleRoot
public ProjectViewImpl(Project project)
public java.lang.String getName()
getName
in interface QuickActionProvider
public java.util.List<AnAction> getActions(boolean originalProvider)
getActions
in interface QuickActionProvider
public void addProjectPane(AbstractProjectViewPane pane)
addProjectPane
in class ProjectView
public void removeProjectPane(AbstractProjectViewPane pane)
removeProjectPane
in class ProjectView
public void setupImpl(ToolWindow toolWindow)
public void setupImpl(ToolWindow toolWindow, boolean loadPaneExtensions)
protected void createTitleActions(java.util.List<? super AnAction> titleActions)
protected boolean isShowMembersOptionSupported()
public AbstractProjectViewPane getProjectViewPaneById(java.lang.String id)
getProjectViewPaneById
in class ProjectView
public AbstractProjectViewPane getCurrentProjectViewPane()
getCurrentProjectViewPane
in class ProjectView
public void refresh()
refresh
in class ProjectView
public void select(java.lang.Object element, VirtualFile file, boolean requestFocus)
select
in class ProjectView
public ActionCallback selectCB(java.lang.Object element, VirtualFile file, boolean requestFocus)
selectCB
in class ProjectView
public javax.swing.JComponent getComponent()
getComponent
in interface QuickActionProvider
public java.lang.String getCurrentViewId()
ProjectView
ProjectViewPane.ID
getCurrentViewId
in class ProjectView
AbstractProjectViewPane.getId()
public PsiElement getParentOfCurrentSelection()
getParentOfCurrentSelection
in class ProjectView
public ContentManager getContentManager()
public void changeView()
changeView
in class ProjectView
public void changeView(java.lang.String viewId)
changeView
in class ProjectView
public void changeView(java.lang.String viewId, java.lang.String subId)
changeView
in class ProjectView
ProjectView.changeViewCB(String, String)
public ActionCallback changeViewCB(java.lang.String viewId, java.lang.String subId)
ProjectView
When default subview is requested:
- if the view had never been selected then the first subview is selected
- otherwise subview won't be changed
It's an error when a view has no subviews and subId
is not null.
changeViewCB
in class ProjectView
viewId
- id of view to be selectedsubId
- id of subview to be selecteddone
if new content was selected
or to rejected
if content didn't change.public void selectPsiElement(PsiElement element, boolean requestFocus)
selectPsiElement
in class ProjectView
public void loadState(Element parentNode)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<Element>
parentNode
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public java.lang.String getDefaultViewId()
getDefaultViewId
in class ProjectView
public Element getState()
getState
in interface PersistentStateComponent<Element>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public boolean isAutoscrollToSource(java.lang.String paneId)
isAutoscrollToSource
in class ProjectView
public void setAutoscrollToSource(boolean autoscrollMode, java.lang.String paneId)
public boolean isAutoscrollFromSource(java.lang.String paneId)
isAutoscrollFromSource
in class ProjectView
public void setAutoscrollFromSource(boolean autoscrollMode, java.lang.String paneId)
public boolean isFlattenPackages(java.lang.String paneId)
isFlattenPackages
in class ProjectView
public void setFlattenPackages(java.lang.String paneId, boolean flattenPackages)
public boolean isFoldersAlwaysOnTop(java.lang.String paneId)
isFoldersAlwaysOnTop
in class ProjectView
@Deprecated public boolean isFoldersAlwaysOnTop()
ProjectView.isFoldersAlwaysOnTop(String)
insteadpublic void setFoldersAlwaysOnTop(boolean foldersAlwaysOnTop)
public boolean isShowMembers(java.lang.String paneId)
isShowMembers
in class ProjectView
public boolean isHideEmptyMiddlePackages(java.lang.String paneId)
isHideEmptyMiddlePackages
in class ProjectView
public boolean isAbbreviatePackageNames(java.lang.String paneId)
isAbbreviatePackageNames
in class ProjectView
public boolean isShowExcludedFiles(java.lang.String paneId)
isShowExcludedFiles
in class ProjectView
public boolean isShowVisibilityIcons(java.lang.String paneId)
isShowVisibilityIcons
in class ProjectView
public boolean isShowLibraryContents(java.lang.String paneId)
isShowLibraryContents
in class ProjectView
public void setShowLibraryContents(java.lang.String paneId, boolean showLibraryContents)
setShowLibraryContents
in class ProjectView
public boolean isShowModules(java.lang.String paneId)
isShowModules
in class ProjectView
public void setShowModules(java.lang.String paneId, boolean showModules)
setShowModules
in class ProjectView
public boolean isFlattenModules(java.lang.String paneId)
isFlattenModules
in class ProjectView
public void setFlattenModules(java.lang.String paneId, boolean flattenModules)
setFlattenModules
in class ProjectView
public boolean isShowURL(java.lang.String paneId)
isShowURL
in class ProjectView
public void setHideEmptyPackages(java.lang.String paneId, boolean hideEmptyPackages)
setHideEmptyPackages
in class ProjectView
public boolean isCompactDirectories(java.lang.String paneId)
isCompactDirectories
in class ProjectView
public void setCompactDirectories(java.lang.String paneId, boolean compactDirectories)
setCompactDirectories
in class ProjectView
public void setAbbreviatePackageNames(java.lang.String paneId, boolean abbreviatePackageNames)
setAbbreviatePackageNames
in class ProjectView
public boolean isManualOrder(java.lang.String paneId)
isManualOrder
in class ProjectView
public void setManualOrder(java.lang.String paneId, boolean enabled)
setManualOrder
in class ProjectView
public boolean isSortByType(java.lang.String paneId)
isSortByType
in class ProjectView
public void setSortByType(java.lang.String paneId, boolean sortByType)
setSortByType
in class ProjectView
public java.util.Collection<java.lang.String> getPaneIds()
getPaneIds
in class ProjectView
public java.util.Collection<SelectInTarget> getSelectInTargets()
getSelectInTargets
in class ProjectView
public ActionCallback getReady(java.lang.Object requestor)