Package ca.phon.app.session.editor
Class DefaultEditorViewModel
java.lang.Object
ca.phon.app.session.editor.DefaultEditorViewModel
- All Implemented Interfaces:
EditorViewModel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyPerspective
(RecordEditorPerspective editorPerspective) Setup views based on the given perspectivevoid
cleanup()
Remove all view references and cleanup resources.createAccessoryWindow
(UUID uuid) getCloseAction
(String viewName) Get the close action for a viewgetDynamicView
(String viewName) Get dynamic view component with the given name.Return 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
loadPerspective
(RecordEditorPerspective editorPerspective) void
onDeletePerspective
(RecordEditorPerspective perspective) Delete given perspective.void
void
void
removePrespective
(RecordEditorPerspective editorPerspective) Remove prespective from dock controlvoid
savePerspective
(RecordEditorPerspective editorPerspective) Save the current view perspective as the specified editor perspectivevoid
setupLayoutMenu
(MenuElement menu) Adds a menu item for all available editor perspectives.void
setupPerspectiveMenu
(MenuElement menuElement) Setup perspective menu.void
setupViewMenu
(MenuElement ele) 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.
-
Constructor Details
-
DefaultEditorViewModel
-
-
Method Details
-
getRoot
Description copied from interface:EditorViewModel
Get the view root for the editor. This is the component that will be displayed in the root pane of the editor window.- Specified by:
getRoot
in interfaceEditorViewModel
- Returns:
- the root container for the editor
-
getFocusedView
Return focused view- Specified by:
getFocusedView
in interfaceEditorViewModel
- Returns:
- currently focused view or
null
-
getView
Description copied from interface:EditorViewModel
Get the view specified by the given name.- Specified by:
getView
in interfaceEditorViewModel
- Returns:
- specified editor view or
null
if view was not found
-
getDynamicView
Description copied from interface:EditorViewModel
Get dynamic view component with the given name. This method is used for getting references to components displayed with theEditorViewModel.showDynamicFloatingDockable(String, JComponent, int, int, int, int)
method.- Specified by:
getDynamicView
in interfaceEditorViewModel
- Returns:
- specified view component or
null
if view was not found
-
getCloseAction
Description copied from interface:EditorViewModel
Get the close action for a view- Specified by:
getCloseAction
in interfaceEditorViewModel
- Returns:
- the close action for the view
-
getViewIcon
Description copied from interface:EditorViewModel
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.- Specified by:
getViewIcon
in interfaceEditorViewModel
- Returns:
- view icon
-
getViewNames
Description copied from interface:EditorViewModel
Get the list of view names handeled by this model- Specified by:
getViewNames
in interfaceEditorViewModel
- Returns:
- list of available view names
-
getViewsByCategory
Description copied from interface:EditorViewModel
Get the set of available views organized by category.- Specified by:
getViewsByCategory
in interfaceEditorViewModel
- Returns:
- editor views by category
-
isShowing
Description copied from interface:EditorViewModel
Is the specified view showing in the current layout.- Specified by:
isShowing
in interfaceEditorViewModel
- Returns:
true
if the given view is part of the current dock control,false
otherwise
-
isShowingInStack
Description copied from interface:EditorViewModel
Is the specified view top-most in its stack.- Specified by:
isShowingInStack
in interfaceEditorViewModel
- Returns:
true
if the view is showing and topmost in its stack
-
cleanup
public void cleanup()Description copied from interface:EditorViewModel
Remove all view references and cleanup resources.- Specified by:
cleanup
in interfaceEditorViewModel
-
showView
Description copied from interface:EditorViewModel
Show the specified view.- Specified by:
showView
in interfaceEditorViewModel
-
hideView
Description copied from interface:EditorViewModel
Hide the specified view- Specified by:
hideView
in interfaceEditorViewModel
-
showDynamicFloatingDockable
Description copied from interface:EditorViewModel
Show the specified view as a new dynamic floating view. These views are not saved in layouts.- Specified by:
showDynamicFloatingDockable
in interfaceEditorViewModel
-
onDeletePerspective
Delete given perspective.- Parameters:
perspective
-
-
setupWindows
Description copied from interface:EditorViewModel
Setup windows using the given perspective- Specified by:
setupWindows
in interfaceEditorViewModel
-
loadPerspective
-
applyPerspective
Description copied from interface:EditorViewModel
Setup views based on the given perspective- Specified by:
applyPerspective
in interfaceEditorViewModel
-
savePerspective
Description copied from interface:EditorViewModel
Save the current view perspective as the specified editor perspective- Specified by:
savePerspective
in interfaceEditorViewModel
-
removePrespective
Description copied from interface:EditorViewModel
Remove prespective from dock control- Specified by:
removePrespective
in interfaceEditorViewModel
-
setupViewMenu
Description copied from interface:EditorViewModel
Setup view menu- Specified by:
setupViewMenu
in interfaceEditorViewModel
-
setupPerspectiveMenu
Description copied from interface:EditorViewModel
Setup perspective menu.- Specified by:
setupPerspectiveMenu
in interfaceEditorViewModel
-
setupLayoutMenu
Adds a menu item for all available editor perspectives.- Specified by:
setupLayoutMenu
in interfaceEditorViewModel
- Parameters:
menu
-
-
onShowLayoutFolder
public void onShowLayoutFolder() -
onSaveLayout
public void onSaveLayout() -
createAccessoryWindow
-