How to use the ext/commands/commands.addCommand function in ext

To help you get started, we’ve selected a few ext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pylonide / pylon / plugins-client / ext.splitview / splitview.js View on Github external
}
        });
        
        commands.addCommand({
            name: "nexteditor",
            bindKey : {mac: "Ctrl-]", win: "Ctrl-]"},
            hint: "Navigate to the next editor right or below the editor that is currently active in the current split view",
            isAvailable : function(){
                //@todo
                return true;
            },
            exec: function(){
                _self.mergetableft();
            }
        });
        commands.addCommand({
            name: "preveditor",
            bindKey : {mac: "Ctrl-[", win: "Ctrl-["},
            hint: "Navigate to the previous editor left or above the editor that is currently active in the current split view",
            isAvailable : function(){
                //@todo
                return true;
            },
            exec: function(){
                _self.mergetableft();
            }
        });
        
        //@todo add menus
        
        var tabs = tabEditors; // localize global 'tabEditors'
        var parent = tabbehaviors.menu;
github pylonide / pylon / plugins-client / ext.debugger / debugger.js View on Github external
hook : function(){
        var _self = this;
        
        commands.addCommand({
            name: "resume",
            hint: "resume the current paused process",
            bindKey: {mac: "F8", win: "F8"},
            exec: function(){
                self.dbg && dbg.continueScript();
            }
        });
        commands.addCommand({
            name: "stepinto",
            hint: "step into the function that is next on the execution stack",
            bindKey: {mac: "F11", win: "F11"},
            exec: function(){
                self.dbg && dbg.stepInto();
            }
        });
        commands.addCommand({
            name: "stepover",
            hint: "step over the current expression on the execution stack",
            bindKey: {mac: "F10", win: "F10"},
            exec: function(){
                self.dbg && dbg.stepNext();
            }
        });
        commands.addCommand({
github pylonide / pylon / plugins-client / ext.settings / settings.js View on Github external
hook : function(){
        var _self = this;

        this.markupInsertionPoint = colLeft;

        panels.register(this, {
            position : 100000,
            caption: "Preferences",
            "class": "preferences",
            command: "opensettingspanel"
        });

        commands.addCommand({
            name: "opensettingspanel",
            hint: "show the open settings panel",
            bindKey: {mac: "Command-,", win: "Ctrl-,"},
            exec: function () {
                _self.show();
            }
        });

        //Backwards compatible
        this.model = settings.model;
        this.setDefaults = settings.setDefaults;
    },
github pylonide / pylon / plugins-client / ext.zen / zen.js View on Github external
hook : function(){
        var _self = this;
        
        commands.addCommand({
            name: "zen",
            hint: "toggle zen mode",
            bindKey: {mac: "Option-Z", win: "Alt-Z"},
            isAvailable : function(editor){
                return !!editor;
            },
            exec: function () {
                _self.zen();
            }
        });
        
        commands.addCommand({
            name: "zenslow",
            hint: "toggle zen mode in slow-motion",
            bindKey: {mac: "Shift-Option-Z", win: "Shift-Alt-Z"},
            isAvailable : function(editor){
github pylonide / pylon / doc / ext.extension_template / extension_template.js View on Github external
init : function(){
        var _self = this;
        this.winExtensionTemplate = winExtensionTemplate;
        
        commands.addCommand({
            name: "sayhello",
            hint: "I'll say something",
            msg: "Popping window!",
            bindKey: {mac: "Shift-1", win: "Ctrl-1"},
            isAvailable : function() {
                return true;    
            },
            exec: function() {
                _self.winExtensionTemplate.show()
            }
        });
        
        this.nodes.push(
            menus.addItemByPath("Edit/Extension Template", new apf.item({
                command : "sayhello"
            }), 5400)
github pylonide / pylon / plugins-client / ext.debugger / debugger.js View on Github external
name: "resume",
            hint: "resume the current paused process",
            bindKey: {mac: "F8", win: "F8"},
            exec: function(){
                _self.continueScript();
            }
        });
        commands.addCommand({
            name: "stepinto",
            hint: "step into the function that is next on the execution stack",
            bindKey: {mac: "F11", win: "F11"},
            exec: function(){
                _self.continueScript("in");
            }
        });
        commands.addCommand({
            name: "stepover",
            hint: "step over the current expression on the execution stack",
            bindKey: {mac: "F10", win: "F10"},
            exec: function(){
                _self.continueScript("next");
            }
        });
        commands.addCommand({
            name: "stepout",
            hint: "step out of the current function scope",
            bindKey: {mac: "Shift-F11", win: "Shift-F11"},
            exec: function(){
                _self.continueScript("out");
            }
        });
        commands.addCommand({
github pylonide / pylon / plugins-client / ext.quickwatch / quickwatch.js View on Github external
hook : function(){
        var _self = this;
        
        commands.addCommand({
            name : "quickwatch",
            bindKey: {mac: "Option-Q", win: "Alt-Q"},
            hint: "quickly inspect the variable that is under the cursor",
            exec: function(){
                _self.quickwatch();
            },
            isAvailable: function() {
                return !!dbg.state;
            }
        });
    },
github pylonide / pylon / plugins-client / ext.revisions / revisions-new.js View on Github external
hook: function() {
        var self = this;
        commands.addCommand({
            name: "revisionpanel",
            hint: "File Revision History...",
            bindKey: { mac: "Command-B", win: "Ctrl-B" },
            isAvailable: function(editor) { return editor && !!editor.ceEditor; },
            exec: function () { self.toggle(); }
        });

        this.nodes.push(
            this.mnuSave = new apf.menu({ id: "mnuSave" }),
            menus.addItemByPath("File/~", new apf.divider(), 800),
            menus.addItemByPath("File/File Revision History...", new apf.item({
                type: "check",
                checked: "[{require('ext/settings/settings').model}::general/@revisionsvisible]",
                disabled: "{!tabEditors.length}",
                command: "revisionpanel"
            }), 900),
github pylonide / pylon / plugins-client / ext.stripws / stripws.js View on Github external
hook: function () {
        var self = this;

        commands.addCommand({
            name: "stripws",
            hint: "strip whitespace at the end of each line",
            isAvailable : function(editor){
                return editor && editor.ceEditor;
            },
            exec: function(){
                ext.initExtension(self);
                self.stripws();
            }
        });

        this.nodes.push(
            menus.addItemByPath("Tools/Strip Whitespace", new apf.item({
                command : "stripws"
            }), 200)
        );
github pylonide / pylon / plugins-client / ext.zen / zen.js View on Github external
hook : function(){
        var _self = this;
        
        commands.addCommand({
            name: "zen",
            hint: "toggle zen mode",
            bindKey: {mac: "Option-Z", win: "Alt-Z"},
            isAvailable : function(editor){
                return !!editor;
            },
            exec: function () {
                _self.zen();
            }
        });
        
        commands.addCommand({
            name: "zenslow",
            hint: "toggle zen mode in slow-motion",
            bindKey: {mac: "Shift-Option-Z", win: "Shift-Alt-Z"},
            isAvailable : function(editor){