Class DefaultEditorViewModel
java.lang.Object
ca.phon.app.session.editor.DefaultEditorViewModel
- All Implemented Interfaces:
EditorViewModel
-
Constructor Summary
Constructors -
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.createAccessoryWindow(UUID uuid) getCloseAction(String viewName) Get the close action for a viewgetDynamicView(String viewName) Get dynamic view component with the given name.Get view model listenersReturn 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.voidloadPerspective(RecordEditorPerspective editorPerspective) voidonDeletePerspective(RecordEditorPerspective perspective) Delete given perspective.voidvoidvoidRemove 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 menu) Adds a menu item for all available editor perspectives.voidsetupPerspectiveMenu(MenuElement menuElement) Setup perspective menu.voidsetupViewMenu(MenuElement ele) 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) Show the specified view as a new dynamic floating view.voidShow the specified view.showViewInAccessoryWindow(String viewName) Open a given viewName as a new accessory window.
-
Constructor Details
-
DefaultEditorViewModel
-
-
Method Details
-
getRoot
Description copied from interface:EditorViewModelGet the view root for the editor. This is the component that will be displayed in the root pane of the editor window.- Specified by:
getRootin interfaceEditorViewModel- Returns:
- the root container for the editor
-
getFocusedView
Return focused view- Specified by:
getFocusedViewin interfaceEditorViewModel- Returns:
- currently focused view or
null
-
getView
Description copied from interface:EditorViewModelGet the view specified by the given name.- Specified by:
getViewin interfaceEditorViewModel- Parameters:
viewName-- Returns:
- specified editor view or
nullif view was not found
-
getDynamicView
Description copied from interface:EditorViewModelGet 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:
getDynamicViewin interfaceEditorViewModel- Parameters:
viewName-- Returns:
- specified view component or
nullif view was not found
-
getCloseAction
Description copied from interface:EditorViewModelGet the close action for a view- Specified by:
getCloseActionin interfaceEditorViewModel- Parameters:
viewName-- Returns:
- the close action for the view
-
getViewIcon
Description copied from interface:EditorViewModelGet 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:
getViewIconin interfaceEditorViewModel- Returns:
- view icon
-
getViewNames
Description copied from interface:EditorViewModelGet the list of view names handeled by this model- Specified by:
getViewNamesin interfaceEditorViewModel- Returns:
- list of available view names
-
getViewsByCategory
Description copied from interface:EditorViewModelGet the set of available views organized by category.- Specified by:
getViewsByCategoryin interfaceEditorViewModel- Returns:
- editor views by category
-
isShowing
Description copied from interface:EditorViewModelIs the specified view showing in the current layout.- Specified by:
isShowingin interfaceEditorViewModel- Returns:
trueif the given view is part of the current dock control,falseotherwise
-
isShowingInStack
Description copied from interface:EditorViewModelIs the specified view top-most in its stack.- Specified by:
isShowingInStackin interfaceEditorViewModel- Returns:
trueif the view is showing and topmost in its stack
-
addEditorViewModelListener
Description copied from interface:EditorViewModelAdd a listener to this model- Specified by:
addEditorViewModelListenerin interfaceEditorViewModel- Parameters:
listener-
-
removeEditorViewModelListener
Description copied from interface:EditorViewModelRemove a listener from this model- Specified by:
removeEditorViewModelListenerin interfaceEditorViewModel- Parameters:
listener-
-
getEditorViewModelListeners
Description copied from interface:EditorViewModelGet view model listeners- Specified by:
getEditorViewModelListenersin interfaceEditorViewModel- Returns:
- list of listeners
-
cleanup
public void cleanup()Description copied from interface:EditorViewModelRemove all view references and cleanup resources.- Specified by:
cleanupin interfaceEditorViewModel
-
showView
Description copied from interface:EditorViewModelShow the specified view.- Specified by:
showViewin interfaceEditorViewModel- Parameters:
viewName-
-
hideView
Description copied from interface:EditorViewModelHide the specified view- Specified by:
hideViewin interfaceEditorViewModel- Parameters:
viewName-
-
showDynamicFloatingDockable
Description copied from interface:EditorViewModelShow the specified view as a new dynamic floating view. These views are not saved in layouts.- Specified by:
showDynamicFloatingDockablein interfaceEditorViewModel- Parameters:
title-comp-x-y-w-h-
-
showDynamicDockable
Description copied from interface:EditorViewModelShow the given component as a new dockable at the given position.- Specified by:
showDynamicDockablein interfaceEditorViewModel- Parameters:
title-comp-position-
-
showViewInAccessoryWindow
Description copied from interface:EditorViewModelOpen a given viewName as a new accessory window.- Specified by:
showViewInAccessoryWindowin interfaceEditorViewModel- Parameters:
viewName-
-
onDeletePerspective
Delete given perspective.- Parameters:
perspective-
-
setupWindows
Description copied from interface:EditorViewModelSetup windows using the given perspective- Specified by:
setupWindowsin interfaceEditorViewModel- Parameters:
editorPerspective-
-
loadPerspective
-
setupDefaultPerspective
public void setupDefaultPerspective()Description copied from interface:EditorViewModelSetup default perspective- Specified by:
setupDefaultPerspectivein interfaceEditorViewModel
-
applyPerspective
Description copied from interface:EditorViewModelSetup views based on the given perspective- Specified by:
applyPerspectivein interfaceEditorViewModel- Parameters:
editorPerspective-
-
savePerspective
Description copied from interface:EditorViewModelSave the current view perspective as the specified editor perspective- Specified by:
savePerspectivein interfaceEditorViewModel- Parameters:
editorPerspective-
-
savePreviousPerspective
public void savePreviousPerspective()Description copied from interface:EditorViewModelSave previous perspective- Specified by:
savePreviousPerspectivein interfaceEditorViewModel
-
removePrespective
Description copied from interface:EditorViewModelRemove prespective from dock control- Specified by:
removePrespectivein interfaceEditorViewModel- Parameters:
editorPerspective-
-
setupViewMenu
Description copied from interface:EditorViewModelSetup view menu- Specified by:
setupViewMenuin interfaceEditorViewModel- Parameters:
ele-
-
setupPerspectiveMenu
Description copied from interface:EditorViewModelSetup perspective menu.- Specified by:
setupPerspectiveMenuin interfaceEditorViewModel- Parameters:
menuElement-
-
setupLayoutMenu
Adds a menu item for all available editor perspectives.- Specified by:
setupLayoutMenuin interfaceEditorViewModel- Parameters:
menu-
-
onShowLayoutFolder
public void onShowLayoutFolder() -
onSaveLayout
public void onSaveLayout() -
createAccessoryWindow
-