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 EditorView
s.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener to this modelvoid
applyPerspective
(RecordEditorPerspective editorPerspective) Setup views based on the given perspectivevoid
cleanup()
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.void
Hide the specified viewboolean
Is the specified view showing in the current layout.boolean
isShowingInStack
(String viewName) Is the specified view top-most in its stack.void
Remove a listener from this modelvoid
removePrespective
(RecordEditorPerspective editorPerspective) Remove prespective from dock controlvoid
savePerspective
(RecordEditorPerspective editorPerspective) Save the current view perspective as the specified editor perspectivevoid
Setup default perspectivevoid
setupLayoutMenu
(MenuElement menuElement) Setup layout menu.void
setupPerspectiveMenu
(MenuElement menuElement) Setup perspective menu.void
setupViewMenu
(MenuElement menuElement) Setup view menuvoid
setupWindows
(RecordEditorPerspective editorPerspective) Setup windows using the given perspectivevoid
showDynamicDockable
(String title, JComponent comp, ViewPosition position) Show the given component as a new dockable at the given position.void
showDynamicFloatingDockable
(String title, JComponent comp, int x, int y, int w, int h) Deprecated.void
Show the specified view.
-
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
null
if 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
null
if 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:
true
if the given view is part of the current dock control,false
otherwise
-
isShowingInStack
Is the specified view top-most in its stack.- Returns:
true
if 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
-
-
hideView
-
setupWindows
Setup windows using the given perspective- Parameters:
editorPerspective
-
-
setupDefaultPerspective
void setupDefaultPerspective()Setup default 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
-