Interface EditorViewModel
- All Known Implementing Classes:
DefaultEditorViewModel,WorkingAreaEditorViewModel
public interface EditorViewModel
View model for the SessionEditor. This class
is responsible for creating and placing any EditorViews.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener to this modelvoidapplyPerspective(RecordEditorPerspective editorPerspective) Setup views based on the given perspectivevoidcleanup()Remove all view references and cleanup resources.getCloseAction(String viewName) Get the close action for a viewgetDynamicView(String viewName) Get dynamic view component with the given name.Get view model listenersGet currently focused viewgetRoot()Get the view root for the editor.Get the view specified by the given name.getViewIcon(String viewName) Get the icon associated with the view.Get the list of view names handeled by this modelGet the set of available views organized by category.voidHide the specified viewbooleanIs the specified view showing in the current layout.booleanisShowingInStack(String viewName) Is the specified view top-most in its stack.voidRemove a listener from this modelvoidremovePrespective(RecordEditorPerspective editorPerspective) Remove prespective from dock controlvoidsavePerspective(RecordEditorPerspective editorPerspective) Save the current view perspective as the specified editor perspectivevoidSave previous perspectivevoidSetup default perspectivevoidsetupLayoutMenu(MenuElement menuElement) Setup layout menu.voidsetupPerspectiveMenu(MenuElement menuElement) Setup perspective menu.voidsetupViewMenu(MenuElement menuElement) Setup view menuvoidsetupWindows(RecordEditorPerspective editorPerspective) Setup windows using the given perspectivevoidshowDynamicDockable(String title, JComponent comp, ViewPosition position) Show the given component as a new dockable at the given position.voidshowDynamicFloatingDockable(String title, JComponent comp, int x, int y, int w, int h) Deprecated.voidShow the specified view.showViewInAccessoryWindow(String viewName) Open a given viewName as a new accessory window.
-
Method Details
-
addEditorViewModelListener
Add a listener to this model- Parameters:
listener-
-
removeEditorViewModelListener
Remove a listener from this model- Parameters:
listener-
-
getEditorViewModelListeners
List<EditorViewModelListener> getEditorViewModelListeners()Get view model listeners- Returns:
- list of listeners
-
cleanup
void cleanup()Remove all view references and cleanup resources. -
getRoot
Container getRoot()Get the view root for the editor. This is the component that will be displayed in the root pane of the editor window.- Returns:
- the root container for the editor
-
getView
Get the view specified by the given name.- Parameters:
viewName-- Returns:
- specified editor view or
nullif view was not found
-
getDynamicView
Get dynamic view component with the given name. This method is used for getting references to components displayed with theshowDynamicFloatingDockable(String, JComponent, int, int, int, int)method.- Parameters:
viewName-- Returns:
- specified view component or
nullif view was not found
-
getViewIcon
-
getViewNames
-
getViewsByCategory
Map<EditorViewCategory, List<String>> getViewsByCategory()Get the set of available views organized by category.- Returns:
- editor views by category
-
showView
-
getFocusedView
-
getCloseAction
-
isShowing
Is the specified view showing in the current layout.- Returns:
trueif the given view is part of the current dock control,falseotherwise
-
isShowingInStack
Is the specified view top-most in its stack.- Returns:
trueif the view is showing and topmost in its stack
-
showDynamicFloatingDockable
@Deprecated void showDynamicFloatingDockable(String title, JComponent comp, int x, int y, int w, int h) Deprecated.Show the specified view as a new dynamic floating view. These views are not saved in layouts.- Parameters:
title-comp-x-y-w-h-
-
showDynamicDockable
Show the given component as a new dockable at the given position.- Parameters:
title-comp-position-
-
showViewInAccessoryWindow
-
hideView
-
setupWindows
Setup windows using the given perspective- Parameters:
editorPerspective-
-
setupDefaultPerspective
void setupDefaultPerspective()Setup default perspective -
savePreviousPerspective
void savePreviousPerspective()Save previous perspective -
applyPerspective
Setup views based on the given perspective- Parameters:
editorPerspective-
-
savePerspective
Save the current view perspective as the specified editor perspective- Parameters:
editorPerspective-
-
removePrespective
Remove prespective from dock control- Parameters:
editorPerspective-
-
setupViewMenu
-
setupPerspectiveMenu
Setup perspective menu.- Parameters:
menuElement-
-
setupLayoutMenu
-
showDynamicDockable(String, JComponent, ViewPosition)instead.