ko
Classes
class objectTimer
Constructor
objectTimer(instance, func, args)
Class variables
interval
- window.setInterval()
timeout
- window.setTimeout()
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.
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
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)
doCommandAsync(command, event)
setCommandEnabled(id, node, supported, enabled)
Arguments
node
- top.document.getElementById()
updateCommand(command, commandNode, controller)
Arguments
controller
- _getControllerForCommand()
updateCommandset(commandset)
ko.dialogs
Variables
alert
- parent.opener.ko.dialogs.alert
yesNo
- parent.opener.ko.dialogs.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)
customButtons(prompt, buttons, response, text, title, doNotAskPref, style)
editEnvVar(name, value, title, mruName, interpolateValues)
Arguments
mruName
- String
interpolateValues
- Boolean
handleEnterKey()
internalError(error, text)
okCancel(prompt, response, text, title, doNotAskPref)
pickIcon()
pickPreview(url, language, mode)
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)
yesNoCancel(prompt, response, text, title, doNotAskPref, style)
Arguments
response
- String
style
- String
ko.dragDrop
Functions
unpackData(flavourData, ret)
ko.dragDrop.dragObserver
Variables
canHandleMultipleItems
- Boolean
Functions
focusWindow()
onDragOver(event, flavour, session)
onDrop(event, transferDataSet, dragSession)
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.
openExeFile(defaultDirectory, defaultFilename, title)
Pick an executable file for open.
Arguments
defaultDirectory
- ko.uriparse.dirName()
title
- String
openFile(defaultDirectory, defaultFilename, title, defaultFilterName, filterNames)
Pick a file for open.
Arguments
defaultDirectory
- ko.uriparse.dirName()
title
- String
openFiles(defaultDirectory, defaultFilename, title, defaultFilterName, filterNames)
Pick multiple files for open.
Arguments
defaultDirectory
- ko.uriparse.dirName()
title
- String
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
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
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
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
Functions
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
getBlockOffsets(s, bracketed)
Return a list of start and end offsets of interpolation code blocks into the
given strings "s".
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
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.
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()
interpolateStrings(s, bracketed, queryTitle)
Arguments
bracketed
- Boolean
queryTitle
- String
isWordCharacter(ch)
ko.isearch
Variables
controller
- ISController
ko.keybindings
Variables
keylabel2keysequence
- keylabel2keysequence
keysequence2keylabel
- keysequence2keylabel
Functions
onload()
Classes
class manager
Constructor
Class variables
_configKeyTree
- cloneObject()
_keyPressCaptureWindow
- window
currentConfiguration
- gPrefSvc.prefs.getStringPref()
currentPrefixMap
- this.keyTree
currentPrefixString
- String
currentScheme
- this.keybindingSchemeService.getScheme()
inPrefixCapture
- Boolean
Class functions
_addRow(category, desc, keys)
Arguments
desc
- desc.replace()
_clearActiveBindings()
_configKnown(newconfigname)
_getKeyTreeRoot(keysequence)
_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)
commandId2desc(commandname, param, label)
commandId2parameter(commandname, label)
commandId2shortdesc(commandname, param)
commandId2tabledesc(commandname, param)
configurationWriteable(configname)
Returns - scheme.writeable
deleteConfiguration(configname, prefset)
evalCommand(event, commandname, keylabel)
event2keylabel(event, useShift)
Arguments
event
- Event
useShift
- Boolean
getConfigurations()
Returns - this._knownconfigs
getKey(keyname)
Arguments
keyname
- keyname.slice()
learnParameter(commandId, parameter, keylabel)
loadConfiguration(configName, forceReload)
Arguments
forceReload
- Boolean
makeCurrentKeyBindingTable()
makeDirty()
makeKeyActive(commandId, keysequence)
makeNewConfiguration(newconfigname, prefset)
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)
startPrefixCapture()
stashIn(vessel, keylabel)
switchConfiguration(newconfigname)
unsetKey(keylabel)
unsetKeyBinding(commandId)
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()
|