Product Documentation

Komodo 4.4 Documentation

ko

Classes

class objectTimer

Constructor

objectTimer(instance, func, args)

Class variables

args - args


func - func


instance - instance


interval - window.setInterval()


running - Boolean


timeout - window.setTimeout()


timer - Number


Class functions

free()

monitor()

startInterval(timer)

startTimeout(timer)

stop(timer)

stopInterval()

stopTimeout()


ko.abbrev

Functions

expandAbbrev(abbrev, lang, sublang)

Expands the abbreviation, if any, at the current cursor position.

Arguments

abbrev - String

Optional. The abbreviation to expand. If not given, then the current selection or word before the cursor is used.

lang - String

The language name to scope the search. Optional.

sublang - String

The sub-language name top scope the search. Optional.

Returns - Boolean


findAbbrevSnippet(abbrev, lang, sublang)

Find a snippet for the given abbreviation name. Abbreviations used for snippets are looked for in "Abbreviations" groups in these places: 1. the current project (if any) 2. the toolbox 3. the shared toolbox (if any) And for these languages: A. the current buffer sub-lang (for multi-lang files) B. the current buffer lang (if different than A) C. the "General" lang (i.e. not language-specific)

Arguments

abbrev - String

The abbreviation name.

lang - String

The language name to scope the search. Optional. If not given, then the language of the current view is used. Specify "General" to *not* search for a lang-specific abbreviation.

sublang - String

The sub-language name top scope the search. This can be relevant for multi-language files (e.g. HTML can have HTML and JavaScript and CSS). Optional. If not given, then the sub-lang of the current cursor position in the current view is used. Specify "General" to *not* search for a sub-lang-specific abbreviation.

Returns - Components.interfaces.koIPart_snippet


insertAbbrevSnippet(snippet, view)

Insert an abbreviation snippet into a buffer.

Arguments

snippet - Components.interfaces.koIPart_snippet

The snippet part to insert. You can use `ko.abbrev.findAbbrevSnippet()` to get one.

view - Components.interfaces.koIView

The buffer view in which to insert the snippet. Optional. If not specified then the current view is used.


ko.browse

Functions

about()

show our about dialog XXX DEPRECATE, this should be dialog.about or ko.about


aspnMailingList(topic)

show mailing list archives on ASPN that are related to the topic

Arguments

topic - String


browseTag(tag)

browse to a predefined url on activestate.com see tag2uri in ko.browse


localHelp(app)

show the url defined in "localHelpFile" in an instance of koIAppInfoEx

Arguments

app - String

the app identifier from the CID of a koIAppInfoEx implementation (eg. @activestate.com/koAppInfoEx?app=Perl)


openUrlInDefaultBrowser(url, browser)

open the given url or complain appropriately

Arguments

url - String

browser - String

optional, retreived from prefs if not used


showCommandIds()

show a list of command id's in the browser


showKeybindings()

show a list of keybindings in the browser


updateHelpLanguagesPopup()

Hide or show the local help entries in the Help->Languages popup depending on whether an actual help file to launch can be found.


webHelp(app)

show the url defined in "webHelpURL" in an instance of koIAppInfoEx

Arguments

app - String

the app identifier from the CID of a koIAppInfoEx implementation (eg. @activestate.com/koAppInfoEx?app=Perl)


ko.commands

Functions

doCode(cmdId, code)

doCodeAsync(cmdId, code)

doCommand(command)

Returns - rc


doCommandAsync(command, event)
Arguments

event - Event

Returns - Boolean


setCommandEnabled(id, node, supported, enabled)
Arguments

node - top.document.getElementById()


updateCommand(command, commandNode, controller)
Arguments

controller - _getControllerForCommand()

Returns - found


updateCommandset(commandset)

ko.dialogs

Variables

alert - parent.opener.ko.dialogs.alert


yesNo - parent.opener.ko.dialogs.yesNo


yesNo()


Functions

alert(prompt, text, title, doNotAskPref, options)
Arguments

options - String


authenticate(title, message, loginname, allowAnonymous, allowPersist)

Returns - ko.dialogs.authenticate2()


authenticate2(prompt, server, username, allowAnonymous, title, login)

Returns - Object


customButtons(prompt, buttons, response, text, title, doNotAskPref, style)
Arguments

style - String

Returns - obj.response


editEnvVar(name, value, title, mruName, interpolateValues)
Arguments

mruName - String

interpolateValues - Boolean


handleEnterKey()

internalError(error, text)

okCancel(prompt, response, text, title, doNotAskPref)

Returns - obj.response


pickIcon()

pickPreview(url, language, mode)
Arguments

mode - String

Returns - Object


progress(processor, prompt, title, is_cancellable, cancel_warning, modal)
Arguments

is_cancellable - Boolean

modal - Boolean


prompt(prompt, label, value, title, mruName, validator, multiline, screenX, screenY, tacType, tacParam, tacShowCommentColumn, selectionStart, selectionEnd)

prompt2(prompt, label1, value1, label2, value2, title, mruName1, mruName2, validator, multiline1, multiline2, screenX, screenY)

selectFromList(title, prompt, items, selectionCondition, stringifier, doNotAskPref, yesNoCancel, buttonNames)
Arguments

selectionCondition - String

yesNoCancel - Boolean


yesNo(prompt, response, text, title, doNotAskPref)

Returns - obj.response


yesNoCancel(prompt, response, text, title, doNotAskPref, style)
Arguments

response - String

style - String

Returns - obj.response


ko.dragDrop

Functions

unpackData(flavourData, ret)

ko.dragDrop.dragObserver

Variables

canHandleMultipleItems - Boolean


Functions

canDrop(event, session)
Arguments

event - Event

Returns - Boolean


doDragOverEvent(event)
Arguments

event - Event


doDropEvent(event)
Arguments

event - Event


focusWindow()

getSupportedFlavours()

Returns - flavours


onDragOver(event, flavour, session)
Arguments

event - Event

Returns - Boolean


onDrop(event, transferDataSet, dragSession)
Arguments

event - Event


ko.eggs

Functions

boing()

ko.filepicker

Functions

browseForDir(textbox)

A dialog to pick a directory, and put the directory path into a XUL textbox.

Arguments

textbox - Element


browseForRemoteDir(textbox)

A dialog to pick a remote directory and put the path into a XUL textbox.

Arguments

textbox - Element


getFolder(defaultDirectory, prompt)

Pick a directory/folder.

Returns - String


openExeFile(defaultDirectory, defaultFilename, title)

Pick an executable file for open.

Arguments

defaultDirectory - ko.uriparse.dirName()

title - String

Returns - String


openFile(defaultDirectory, defaultFilename, title, defaultFilterName, filterNames)

Pick a file for open.

Arguments

defaultDirectory - ko.uriparse.dirName()

title - String

Returns - String


openFiles(defaultDirectory, defaultFilename, title, defaultFilterName, filterNames)

Pick multiple files for open.

Arguments

defaultDirectory - ko.uriparse.dirName()

title - String

Returns - Array


openRemoteFiles(defaultUrl, defaultFilename, defaultFilterName, filterNames)

Open remote file(s) Same parameters meanings as "filepicker_remoteFileBrowser" (above) Returns nothing. Note: The files will be opened through this function call


remoteFileBrowser(defaultUrl, defaultFilename, mode, title, defaultFilterName, filterNames, helpTag)

Browse for remote file(s)

Arguments

defaultUrl - _lastRemoteLocation

defaultFilename - String

mode - Components.interfaces.nsIFilePicker.modeOpen

title - String

defaultFilterName - Array

filterNames - Array

helpTag - String

Returns - Object


saveAsRemoteFiles(defaultUrl, defaultFilename, defaultFilterName, filterNames)

Choose remote filename to save as Same parameters meanings as "filepicker_remoteFileBrowser" (above) Returns the remote url of the selected file, or null if the dialog is cancelled.


saveFile(defaultDirectory, defaultFilename, title, defaultFilterName, filterNames)

Pick a file for save.

Arguments

defaultDirectory - ko.uriparse.dirName()

title - String

Returns - String


ko.fileutils

Functions

showDiffs(fname1, fname2)
Arguments

fname1 - fname1.replace()

fname2 - fname2.replace()


ko.help

Functions

alternate()

alternate uses the alternate help preference


DEPRECATED_getTag(tag)

getTag old help open method, DEPRECATED

Returns - tag


DEPRECATED_openTag(tag)

openTag old help open method, DEPRECATED


language()

language open language specific help for the current buffer.


open(page)

open open Komodo help window

Arguments

page - String

a page tag as defined in toc.xml


tutorialProject(tutorial)

tutorialProject used by the help system to open KPF files associated with a tutorial

Arguments

tutorial - String

name of tutorial to open


tutorials(tutorial)

tutorials Open the Tutorial in the help browser "tutorial" can optionally be used to specify a particular tutorial to start with. Currently valid values are "perl", "python", "php", "xslt", and null (to go to Tutorial home page).

Arguments

tutorial - String

name of tutorial to open


ko.inputBuffer

Input buffering When you need to capture user input while a slow XUL window is loading you can use the input buffer. Usage: - in some JS code: ko.inputBuffer.start() // open XUL window - in slow XUL window onload handler: var contents = ko.inputBuffer.finish(); // use the contents somehow

Variables

id - String


Functions

finish()

Returns - contents


focus(event)
Arguments

event - Event


start()

ko.interpolate

Utility methods to easily use the KoIInterpolationService from JavaScript. Basically you can use the ko.interpolate.interpolate() method to iterpolation special '%'-escape codes in a given list of strings. See koInterpolationService.py (or play around with "run commands") for an authoritative description of available escape codes. How to interpolate a couple of strings (mystringa, mystringb). You can do as many strings as you want. var imystringa = null; var imystringb = null; try { var istrings = ko.interpolate.interpolate( <ref-to-komodo.xul>, [mystringa, mystringb], // codes are not bracketed [mystringc, mystringd], // codes are bracketed <optional-query-title>); imystringaForUse = istrings[0]; imystringaForDisplay = istrings[1]; imystringbForUse = istrings[2]; imystringbForDisplay = istrings[3]; imystringcForUse = istrings[4]; imystringcForDisplay = istrings[5]; imystringdForUse = istrings[6]; imystringcForDisplay = istrings[7]; } catch (ex) { var errno = lastErrorSvc.getLastErrorCode(); if (errno == Components.results.NS_ERROR_ABORT) { // Command was cancelled. } else if (errno == Components.results.NS_ERROR_INVALID_ARG) { var errmsg = lastErrorSvc.getLastErrorMessage(); alert("Could not interpolate:" + errmsg); } else { log.error(ex); alert("There was an unexpected error: " + ex); } }

Functions

activeProjectPath()

Returns - projectFile


currentFilePath()

Returns - String


currentFileProjectPath()

Returns - projectFile


getBlockOffsets(s, bracketed)

Return a list of start and end offsets of interpolation code blocks into the given strings "s".

Returns - offsets


getViewData(editor, viewData)

A utility function to retrieving specific view data required by Interpolate_interpolate(). "editor" is a reference to the komodo.xul window. "viewData" (optional) is a object possibly containing overriding values for some of the view data.

Arguments

viewData - Object

Returns - viewData


getWordUnderCursor(scimoz)

Return the current word from the current scimoz character position.

Arguments

scimoz - Components.interfaces.ISciMoz

(Optional) The scimoz editor to retireive the word from.

Returns - String


interpolate(editor, strings, bracketedStrings, queryTitle, viewData)

Interpolate '%'-escape codes in the given list(s) of strings. "editor" is a reference the komodo.xul window. "strings" is a list of raw strings to interpolate. "bracketedStrings" is a list of raw strings to interpolate, using the bracketed form "queryTitle" (optional) is a title for the possible query dialog raised during interpolation. "viewData" (optional) allows one to override specific view data used for interpolation. By default view data is retrieved from the current view. This may not always be appropriate. It may be an object with one or more of the following attributes: "fileName" is the filename of the current file (null, if N/A); "lineNum" is the current line number (0, if N/A); "word" is the current word under cursor (null if none); "selection" is the current selection (null if none). On success, this function returns a *double* list of interpolated strings: For each string in "strings" and "bracketedStrings" two strings are returned. The first is the interpolated string for use and the second for *display*. In most cases these are the same but they may differ, for example, if a password query response was interpolated into the string which should not be displayed in the Komodo UI. Otherwise an exception is raised and an error set on the last error service: koILastError errno reason ----------------------- ----------------------------------------- NS_ERROR_ABORT User cancelled the query dialog. NS_ERROR_INVALID_ARG A normal interpolation failure because of invalid interp code usage.

Arguments

viewData - ko.interpolate.getViewData()

Returns - istrings


interpolateStrings(s, bracketed, queryTitle)
Arguments

bracketed - Boolean

queryTitle - String

Returns - istring


isWordCharacter(ch)

ko.isearch

Variables

controller - ISController


ko.keybindings

Variables

keylabel2keysequence - keylabel2keysequence


keysequence2keylabel - keysequence2keylabel


Functions

onload()

Classes

class manager

Constructor

manager()

Class variables

_commandParams - Object


_configDirty - Boolean


_configKeyTree - cloneObject()


_configUnsaved - Boolean


_keyPressCaptureWindow - window


_knownconfigs - Array


activeCommands - Object


command2key - Object


commanditems - Array


commandnames - Array


constructor


currentConfiguration - gPrefSvc.prefs.getStringPref()


currentPrefixMap - this.keyTree


currentPrefixString - String


currentScheme - this.keybindingSchemeService.getScheme()


data - lines.join()


document - document


inPrefixCapture - Boolean


key2command - Object


keybindingSchemeService


keyDownLabels


keynames - Array


keyTree - Object


lastcategory - String


prefset - gPrefSvc.prefs


rownum - Number


Class functions

_addRow(category, desc, keys)
Arguments

desc - desc.replace()

Returns - String


_clearActiveBindings()

_configKnown(newconfigname)

Returns - Boolean


_getKeyTreeRoot(keysequence)

Returns - root


_saveKnownConfigs()

_usedbys(root, remainingsequence, sofarsequence, usedbys)
Arguments

root - commandMatch


applyCurrentConfiguration()

assignKey(commandId, keysequence, parameter)

cancelPrefix(why)

clearBinding(commandId, commandParam, restore)

clearBindings()

clearSequence(commandId, keylabel, restore)

clearUsedBys(commandId, keysequence)

command2keylabel(commandId)

Returns - keysequence2keylabel()


command2keysequences(commandId, commandParam)

Returns - seqs


commandId2desc(commandname, param, label)

Returns - commanddesc


commandId2parameter(commandname, label)

Returns - String


commandId2shortdesc(commandname, param)

Returns - commanddesc


commandId2tabledesc(commandname, param)

Returns - commanddesc


configurationWriteable(configname)

Returns - scheme.writeable


deleteConfiguration(configname, prefset)

evalCommand(event, commandname, keylabel)
Arguments

event - Event

Returns - Boolean


event2keylabel(event, useShift)
Arguments

event - Event

useShift - Boolean

Returns - data.join()


eventBindings(event)
Arguments

event - Event

Returns - possible


getConfigurations()

Returns - this._knownconfigs


getKey(keyname)
Arguments

keyname - keyname.slice()


keypressHandler(event)
Arguments

event - Event


learnParameter(commandId, parameter, keylabel)

loadConfiguration(configName, forceReload)
Arguments

forceReload - Boolean


makeCommandIdTable()

Returns - String


makeCurrentKeyBindingTable()

Returns - String


makeDirty()

makeKeyActive(commandId, keysequence)

makeNewConfiguration(newconfigname, prefset)

Returns - newconfigname


mergeSchemeConfiguration(configName, forceReload)
Arguments

forceReload - Boolean


observe(part, topic, partId)

offerToSave()

parseConfiguration(data, forceReload, ignoreCommandPrefix)

Parse the keybinding configuration file data into commands. Acitivate the keybinding commands.

Arguments

forceReload - Boolean


parseGlobalData()

removeCommandsWithPrefix(prefix)

revertToPref(configname)

saveAndApply(prefset)

saveCurrentConfiguration()

setKeyBinding(keysequence, commandId, commandKey)

Returns - key


startPrefixCapture()

stashIn(vessel, keylabel)

switchConfiguration(newconfigname)

Returns - Boolean


unsetKey(keylabel)

unsetKeyBinding(commandId)

usedBy(sequence)

Returns - usedbys


walk_and_apply(root, keysequence)


ko.launch

Functions

checkForUpdates()

Opens the update manager and checks for updates to the application. From http://plow/source/xref/mozilla/1.8/browser/base/content/utilityOverlay.js#452


diff(diff, title, message)

diff open the diff dialog, you must provide the diff

Arguments

diff - String

title - String

message - String

Returns - ko.windowManager.openDialog()


find(pattern)

Open the Find dialog.

Arguments

pattern - String

The pattern to search for.

Returns - ko.windowManager.openDialog()


findInCollection(collection, pattern)

Open the find dialog for searching in a "collection" find context.

Arguments

collection - koICollectionFindContext

defines in what to search.

pattern - String

is the pattern to search for. Optional.

Returns - ko.windowManager.openDialog()


findInCurrProject(pattern)

Open Find dialog to search in the current project.

Arguments

pattern - String

Returns - ko.windowManager.openDialog()


findInFiles(pattern, dirs, includes, excludes)

Open Find dialog to search in files.

Arguments

pattern - String

dirs - String

includes - Array

excludes - Array

Returns - ko.windowManager.openDialog()


httpInspector()

httpInspector open the HTTPInspector window

Returns - ko.windowManager.openOrFocusDialog()


openAddonsMgr()

openAddonsMgr open the extension/add ons manager window

Returns - ko.windowManager.openOrFocusDialog()


replace(pattern, repl)

Open the Find/Replace dialog.

Arguments

pattern - String

The pattern to search for.

repl - String

The replacement pattern.

Returns - ko.windowManager.openDialog()


replaceInCollection(collection, pattern, repl)

Open the find dialog to find & replace in a "collection" of files.

Arguments

collection - koICollectionFindContext

defines in what to search.

pattern - String

The pattern to search for.

repl - String

The replacement pattern.

Returns - ko.windowManager.openDialog()


replaceInCurrProject(pattern, repl)

Open Find dialog to find & replace in the current project.

Arguments

pattern - String

The pattern to search for.

repl - String

The replacement pattern.

Returns - ko.windowManager.openDialog()


replaceInFiles(pattern, repl, dirs, includes, excludes)

Open Find dialog to make replacements in files.

Arguments

pattern - String

repl - String

dirs - String

includes - Array

excludes - Array

Returns - ko.windowManager.openDialog()


runCommand()

runCommand open the run command dialog

Returns - window.openDialog()


rxToolkit(mode, regex, replacement, searchText, matchCase, isModal, flagMultiline)

Open the rx toolkit.

Arguments

mode - String

One of "match", "match-all", "split", "replace", "replace-all" or null for the default (match-all).

regex - String

The regular expression pattern, or null for the default (the last regex).

replacement - String

searchText - String

matchCase - Boolean

Whether to set the "I" match option.

isModal - Boolean

Whether to open the Rx dialog modally (default is false.

flagMultiline - Boolean

Whether to set the "M" match option.

Returns - args


watchLocalFile()

watchLocalFile prompt for a file to watch, then open a new watch window


ko.launch.find2_dialog_args

Variables

collection - collection


cwd - cwd


dirs - dirs


excludes - excludes


includes - includes


mode - String


pattern - pattern


repl - repl


ko.lint

Functions

clearResults()

doClick(event)
Arguments

event - Event


doRequest()

finalize()

initialize()

jumpToNextLintResult()

Classes

class lintBuffer

Constructor

lintBuffer(view)

Class variables

_lastRequestId - Number


_lintTimer - objectTimer


constructor


errorString - request.errorString


lintingEnabled - this.view.prefs.getBooleanPref()


lintResults - request.results


view - view


Class functions

_cancelDelayedRequest()

_clearResults()

_createLintRequest(linterType)

_getLinterCID()

_issueRequest()

_notify()

destructor()

observe(subject, topic, data)

QueryInterface(iid)

Returns - this


reportResults(request)

request(reason)
Arguments

reason - String



ko.logging

Variables

dumpDOM - dumpDOM


getObjectTree - getObjectTree


getStack - getStack


loggingSvc - Components.interfaces.koILoggingService


Functions

_repeatStr(str, aCount)

Returns - res


dumpEvent(event)
Arguments

event - Event


dumpObject(o, name)

dumpObjectTree(o, recurse, compress, level)

dumpView(view)

getLogger(logger_name)

Returns - this.getLoggingMgr().getLogger()


getLoggingMgr()

Returns - _gLoggingMgr


LoggingMgr()

strObject(o, name)
Arguments

name - String

Returns - s


Classes

class Logger

Constructor

Logger(logger, logger_name)

Class variables

_logger - logger


_logger_name - logger_name


constructor


Class functions

critical(message)

debug(message)

error(message)

exception(e, message)
Arguments

message - String


getEffectiveLevel()

Returns - this._logger.getEffectiveLevel()


info(message)

setLevel(level)

warn(message)


ko.logging.LoggerMap

ko.macros

Variables

current - _partSvc.runningMacro


eventHandler - MacroEventHandler


recorder - MacroRecorder


Functions

evalAsJavaScript(__code, part, __observer_arguments)

Returns - Boolean


recordPartInvocation(part)

ko.main

Variables

log - _log


Functions

addCanQuitHandler(handler, object)

addCanQuitHandler observer for watching the quit-application-requested notification, and easily handling a response to it.


addUnloadHandler(handler, object)

addUnloadHandler Register a routine to be called on Komodo shutdown. To register a simple routine do this: ko.main.addUnloadHandler(<routine>) To register an object method do this: ko.main.addUnloadHandler(this.<method>, this);


addWillQuitHandler(handler, object)

addWillQuitHandler simple observer for watching the quit-application-granted notification


ko.main.window

Functions

onunload()

tryToClose()

Returns - Boolean


ko.markers

Variables

MARKERS_MASK_SYMBOLS - Number


MARKNUM_BOOKMARK - Number


MARKNUM_BREAKPOINT_DISABLED - Number


MARKNUM_BREAKPOINT_ENABLED - Number


MARKNUM_CURRENT_LINE_BACKGROUND - Number


MARKNUM_DEBUG_CURRENT_LINE - Number


MARKNUM_INTERACTIVE_PROMPT - Number


MARKNUM_INTERACTIVE_PROMPT_MORE - Number


MARKNUM_SPAWNPOINT_DISABLED - Number


MARKNUM_SPAWNPOINT_ENABLED - Number


MARKNUM_STDERR - Number


MARKNUM_STDIN_PROMPT - Number


MARKNUM_STDOUT - Number


MARKNUM_TRANSIENTMARK - Number


Functions

getPixmap(uri, force)

Read a file from disk, cache and return the contents.

Arguments

uri - String

file uri

force - Boolean

force read from file Note: The file contents are cached by URI. This is used to load pixmaps for scintilla markers.

Returns - content_cache[uri]


setup(scimoz)

Setup the standard Komodo markers in the given SciMoz instance and return an appropriate mask for ISciMoz.setMarginMaskN(<n>, <mask>).

Arguments

scimoz - iSciMoz

scimoz plugin instsance

Returns - ko.markers.MARKERS_MASK_SYMBOLS


ko.mozhacks

Functions

pluginContextMenu()

pluginContextMenu Verified still necessary with moz 1.8 branch - SMC For some reason popups over the plugin are messed up until the first context menu over mozilla is activated. It is apparently due to popupNode not being initialized, so we do that here. See: http://www.xulplanet.com/references/elemref/ref_popup.html


ko.mru

Functions

add(prefName, entry, caseSensitive)

addFromACTextbox(widget)

addURL(prefName, url)

del(prefName, index, notify)
Arguments

notify - Boolean


finalize()

get(prefName, index)
Arguments

index - Number

Returns - retval


getAll(prefName, maxLength)
Arguments

maxLength - Math.max()

Returns - retval


initialize()

maxEntries(listPrefName)

Returns - maxEntries


reset(prefName)

ko.open

The open namespace contains functionality to open buffers in komodo

Functions

displayPath(displayPath, viewType)

Open the given path in Komodo.

Arguments