Package ca.phon.app.session.editor
Interface EditorViewModel
- All Known Implementing Classes:
DefaultEditorViewModel
public interface EditorViewModel
View model for the SessionEditor
. This class
is responsible for creating and placing any EditorView
s.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyPerspective
(RecordEditorPerspective editorPerspective) Setup views based on the given perspectivevoid
cleanup()
Remove all view references and cleanup resources.getCloseAction
(String viewView) Get the close action for a viewgetDynamicView
(String viewName) Get dynamic view component with the given name.Get 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
removePrespective
(RecordEditorPerspective editorPerspective) Remove prespective from dock controlvoid
savePerspective
(RecordEditorPerspective editorPerspective) Save the current view perspective as the specified editor 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
showDynamicFloatingDockable
(String title, JComponent comp, int x, int y, int w, int h) Show the specified view as a new dynamic floating view.void
Show the specified view.
-
Method Details
-
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
Get the icon associated with the view. This information comes from the view itself if the view is loaded, otherwise information is obtained from the EditorViewInfo annotation on the extension point.- Returns:
- view icon
-
getViewNames
Get the list of view names handeled by this model- Returns:
- list of available view names
-
getViewsByCategory
Map<EditorViewCategory,List<String>> getViewsByCategory()Get the set of available views organized by category.- Returns:
- editor views by category
-
showView
Show the specified view.- Parameters:
viewName
-
-
getFocusedView
EditorView getFocusedView()Get currently focused view- Parameters:
focused
- view ornull
-
getCloseAction
Get the close action for a view- Parameters:
viewName
-- Returns:
- the close action for the view
-
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
Show the specified view as a new dynamic floating view. These views are not saved in layouts.- Parameters:
title
-comp
-x
-y
-w
-h
-
-
hideView
Hide the specified view- Parameters:
viewName
-
-
setupWindows
Setup windows using the given perspective- Parameters:
editorPerspective
-
-
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
Setup view menu- Parameters:
menuElement
-
-
setupPerspectiveMenu
Setup perspective menu.- Parameters:
menuElement
-
-
setupLayoutMenu
Setup layout menu.- Parameters:
menuElement
-
-