@jupyterlab/mainmenu
- Version 3.6.1
- Published
- 51.3 kB
- 8 dependencies
- BSD-3-Clause license
Install
npm i @jupyterlab/mainmenu
yarn add @jupyterlab/mainmenu
pnpm add @jupyterlab/mainmenu
Overview
mainmenu
Index
Variables
Classes
Interfaces
Namespaces
Variables
variable IMainMenu
const IMainMenu: Token<IMainMenu>;
The main menu token.
Classes
class EditMenu
class EditMenu extends RankedMenu implements IEditMenu {}
An extensible Edit menu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
Construct the edit menu.
property clearers
readonly clearers: Set<IEditMenu.IClearer<Widget>>;
A set storing IClearers for the Edit menu.
property goToLiners
readonly goToLiners: Set<IEditMenu.IGoToLiner<Widget>>;
A set storing IGoToLiners for the Edit menu.
property undoers
readonly undoers: Set<IEditMenu.IUndoer<Widget>>;
A set storing IUndoers for the Edit menu.
method dispose
dispose: () => void;
Dispose of the resources held by the edit menu.
class FileMenu
class FileMenu extends RankedMenu implements IFileMenu {}
An extensible FileMenu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
property closeAndCleaners
readonly closeAndCleaners: Set<IFileMenu.ICloseAndCleaner<Widget>>;
The close and cleanup extension point.
property consoleCreators
readonly consoleCreators: Set<IFileMenu.IConsoleCreator<Widget>>;
A set storing IConsoleCreators for the Kernel menu.
property newMenu
readonly newMenu: RankedMenu;
The New submenu.
property quitEntry
quitEntry: boolean;
Option to add a
Quit
entry in File menu
method dispose
dispose: () => void;
Dispose of the resources held by the file menu.
class HelpMenu
class HelpMenu extends RankedMenu implements IHelpMenu {}
An extensible Help menu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
Construct the help menu.
property kernelUsers
readonly kernelUsers: Set<IHelpMenu.IKernelUser<Widget>>;
A set of kernel users for the help menu. This is used to populate additional help links provided by the kernel of a widget.
class KernelMenu
class KernelMenu extends RankedMenu implements IKernelMenu {}
An extensible Kernel menu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
Construct the kernel menu.
property kernelUsers
readonly kernelUsers: Set<IKernelMenu.IKernelUser<Widget>>;
A set storing IKernelUsers for the Kernel menu.
method dispose
dispose: () => void;
Dispose of the resources held by the kernel menu.
class MainMenu
class MainMenu extends MenuBar implements IMainMenu {}
The main menu class. It is intended to be used as a singleton.
constructor
constructor(commands: CommandRegistry);
Construct the main menu bar.
property editMenu
readonly editMenu: EditMenu;
The application "Edit" menu.
property fileMenu
readonly fileMenu: FileMenu;
The application "File" menu.
property helpMenu
readonly helpMenu: HelpMenu;
The application "Help" menu.
property kernelMenu
readonly kernelMenu: KernelMenu;
The application "Kernel" menu.
property runMenu
readonly runMenu: RunMenu;
The application "Run" menu.
property settingsMenu
readonly settingsMenu: SettingsMenu;
The application "Settings" menu.
property tabsMenu
readonly tabsMenu: TabsMenu;
The application "Tabs" menu.
property viewMenu
readonly viewMenu: ViewMenu;
The application "View" menu.
method addMenu
addMenu: (menu: Menu, options?: IMainMenu.IAddOptions) => void;
Add a new menu to the main menu bar.
method dispose
dispose: () => void;
Dispose of the resources held by the menu bar.
method generateMenu
static generateMenu: ( commands: CommandRegistry, options: IMainMenu.IMenuOptions, trans: TranslationBundle) => RankedMenu;
Generate the menu.
Parameter commands
The command registry
Parameter options
The main menu options.
Parameter trans
The application language translator.
class RunMenu
class RunMenu extends RankedMenu implements IRunMenu {}
An extensible Run menu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
Construct the run menu.
property codeRunners
readonly codeRunners: Set<IRunMenu.ICodeRunner<Widget>>;
A set storing ICodeRunner for the Run menu.
### Notes The key for the set may be used in menu labels.
method dispose
dispose: () => void;
Dispose of the resources held by the run menu.
class SettingsMenu
class SettingsMenu extends RankedMenu implements ISettingsMenu {}
An extensible Settings menu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
Construct the settings menu.
class TabsMenu
class TabsMenu extends RankedMenu implements ITabsMenu {}
An extensible Tabs menu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
Construct the tabs menu.
class ViewMenu
class ViewMenu extends RankedMenu implements IViewMenu {}
An extensible View menu for the application.
constructor
constructor(options: IRankedMenu.IOptions);
Construct the view menu.
property editorViewers
readonly editorViewers: Set<IViewMenu.IEditorViewer<Widget>>;
A set storing IEditorViewers for the View menu.
method dispose
dispose: () => void;
Dispose of the resources held by the view menu.
Interfaces
interface IEditMenu
interface IEditMenu extends IRankedMenu {}
An interface for an Edit menu.
property clearers
readonly clearers: Set<IEditMenu.IClearer<Widget>>;
A set storing IClearers for the Edit menu.
property goToLiners
readonly goToLiners: Set<IEditMenu.IGoToLiner<Widget>>;
A set storing IGoToLiners for the Edit menu.
property undoers
readonly undoers: Set<IEditMenu.IUndoer<Widget>>;
A set storing IUndoers for the Edit menu.
interface IFileMenu
interface IFileMenu extends IRankedMenu {}
An interface for a File menu.
property closeAndCleaners
readonly closeAndCleaners: Set<IFileMenu.ICloseAndCleaner<Widget>>;
The close and cleanup extension point.
property consoleCreators
readonly consoleCreators: Set<IFileMenu.IConsoleCreator<Widget>>;
A set storing IConsoleCreators for the File menu.
property newMenu
readonly newMenu: IRankedMenu;
A submenu for creating new files/launching new activities.
property quitEntry
quitEntry: boolean;
Option to add a
Quit
entry in the File menu
interface IHelpMenu
interface IHelpMenu extends IRankedMenu {}
An interface for a Help menu.
property kernelUsers
readonly kernelUsers: Set<IHelpMenu.IKernelUser<Widget>>;
A set of kernel users for the help menu. This is used to populate additional help links provided by the kernel of a widget.
interface IKernelMenu
interface IKernelMenu extends IRankedMenu {}
An interface for a Kernel menu.
property kernelUsers
readonly kernelUsers: Set<IKernelMenu.IKernelUser<Widget>>;
A set storing IKernelUsers for the Kernel menu.
interface IMainMenu
interface IMainMenu {}
The main menu interface.
property editMenu
readonly editMenu: IEditMenu;
The application "Edit" menu.
property fileMenu
readonly fileMenu: IFileMenu;
The application "File" menu.
property helpMenu
readonly helpMenu: IHelpMenu;
The application "Help" menu.
property kernelMenu
readonly kernelMenu: IKernelMenu;
The application "Kernel" menu.
property runMenu
readonly runMenu: IRunMenu;
The application "Run" menu.
property settingsMenu
readonly settingsMenu: ISettingsMenu;
The application "Settings" menu.
property tabsMenu
readonly tabsMenu: ITabsMenu;
The application "Tabs" menu.
property viewMenu
readonly viewMenu: IViewMenu;
The application "View" menu.
method addMenu
addMenu: (menu: Menu, options?: IMainMenu.IAddOptions) => void;
Add a new menu to the main menu bar.
interface IMenuExtender
interface IMenuExtender<T extends Widget> {}
A base interface for a consumer of one of the menu semantic extension points. The IMenuExtender gives a widget tracker which is checked when the menu is deciding which IMenuExtender to delegate to upon selection of the menu item.
property isEnabled
isEnabled?: (widget: T) => boolean;
An additional function that determines whether the extender is enabled. By default it is considered enabled if the application active widget is contained in the
tracker
. If this is also provided, the criterion is equivalent totracker.has(widget) && extender.isEnabled(widget)
property tracker
tracker: IWidgetTracker<T>;
A widget tracker for identifying the appropriate extender.
interface IRunMenu
interface IRunMenu extends IRankedMenu {}
An interface for a Run menu.
property codeRunners
readonly codeRunners: Set<IRunMenu.ICodeRunner<Widget>>;
A set storing ICodeRunner for the Run menu.
### Notes The key for the set may be used in menu labels.
interface ISettingsMenu
interface ISettingsMenu extends IRankedMenu {}
An interface for a Settings menu.
interface ITabsMenu
interface ITabsMenu extends IRankedMenu {}
An interface for a Tabs menu.
interface IViewMenu
interface IViewMenu extends IRankedMenu {}
An interface for a View menu.
property editorViewers
readonly editorViewers: Set<IViewMenu.IEditorViewer<Widget>>;
A set storing IKernelUsers for the Kernel menu.
Namespaces
namespace IEditMenu
namespace IEditMenu {}
Namespace for IEditMenu
interface IClearer
interface IClearer<T extends Widget> extends IMenuExtender<T> {}
Interface for an activity that wants to register a 'Clear...' menu item
property clearAll
clearAll?: (widget: T) => void;
A function to clear all of an activity.
property clearAllLabel
clearAllLabel?: (n: number) => string;
A function to create the label for the
clearAll
action.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
property clearCurrent
clearCurrent?: (widget: T) => void;
A function to clear the currently portion of activity.
property clearCurrentLabel
clearCurrentLabel?: (n: number) => string;
A function to create the label for the
clearCurrent
action.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
interface IGoToLiner
interface IGoToLiner<T extends Widget> extends IMenuExtender<T> {}
Interface for an activity that uses Go to Line.
property goToLine
goToLine?: (widget: T) => void;
Execute a go to line command for the activity.
namespace IFileMenu
namespace IFileMenu {}
Namespace for IFileMenu
interface ICloseAndCleaner
interface ICloseAndCleaner<T extends Widget> extends IMenuExtender<T> {}
Interface for an activity that has some cleanup action associated with it in addition to merely closing its widget in the main area.
property closeAndCleanup
closeAndCleanup: (widget: T) => Promise<void>;
A function to perform the close and cleanup action.
property closeAndCleanupLabel
closeAndCleanupLabel?: (n: number) => string;
A function to create the label for the
closeAndCleanup
action.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
interface IConsoleCreator
interface IConsoleCreator<T extends Widget> extends IMenuExtender<T> {}
Interface for a command to create a console for an activity.
property createConsole
createConsole: (widget: T) => Promise<void>;
The function to create the console.
property createConsoleLabel
createConsoleLabel?: (n: number) => string;
A function to create the label for the
createConsole
action.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
namespace IHelpMenu
namespace IHelpMenu {}
Namespace for IHelpMenu
interface IKernelUser
interface IKernelUser<T extends Widget> extends IMenuExtender<T> {}
Interface for a Kernel user to register itself with the IHelpMenu's semantic extension points.
property getKernel
getKernel: (widget: T) => Kernel.IKernelConnection | null;
A function to get the kernel for a widget.
namespace IKernelMenu
namespace IKernelMenu {}
Namespace for IKernelMenu
interface IKernelUser
interface IKernelUser<T extends Widget> extends IMenuExtender<T> {}
Interface for a Kernel user to register itself with the IKernelMenu's semantic extension points.
property changeKernel
changeKernel?: (widget: T) => Promise<void>;
A function to change the kernel.
property interruptKernel
interruptKernel?: (widget: T) => Promise<void>;
A function to interrupt the kernel.
property reconnectToKernel
reconnectToKernel?: (widget: T) => Promise<void>;
A function to reconnect to the kernel
property restartKernel
restartKernel?: (widget: T) => Promise<boolean>;
A function to restart the kernel, which returns a promise of whether the kernel was restarted.
property restartKernelAndClear
restartKernelAndClear?: (widget: T) => Promise<boolean>;
A function to restart the kernel and clear the widget, which returns a promise of whether the kernel was restarted.
property restartKernelAndClearLabel
restartKernelAndClearLabel?: (n: number) => string;
A function to return the label associated to the
restartKernelAndClear
action.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
property shutdownKernel
shutdownKernel?: (widget: T) => Promise<void>;
A function to shut down the kernel.
namespace IMainMenu
namespace IMainMenu {}
The namespace for IMainMenu attached interfaces.
interface IAddOptions
interface IAddOptions {}
The options used to add a menu to the main menu.
property rank
rank?: number;
The rank order of the menu among its siblings.
interface IMenuOptions
interface IMenuOptions extends MenuFactory.IMenuOptions {}
The instantiation options for an IMainMenu.
namespace IRunMenu
namespace IRunMenu {}
A namespace for RunMenu statics.
interface ICodeRunner
interface ICodeRunner<T extends Widget> extends IMenuExtender<T> {}
An object that runs code, which may be registered with the Run menu.
property restartAndRunAll
restartAndRunAll?: (widget: T) => Promise<boolean>;
A function to restart and run all the code hosted by the widget, which returns a promise of whether the action was performed.
property restartAndRunAllCaption
restartAndRunAllCaption?: (n: number) => string;
Return the caption associated to the
restartAndRunAll
function.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
property restartAndRunAllLabel
restartAndRunAllLabel?: (n: number) => string;
Return the label associated to the
restartAndRunAll
function.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
property run
run?: (widget: T) => Promise<void>;
A function to run a chunk of code.
property runAll
runAll?: (widget: T) => Promise<void>;
A function to run the entirety of the code hosted by the widget.
property runAllCaption
runAllCaption?: (n: number) => string;
Return the caption associated to the
runAll
function.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
property runAllLabel
runAllLabel?: (n: number) => string;
Return the label associated to the
runAll
function.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
property runCaption
runCaption?: (n: number) => string;
Return the caption associated to the
run
function.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
property runLabel
runLabel?: (n: number) => string;
Return the label associated to the
run
function.This function receives the number of items
n
to be able to provided correct pluralized forms of translations.
namespace IViewMenu
namespace IViewMenu {}
Namespace for IViewMenu.
interface IEditorViewer
interface IEditorViewer<T extends Widget> extends IMenuExtender<T> {}
Interface for a text editor viewer to register itself with the text editor extension points.
property lineNumbersToggled
lineNumbersToggled?: (widget: T) => boolean;
Whether line numbers are toggled.
property matchBracketsToggled
matchBracketsToggled?: (widget: T) => boolean;
Whether match brackets is toggled.
property toggleLineNumbers
toggleLineNumbers?: (widget: T) => void;
Whether to show line numbers in the editor.
property toggleMatchBrackets
toggleMatchBrackets?: (widget: T) => void;
Whether to match brackets in the editor.
property toggleWordWrap
toggleWordWrap?: (widget: T) => void;
Whether to word-wrap the editor.
property wordWrapToggled
wordWrapToggled?: (widget: T) => boolean;
Whether word wrap is toggled.
Package Files (11)
Dependencies (8)
Dev Dependencies (7)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@jupyterlab/mainmenu
.
- Markdown[](https://www.jsdocs.io/package/@jupyterlab/mainmenu)
- HTML<a href="https://www.jsdocs.io/package/@jupyterlab/mainmenu"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4533 ms. - Missing or incorrect documentation? Open an issue for this package.