# eric7.Project.ProjectSourcesBrowser

Module implementing a class used to display the Sources part of the project.

### Global Attributes

None

### Classes

ProjectSourcesBrowser | A class used to display the Sources part of the project.

### Functions

None

## ProjectSourcesBrowser

A class used to display the Sources part of the project.

### Signals

showMenu(str, QMenu)
  emitted when a menu is about to be shown. The name of the menu and a reference to the menu are given.

### Derived from

ProjectBaseBrowser

### Class Attributes

None

### Class Methods

None

### Methods

ProjectSourcesBrowser | Constructor
__addNewPackage | Private method to add a new package to the project.
__addSourceDirectory | Private method to add source files of a directory to the project.
__addSourceFiles | Private method to add a source file to the project.
__closeAllWindows | Private method to close all project related windows.
__contextMenuCoverageScript | Private method to run a coverage test of the editor script.
__contextMenuDebugScript | Private method to debug the editor script.
__contextMenuProfileScript | Private method to profile the editor script.
__contextMenuRunScript | Private method to run the editor script.
__createJavaScriptPopupMenus | Private method to generate the popup menus for a Python project.
__createPythonPopupMenus | Private method to generate the popup menus for a Python project.
__createRubyPopupMenus | Private method to generate the popup menus for a Ruby project.
__deleteFile | Private method to delete files from the project.
__loadDiagram | Private slot to load a diagram from file.
__performFormatWithBlack | Private method to format the selected project sources using the 'Black' tool.
__showApplicationDiagram | Private method to handle the application diagram context menu action.
__showClassDiagram | Private method to handle the class diagram context menu action.
__showCodeCoverage | Private method to handle the code coverage context menu action.
__showCodeMetrics | Private method to handle the code metrics context menu action.
__showContextMenu | Private slot called by the sourceMenu aboutToShow signal.
__showContextMenuBack | Private slot called by the backMenu aboutToShow signal.
__showContextMenuCheck | Private slot called before the checks menu is shown.
__showContextMenuDir | Private slot called by the dirMenu aboutToShow signal.
__showContextMenuDirMulti | Private slot called by the dirMultiMenu aboutToShow signal.
__showContextMenuFormatting | Private slot called before the Code Formatting menu is shown.
__showContextMenuGraphics | Private slot called before the checks menu is shown.
__showContextMenuMulti | Private slot called by the multiMenu aboutToShow signal.
__showContextMenuShow | Private slot called before the show menu is shown.
__showImportsDiagram | Private method to handle the imports diagram context menu action.
__showPackageDiagram | Private method to handle the package diagram context menu action.
__showProfileData | Private method to handle the show profile data context menu action.
_contextMenuRequested | Protected slot to show the context menu.
_createPopupMenus | Protected overloaded method to generate the popup menu.
_openItem | Protected slot to handle the open popup menu entry.
_projectClosed | Protected slot to handle the projectClosed signal.

### Static Methods

None

#### ProjectSourcesBrowser (Constructor)

ProjectSourcesBrowser(project, parent=None)

Constructor

project
  reference to the project object
parent
  parent widget of this browser (QWidget)

#### ProjectSourcesBrowser.__addNewPackage

__addNewPackage()

Private method to add a new package to the project.

#### ProjectSourcesBrowser.__addSourceDirectory

__addSourceDirectory()

Private method to add source files of a directory to the project.

#### ProjectSourcesBrowser.__addSourceFiles

__addSourceFiles()

Private method to add a source file to the project.

#### ProjectSourcesBrowser.__closeAllWindows

__closeAllWindows()

Private method to close all project related windows.

#### ProjectSourcesBrowser.__contextMenuCoverageScript

__contextMenuCoverageScript()

Private method to run a coverage test of the editor script.

#### ProjectSourcesBrowser.__contextMenuDebugScript

__contextMenuDebugScript()

Private method to debug the editor script.

#### ProjectSourcesBrowser.__contextMenuProfileScript

__contextMenuProfileScript()

Private method to profile the editor script.

#### ProjectSourcesBrowser.__contextMenuRunScript

__contextMenuRunScript()

Private method to run the editor script.

#### ProjectSourcesBrowser.__createJavaScriptPopupMenus

__createJavaScriptPopupMenus()

Private method to generate the popup menus for a Python project.

#### ProjectSourcesBrowser.__createPythonPopupMenus

__createPythonPopupMenus()

Private method to generate the popup menus for a Python project.

#### ProjectSourcesBrowser.__createRubyPopupMenus

__createRubyPopupMenus()

Private method to generate the popup menus for a Ruby project.

#### ProjectSourcesBrowser.__deleteFile

__deleteFile()

Private method to delete files from the project.

#### ProjectSourcesBrowser.__loadDiagram

__loadDiagram()

Private slot to load a diagram from file.

#### ProjectSourcesBrowser.__performFormatWithBlack

__performFormatWithBlack(action)

Private method to format the selected project sources using the 'Black' tool.

Following actions are supported.

- BlackFormattingAction.Format - the code reformatting is performed
- BlackFormattingAction.Check - a check is performed, if code formatting is necessary
- BlackFormattingAction.Diff - a unified diff of potential code formatting changes is generated

action (BlackFormattingAction)
  formatting operation to be performed

#### ProjectSourcesBrowser.__showApplicationDiagram

__showApplicationDiagram()

Private method to handle the application diagram context menu action.

#### ProjectSourcesBrowser.__showClassDiagram

__showClassDiagram()

Private method to handle the class diagram context menu action.

#### ProjectSourcesBrowser.__showCodeCoverage

__showCodeCoverage()

Private method to handle the code coverage context menu action.

#### ProjectSourcesBrowser.__showCodeMetrics

__showCodeMetrics()

Private method to handle the code metrics context menu action.

#### ProjectSourcesBrowser.__showContextMenu

__showContextMenu()

Private slot called by the sourceMenu aboutToShow signal.

#### ProjectSourcesBrowser.__showContextMenuBack

__showContextMenuBack()

Private slot called by the backMenu aboutToShow signal.

#### ProjectSourcesBrowser.__showContextMenuCheck

__showContextMenuCheck()

Private slot called before the checks menu is shown.

#### ProjectSourcesBrowser.__showContextMenuDir

__showContextMenuDir()

Private slot called by the dirMenu aboutToShow signal.

#### ProjectSourcesBrowser.__showContextMenuDirMulti

__showContextMenuDirMulti()

Private slot called by the dirMultiMenu aboutToShow signal.

#### ProjectSourcesBrowser.__showContextMenuFormatting

__showContextMenuFormatting()

Private slot called before the Code Formatting menu is shown.

#### ProjectSourcesBrowser.__showContextMenuGraphics

__showContextMenuGraphics()

Private slot called before the checks menu is shown.

#### ProjectSourcesBrowser.__showContextMenuMulti

__showContextMenuMulti()

Private slot called by the multiMenu aboutToShow signal.

#### ProjectSourcesBrowser.__showContextMenuShow

__showContextMenuShow()

Private slot called before the show menu is shown.

#### ProjectSourcesBrowser.__showImportsDiagram

__showImportsDiagram()

Private method to handle the imports diagram context menu action.

#### ProjectSourcesBrowser.__showPackageDiagram

__showPackageDiagram()

Private method to handle the package diagram context menu action.

#### ProjectSourcesBrowser.__showProfileData

__showProfileData()

Private method to handle the show profile data context menu action.

#### ProjectSourcesBrowser._contextMenuRequested

_contextMenuRequested(coord)

Protected slot to show the context menu.

coord
  the position of the mouse pointer (QPoint)

#### ProjectSourcesBrowser._createPopupMenus

_createPopupMenus()

Protected overloaded method to generate the popup menu.

#### ProjectSourcesBrowser._openItem

_openItem()

Protected slot to handle the open popup menu entry.

#### ProjectSourcesBrowser._projectClosed

_projectClosed()

Protected slot to handle the projectClosed signal.

Up