# eric6.Plugins.ViewManagerPlugins.Tabview.Tabview

Module implementing a tabbed viewmanager class.

### Global Attributes

None

### Classes

TabBar | Class implementing a customized tab bar supporting drag & drop.
TabWidget | Class implementing a custimized tab widget.
Tabview | Class implementing a tabbed viewmanager class embedded in a splitter.

### Functions

None

## TabBar

Class implementing a customized tab bar supporting drag & drop.

### Signals

tabCopyRequested(int, int)
  emitted to signal a clone request giving the old and new index position
tabCopyRequested(str, int, int)
  emitted to signal a clone request giving the string encoded id of the source tab widget, the index in the source tab widget and the new index position
tabMoveRequested(int, int)
  emitted to signal a tab move request giving the old and new index position
tabRelocateRequested(str, int, int)
  emitted to signal a tab relocation request giving the string encoded id of the old tab widget, the index in the old tab widget and the new index position

### Derived from

E5WheelTabBar

### Class Attributes

None

### Class Methods

None

### Methods

TabBar | Constructor
dragEnterEvent | Protected method to handle drag enter events.
dropEvent | Protected method to handle drop events.
mouseMoveEvent | Protected method to handle mouse move events.
mousePressEvent | Protected method to handle mouse press events.

### Static Methods

None

#### TabBar (Constructor)

TabBar(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### TabBar.dragEnterEvent

dragEnterEvent(event)

Protected method to handle drag enter events.

event
  reference to the drag enter event (QDragEnterEvent)

#### TabBar.dropEvent

dropEvent(event)

Protected method to handle drop events.

event
  reference to the drop event (QDropEvent)

#### TabBar.mouseMoveEvent

mouseMoveEvent(event)

Protected method to handle mouse move events.

event
  reference to the mouse move event (QMouseEvent)

#### TabBar.mousePressEvent

mousePressEvent(event)

Protected method to handle mouse press events.

event
  reference to the mouse press event (QMouseEvent)

Up

## TabWidget

Class implementing a custimized tab widget.

### Derived from

E5TabWidget

### Class Attributes

None

### Class Methods

None

### Methods

TabWidget | Constructor
__captionChange | Private slot to handle Caption change signals from the editor.
__closeButtonClicked | Private method to handle the press of the close button.
__closeRequested | Private method to handle the press of the individual tab close button.
__contextMenuClose | Private method to close the selected tab.
__contextMenuCloseAll | Private method to close all tabs.
__contextMenuCloseOthers | Private method to close the other tabs.
__contextMenuCopyPathToClipboard | Private method to copy the file name of the selected tab to the clipboard.
__contextMenuMoveFirst | Private method to move a tab to the first position.
__contextMenuMoveLast | Private method to move a tab to the last position.
__contextMenuMoveLeft | Private method to move a tab one position to the left.
__contextMenuMoveRight | Private method to move a tab one position to the right.
__contextMenuOpenRejections | Private slot to open a rejections file associated with the selected tab.
__contextMenuPrintFile | Private method to print the selected tab.
__contextMenuSave | Private method to save the selected tab.
__contextMenuSaveAll | Private method to save all tabs.
__contextMenuSaveAs | Private method to save the selected tab to a new file.
__copyTab | Private method to copy an editor.
__copyTabOther | Private method to copy an editor from another TabWidget.
__cursorLineChanged | Private slot to handle a change of the current editor's cursor line.
__initMenu | Private method to initialize the tab context menu.
__navigationMenuTriggered | Private slot called to handle the navigation button menu selection.
__relocateTab | Private method to relocate an editor from another TabWidget.
__showContextMenu | Private slot to show the tab context menu.
__showNavigationMenu | Private slot to show the navigation button menu.
addTab | Public method to add a new tab.
currentWidget | Public method to return a reference to the current page.
hasEditor | Public method to check for an editor.
hasEditors | Public method to test, if any editor is managed.
indexOf | Public method to get the tab index of the given editor.
insertWidget | Public method to insert a new tab.
mouseDoubleClickEvent | Protected method handling double click events.
removeWidget | Public method to remove a widget.
setCurrentWidget | Public method to set the current tab by the given editor assembly.
showIndicator | Public slot to set the indicator on or off.

### Static Methods

None

#### TabWidget (Constructor)

TabWidget(vm)

Constructor

vm
  view manager widget (Tabview)

#### TabWidget.__captionChange

__captionChange(cap, editor)

Private slot to handle Caption change signals from the editor.

Updates the tab text and tooltip text to reflect the new caption information.

cap
  Caption for the editor
editor
  Editor to update the caption for

#### TabWidget.__closeButtonClicked

__closeButtonClicked()

Private method to handle the press of the close button.

#### TabWidget.__closeRequested

__closeRequested(index)

Private method to handle the press of the individual tab close button.

index
  index of the tab (integer)

#### TabWidget.__contextMenuClose

__contextMenuClose()

Private method to close the selected tab.

#### TabWidget.__contextMenuCloseAll

__contextMenuCloseAll()

Private method to close all tabs.

#### TabWidget.__contextMenuCloseOthers

__contextMenuCloseOthers()

Private method to close the other tabs.

#### TabWidget.__contextMenuCopyPathToClipboard

__contextMenuCopyPathToClipboard()

Private method to copy the file name of the selected tab to the clipboard.

#### TabWidget.__contextMenuMoveFirst

__contextMenuMoveFirst()

Private method to move a tab to the first position.

#### TabWidget.__contextMenuMoveLast

__contextMenuMoveLast()

Private method to move a tab to the last position.

#### TabWidget.__contextMenuMoveLeft

__contextMenuMoveLeft()

Private method to move a tab one position to the left.

#### TabWidget.__contextMenuMoveRight

__contextMenuMoveRight()

Private method to move a tab one position to the right.

#### TabWidget.__contextMenuOpenRejections

__contextMenuOpenRejections()

Private slot to open a rejections file associated with the selected tab.

#### TabWidget.__contextMenuPrintFile

__contextMenuPrintFile()

Private method to print the selected tab.

#### TabWidget.__contextMenuSave

__contextMenuSave()

Private method to save the selected tab.

#### TabWidget.__contextMenuSaveAll

__contextMenuSaveAll()

Private method to save all tabs.

#### TabWidget.__contextMenuSaveAs

__contextMenuSaveAs()

Private method to save the selected tab to a new file.

#### TabWidget.__copyTab

__copyTab(sourceIndex, targetIndex)

Private method to copy an editor.

sourceIndex
  index of the tab (integer)
targetIndex
  index position to place it to (integer)

#### TabWidget.__copyTabOther

__copyTabOther(sourceId, sourceIndex, targetIndex)

Private method to copy an editor from another TabWidget.

sourceId
  id of the TabWidget to get the editor from (string)
sourceIndex
  index of the tab in the old tab widget (integer)
targetIndex
  index position to place it to (integer)

#### TabWidget.__cursorLineChanged

__cursorLineChanged(lineno)

Private slot to handle a change of the current editor's cursor line.

lineno
  line number of the current editor's cursor (zero based)

#### TabWidget.__initMenu

__initMenu()

Private method to initialize the tab context menu.

#### TabWidget.__navigationMenuTriggered

__navigationMenuTriggered(act)

Private slot called to handle the navigation button menu selection.

act
  reference to the selected action (QAction)

#### TabWidget.__relocateTab

__relocateTab(sourceId, sourceIndex, targetIndex)

Private method to relocate an editor from another TabWidget.

sourceId
  id of the TabWidget to get the editor from (string)
sourceIndex
  index of the tab in the old tab widget (integer)
targetIndex
  index position to place it to (integer)

#### TabWidget.__showContextMenu

__showContextMenu(coord, index)

Private slot to show the tab context menu.

coord
  the position of the mouse pointer (QPoint)
index
  index of the tab the menu is requested for (integer)

#### TabWidget.__showNavigationMenu

__showNavigationMenu()

Private slot to show the navigation button menu.

#### TabWidget.addTab

addTab(assembly, title)

Public method to add a new tab.

assembly
  editor assembly object to be added (QScintilla.EditorAssembly.EditorAssembly)
title
  title for the new tab (string)

#### TabWidget.currentWidget

currentWidget()

Public method to return a reference to the current page.

Returns:
  reference to the current page (Editor)

#### TabWidget.hasEditor

hasEditor(editor)

Public method to check for an editor.

editor
  editor object to check for

Returns:
  flag indicating, whether the editor to be checked belongs to the list of editors managed by this tab widget.

#### TabWidget.hasEditors

hasEditors()

Public method to test, if any editor is managed.

Returns:
  flag indicating editors are managed

#### TabWidget.indexOf

indexOf(object)

Public method to get the tab index of the given editor.

object
  object to get the index for (QLabel or Editor)

Returns:
  tab index of the editor (integer)

#### TabWidget.insertWidget

insertWidget(index, assembly, title)

Public method to insert a new tab.

index
  index position for the new tab (integer)
assembly
  editor assembly object to be added (QScintilla.EditorAssembly.EditorAssembly)
title
  title for the new tab (string)

Returns:
  index of the inserted tab (integer)

#### TabWidget.mouseDoubleClickEvent

mouseDoubleClickEvent(event)

Protected method handling double click events.

event
  reference to the event object (QMouseEvent)

#### TabWidget.removeWidget

removeWidget(object)

Public method to remove a widget.

object
  object to be removed (QWidget)

#### TabWidget.setCurrentWidget

setCurrentWidget(assembly)

Public method to set the current tab by the given editor assembly.

assembly
  editor assembly to determine current tab from (EditorAssembly.EditorAssembly)

#### TabWidget.showIndicator

showIndicator(on)

Public slot to set the indicator on or off.

on
  flag indicating the dtate of the indicator (boolean)

Up

## Tabview

Class implementing a tabbed viewmanager class embedded in a splitter.

### Signals

bookmarkToggled(Editor)
  emitted when a bookmark is toggled.
breakpointToggled(Editor)
  emitted when a breakpoint is toggled.
changeCaption(str)
  emitted if a change of the caption is necessary
checkActions(Editor)
  emitted when some actions should be checked for their status
cursorChanged(Editor)
  emitted after the cursor position of the active window has changed
editorChanged(str)
  emitted when the current editor has changed
editorChangedEd(Editor)
  emitted when the current editor has changed
editorClosed(str)
  emitted just before an editor window gets closed
editorClosedEd(Editor)
  emitted just before an editor window gets closed
editorLanguageChanged(Editor)
  emitted to signal a change of an editors language
editorLineChanged(str,int)
  emitted to signal a change of an editor's current line (line is given one based)
editorOpened(str)
  emitted after an editor window was opened
editorOpenedEd(Editor)
  emitted after an editor window was opened
editorRenamed(str)
  emitted after an editor was renamed
editorRenamedEd(Editor)
  emitted after an editor was renamed
editorSaved(str)
  emitted after an editor window was saved
editorSavedEd(Editor)
  emitted after an editor window was saved
editorTextChanged(Editor)
  emitted to signal a change of an editor's text
lastEditorClosed()
  emitted after the last editor window was closed
previewStateChanged(bool)
  emitted to signal a change in the preview state
syntaxerrorToggled(Editor)
  emitted when a syntax error is toggled.

### Derived from

QSplitter, ViewManager

### Class Attributes

None

### Class Methods

None

### Methods

Tabview | Constructor
__currentChanged | Private slot to handle the currentChanged signal.
_addView | Protected method to add a view (i.e.
_initWindowActions | Protected method to define the user interface actions for window handling.
_modificationStatusChanged | Protected slot to handle the modificationStatusChanged signal.
_removeAllViews | Protected method to remove all views (i.e.
_removeView | Protected method to remove a view (i.e.
_showView | Protected method to show a view (i.e.
_syntaxErrorToggled | Protected slot to handle the syntaxerrorToggled signal.
activeWindow | Public method to return the active (i.e.
addSplit | Public method used to split the current view.
canCascade | Public method to signal if cascading of managed windows is available.
canSplit | public method to signal if splitting of the view is available.
canTile | Public method to signal if tiling of managed windows is available.
cascade | Public method to cascade the managed windows.
eventFilter | Public method called to filter the event queue.
getSplitOrientation | Public method to get the orientation of the split view.
getTabWidgetById | Public method to get a reference to a tab widget knowing its ID.
insertView | Public method to add a view (i.e.
nextSplit | Public slot used to move to the next split.
preferencesChanged | Public slot to handle the preferencesChanged signal.
prevSplit | Public slot used to move to the previous split.
removeSplit | Public method used to remove the current split view.
setEditorName | Public method to change the displayed name of the editor.
setSplitOrientation | Public method used to set the orientation of the split view.
showWindowMenu | Public method to set up the viewmanager part of the Window menu.
tile | Public method to tile the managed windows.

### Static Methods

None

#### Tabview (Constructor)

Tabview(parent)

Constructor

parent
  parent widget (QWidget)

#### Tabview.__currentChanged

__currentChanged(index)

Private slot to handle the currentChanged signal.

index
  index of the current tab (integer)

#### Tabview._addView

_addView(win, fn=None, noName="", next=False)

Protected method to add a view (i.e. window).

win
  editor assembly to be added
fn
  filename of this editor (string)
noName
  name to be used for an unnamed editor (string)
next
  flag indicating to add the view next to the current view (bool)

#### Tabview._initWindowActions

_initWindowActions()

Protected method to define the user interface actions for window handling.

#### Tabview._modificationStatusChanged

_modificationStatusChanged(m, editor)

Protected slot to handle the modificationStatusChanged signal.

m
  flag indicating the modification status (boolean)
editor
  editor window changed

#### Tabview._removeAllViews

_removeAllViews()

Protected method to remove all views (i.e. windows).

#### Tabview._removeView

_removeView(win)

Protected method to remove a view (i.e. window).

win
  editor window to be removed

#### Tabview._showView

_showView(win, fn=None)

Protected method to show a view (i.e. window).

win
  editor assembly to be shown
fn
  filename of this editor (string)

#### Tabview._syntaxErrorToggled

_syntaxErrorToggled(editor)

Protected slot to handle the syntaxerrorToggled signal.

editor
  editor that sent the signal

#### Tabview.activeWindow

activeWindow()

Public method to return the active (i.e. current) window.

Returns:
  reference to the active editor

#### Tabview.addSplit

addSplit()

Public method used to split the current view.

#### Tabview.canCascade

canCascade()

Public method to signal if cascading of managed windows is available.

Returns:
  flag indicating cascading of windows is available

#### Tabview.canSplit

canSplit()

public method to signal if splitting of the view is available.

Returns:
  flag indicating splitting of the view is available.

#### Tabview.canTile

canTile()

Public method to signal if tiling of managed windows is available.

Returns:
  flag indicating tiling of windows is available

#### Tabview.cascade

cascade()

Public method to cascade the managed windows.

#### Tabview.eventFilter

eventFilter(watched, event)

Public method called to filter the event queue.

watched
  the QObject being watched (QObject)
event
  the event that occurred (QEvent)

Returns:
  always False

#### Tabview.getSplitOrientation

getSplitOrientation()

Public method to get the orientation of the split view.

Returns:
  orientation of the split (Qt.Horizontal or Qt.Vertical)

#### Tabview.getTabWidgetById

getTabWidgetById(id_)

Public method to get a reference to a tab widget knowing its ID.

id_
  id of the tab widget (long)

Returns:
  reference to the tab widget (TabWidget)

#### Tabview.insertView

insertView(win, tabWidget, index, fn=None, noName="")

Public method to add a view (i.e. window).

win
  editor assembly to be inserted
tabWidget
  reference to the tab widget to insert the editor into (TabWidget)
index
  index position to insert at (integer)
fn
  filename of this editor (string)
noName
  name to be used for an unnamed editor (string)

#### Tabview.nextSplit

nextSplit()

Public slot used to move to the next split.

#### Tabview.preferencesChanged

preferencesChanged()

Public slot to handle the preferencesChanged signal.

#### Tabview.prevSplit

prevSplit()

Public slot used to move to the previous split.

#### Tabview.removeSplit

removeSplit()

Public method used to remove the current split view.

Returns:
  flag indicating successfull removal

#### Tabview.setEditorName

setEditorName(editor, newName)

Public method to change the displayed name of the editor.

editor
  editor window to be changed
newName
  new name to be shown (string)

#### Tabview.setSplitOrientation

setSplitOrientation(orientation)

Public method used to set the orientation of the split view.

orientation
  orientation of the split (Qt.Horizontal or Qt.Vertical)

#### Tabview.showWindowMenu

showWindowMenu(windowMenu)

Public method to set up the viewmanager part of the Window menu.

windowMenu
  reference to the window menu

#### Tabview.tile

tile()

Public method to tile the managed windows.

Up