Create shortcuts for this widget.
6325
def create_shortcuts(self):
        """"""
        # Configurable
        copyfig = config_shortcut(self.copy_figure, context='plots',
                                  name='copy', parent=self)
        prevfig = config_shortcut(self.go_previous_thumbnail, context='plots',
                                  name='previous figure', parent=self)
        nextfig = config_shortcut(self.go_next_thumbnail, context='plots',
                                  name='next figure', parent=self)

        return [copyfig, prevfig, nextfig]
174790
def _create_actions(self):
        
        self.action_to_lower = QtWidgets.QAction(self.editor)
        self.action_to_lower.triggered.connect(self.to_lower)
        self.action_to_upper = QtWidgets.QAction(self.editor)
        self.action_to_upper.triggered.connect(self.to_upper)
        self.action_to_lower.setText(_('Convert to lower case'))
        self.action_to_lower.setShortcut('Ctrl+U')
        self.action_to_upper.setText(_('Convert to UPPER CASE'))
        self.action_to_upper.setShortcut('Ctrl+Shift+U')
        self.menu = QtWidgets.QMenu(_('Case'), self.editor)
        self.menu.addAction(self.action_to_lower)
        self.menu.addAction(self.action_to_upper)
        self._actions_created = True
366214
def create_widget(self):
        
        d = self.declaration
        button_type = UIButton.UIButtonTypeSystem if d.flat else UIButton.UIButtonTypeRoundedRect
        self.widget = UIButton(buttonWithType=button_type)
1047071
def create_shortcuts(self):
        """"""
        # Configurable
        copy_clipboard_file = config_shortcut(self.copy_file_clipboard,
                                              context='explorer',
                                              name='copy file', parent=self)
        paste_clipboard_file = config_shortcut(self.save_file_clipboard,
                                               context='explorer',
                                               name='paste file', parent=self)
        copy_absolute_path = config_shortcut(self.copy_absolute_path,
                                             context='explorer',
                                             name='copy absolute path',
                                             parent=self)
        copy_relative_path = config_shortcut(self.copy_relative_path,
                                             context='explorer',
                                             name='copy relative path',
                                             parent=self)
        return [copy_clipboard_file, paste_clipboard_file, copy_absolute_path,
                copy_relative_path]
726423
def create_widget(self):
        
        d = self.declaration
        self.widget = ToggleButton(self.get_context(), None,
                                   d.style or "@attr/buttonStyleToggle")
1365597
def _generate_list_shortcuts(self):
        

        id_container_shortcuts_before = (
            AccessibleDisplayImplementation.ID_CONTAINER_SHORTCUTS_BEFORE
        )
        id_container_shortcuts_after = (
            AccessibleDisplayImplementation.ID_CONTAINER_SHORTCUTS_AFTER
        )
        local = self.parser.find('body').first_result()
        if local is not None:
            container_before = self.parser.find(
                '#'
                + id_container_shortcuts_before
            ).first_result()
            if (
                (container_before is None)
                and (self.attribute_accesskey_before)
            ):
                container_before = self.parser.create_element('div')
                container_before.set_attribute(
                    'id',
                    id_container_shortcuts_before
                )

                text_container_before = self.parser.create_element('span')
                text_container_before.set_attribute(
                    'class',
                    AccessibleDisplayImplementation.CLASS_TEXT_SHORTCUTS
                )
                text_container_before.append_text(
                    self.attribute_accesskey_before
                )

                container_before.append_element(text_container_before)
                local.prepend_element(container_before)
            if container_before is not None:
                self.list_shortcuts_before = self.parser.find(
                    container_before
                ).find_children('ul').first_result()
                if self.list_shortcuts_before is None:
                    self.list_shortcuts_before = self.parser.create_element(
                        'ul'
                    )
                    container_before.append_element(self.list_shortcuts_before)

            container_after = self.parser.find(
                '#'
                + id_container_shortcuts_after
            ).first_result()
            if (
                (container_after is None)
                and (self.attribute_accesskey_after)
            ):
                container_after = self.parser.create_element('div')
                container_after.set_attribute(
                    'id',
                    id_container_shortcuts_after
                )

                text_container_after = self.parser.create_element('span')
                text_container_after.set_attribute(
                    'class',
                    AccessibleDisplayImplementation.CLASS_TEXT_SHORTCUTS
                )
                text_container_after.append_text(
                    self.attribute_accesskey_after
                )

                container_after.append_element(text_container_after)
                local.append_element(container_after)
            if container_after is not None:
                self.list_shortcuts_after = self.parser.find(
                    container_after
                ).find_children('ul').first_result()
                if self.list_shortcuts_after is None:
                    self.list_shortcuts_after = self.parser.create_element(
                        'ul'
                    )
                    container_after.append_element(self.list_shortcuts_after)
        self.list_shortcuts_added = True
823886
def _makeTextWidgets(self):
        
        self.prompt = urwid.Edit(self.promptText, multiline=False)
        return [self.prompt]
942268
function () {
            var config = scope.getConfig();
            this.config = config;
            // shortcut references to jq DOM objects
            this.$el = config.$el;
            this.$doc = config.$doc;
            this.$viewport = config.$viewport;
            this.$pages = config.$pages;
            this.numPages = config.numPages;

            // add the layout css class
            this.layoutClass = CSS_CLASS_LAYOUT_PREFIX + config.layout;
            this.$el.addClass(this.layoutClass);

            this.initState();
        }
333002
def create_widget(self):
        
        widget = QDoubleSpinBox(self.parent_widget())
        widget.setKeyboardTracking(False)
        self.widget = widget
712469
def _initActions(self):
        

        def createAction(text, shortcut, slot, iconFileName=None):
            """Create QAction with given parameters and add to the widget
            """
            action = QAction(text, self)
            if iconFileName is not None:
                action.setIcon(getIcon(iconFileName))

            keySeq = shortcut if isinstance(shortcut, QKeySequence) else QKeySequence(shortcut)
            action.setShortcut(keySeq)
            action.setShortcutContext(Qt.WidgetShortcut)
            action.triggered.connect(slot)

            self.addAction(action)

            return action

        # scrolling
        self.scrollUpAction = createAction('Scroll up', 'Ctrl+Up',
                                           lambda: self._onShortcutScroll(down = False),
                                           'go-up')
        self.scrollDownAction = createAction('Scroll down', 'Ctrl+Down',
                                             lambda: self._onShortcutScroll(down = True),
                                             'go-down')
        self.selectAndScrollUpAction = createAction('Select and scroll Up', 'Ctrl+Shift+Up',
                                                    lambda: self._onShortcutSelectAndScroll(down = False))
        self.selectAndScrollDownAction = createAction('Select and scroll Down', 'Ctrl+Shift+Down',
                                                      lambda: self._onShortcutSelectAndScroll(down = True))

        # indentation
        self.increaseIndentAction = createAction('Increase indentation', 'Tab',
                                                 self._onShortcutIndent,
                                                 'format-indent-more')
        self.decreaseIndentAction = createAction('Decrease indentation', 'Shift+Tab',
                            lambda: self._indenter.onChangeSelectedBlocksIndent(increase = False),
                            'format-indent-less')
        self.autoIndentLineAction = createAction('Autoindent line', 'Ctrl+I',
                                                  self._indenter.onAutoIndentTriggered)
        self.indentWithSpaceAction = createAction('Indent with 1 space', 'Ctrl+Shift+Space',
                        lambda: self._indenter.onChangeSelectedBlocksIndent(increase=True,
                                                                              withSpace=True))
        self.unIndentWithSpaceAction = createAction('Unindent with 1 space', 'Ctrl+Shift+Backspace',
                            lambda: self._indenter.onChangeSelectedBlocksIndent(increase=False,
                                                                                  withSpace=True))

        # editing
        self.undoAction = createAction('Undo', QKeySequence.Undo,
                                       self.undo, 'edit-undo')
        self.redoAction = createAction('Redo', QKeySequence.Redo,
                                       self.redo, 'edit-redo')

        self.moveLineUpAction = createAction('Move line up', 'Alt+Up',
                                             lambda: self._onShortcutMoveLine(down = False), 'go-up')
        self.moveLineDownAction = createAction('Move line down', 'Alt+Down',
                                               lambda: self._onShortcutMoveLine(down = True), 'go-down')
        self.deleteLineAction = createAction('Delete line', 'Alt+Del', self._onShortcutDeleteLine, 'edit-delete')
        self.cutLineAction = createAction('Cut line', 'Alt+X', self._onShortcutCutLine, 'edit-cut')
        self.copyLineAction = createAction('Copy line', 'Alt+C', self._onShortcutCopyLine, 'edit-copy')
        self.pasteLineAction = createAction('Paste line', 'Alt+V', self._onShortcutPasteLine, 'edit-paste')
        self.duplicateLineAction = createAction('Duplicate line', 'Alt+D', self._onShortcutDuplicateLine)
        self.invokeCompletionAction = createAction('Invoke completion', 'Ctrl+Space', self._completer.invokeCompletion)

        # other
        self.printAction = createAction('Print', 'Ctrl+P', self._onShortcutPrint, 'document-print')
1363590
def setup_menu(self):
        """"""
        self.copy_action = create_action(self, _('Copy'),
                                         shortcut=keybinding('Copy'),
                                         icon=ima.icon('editcopy'),
                                         triggered=self.copy,
                                         context=Qt.WidgetShortcut)
        menu = QMenu(self)
        add_actions(menu, [self.copy_action, ])
        return menu
565253
def create_widget(self):
        
        d = self.declaration
        self.widget = TextClock(self.get_context(), None, d.style)
63562
def create_widget(self):
        
        d = self.declaration
        self.widget = Chronometer(self.get_context(), None, d.style)
1363708
def _context_menu_make(self, pos):
        """"""
        menu = super(ShellWidget, self)._context_menu_make(pos)
        return self.ipyclient.add_actions_to_context_menu(menu)
774653
def shortcut_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/shortcuts"
        return self.call(api_path, method="POST", data=data, **kwargs)
1113383
def create_widget(self):
        
        d = self.declaration
        if d.text:
            Toast.makeText(self.get_context(),
                           d.text, 1).then(self.on_make_toast)
            self.made_toast = True
        else:
            self.toast = Toast(self.get_context())
972887
def create_widget(self):
        
        d = self.declaration
        self.widget = CalendarView(self.get_context(), None,
                                   d.style or "@attr/calendarViewStyle")