| Store | Cart

ActiveState Docs

Komodo 7.0 Documentation

Loading...

ko

Variables

prefs - Components.interfaces.koIPreferenceSet

Komodo global preferences object.


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

lang - String

The language name to scope the search. Optional.

abbrev - String

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

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

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.

abbrev - String

The abbreviation name.

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.koITool


insertAbbrevSnippet(snippet, view)

Insert an abbreviation snippet into a buffer.

Arguments

snippet - Components.interfaces.koITool

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

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.codebrowser

Variables

_auto_locate_scope


_filter_buffers


_mouseMoveTimer


_on_current_view_changed


_on_current_view_language_changed


_on_current_view_linecol_changed


_on_view_document_attached


_on_view_document_detaching


boxObject - this.widgets.tree.treeBoxObject


cbController - CodeBrowserController


ciController - CodeIntelController


manager - ko.codebrowser.CBManager


view - Ci.koICodeBrowserTreeView


Functions

finalize()

initialize()

locateCurrentScope()

Classes

class CBManager

Constructor

CBManager(treeId)

Class variables

_autoLocateScope - ko.prefs.getBooleanPref()


_mouseMoveTimer - ko.objectTimer


_showOnlyActiveBuffer - ko.prefs.getBooleanPref()


_validSortByKeys - Array


constructor


QueryInterface


view


Class functions

_addCurrentDocuments()

_copyToClipboard(text)

_createInstance(contractId, iidName)

Returns - iid


_getService(contractId, iidName)

Returns - iid


_handleMouseDwell(x, y)

_hideTab()

_jumpToSymbol()

_showTab()

copySelection()

finalize()

focus()

focusFilterBox()

haveFilesInWS(value)

observe(subject, topic, data)

onDblClick(event)
Arguments

event - Event


onFilterKeypress(event)
Arguments

event - Event


onMouseMove(event)
Arguments

event - Event


onMouseOut(event)
Arguments

event - Event


onSelect(event)
Arguments

event - Event


onTreeKeyPress(event)
Arguments

event - Event


sortBy(key)

Returns - Boolean


updateCommands()

updateFilter()


ko.codebrowser.widgets

Variables

autoLocateCheckbox - document.getElementById()


filterTextbox - document.getElementById()


settingsButton - document.getElementById()


showOnlyActiveBufferCheckbox - document.getElementById()


tree - document.getElementById()


ko.codeintel

Variables

$variable - String


%variable - String


@variable - String


_defns - Array


_lastRecentPrecedingCompletionAttemptPos


_lastRecentPrecedingCompletionAttemptTime


_lastRecentPrecedingCompletionAttemptTimeout - Number


_lastTriggerPos


_timeSvc - Components.interfaces.koITime


attribute - String


callTipStack - Array


class - String


completionFillups - ciBuf.cpln_fillup_chars


constant - String


directory - String


element - String


enableFillups - ko.prefs.getBooleanPref()


function - String


interface - String


isActive - Boolean


keyword - String


module - String


namespace - String


property - String


pseudo-class - String


rule - String


stopChars - ciBuf.cpln_stop_chars


value - String


variable - String


view - view


Functions

finalize()

initialize()

is_citadel_lang(lang)

Returns - _codeintelSvc.is_citadel_lang()


is_cpln_lang(lang)

Returns - _codeintelSvc.is_cpln_lang()


is_xml_lang(lang)

Returns - _codeintelSvc.is_xml_lang()


linkCurrentProjectWithBuffer(ciBuffer)

Link the current Komodo project with the provided codeintel buffer. Note: See bug 88841 for details on why this is necessary.


scan_document(koDoc, linesAdded, forcedScan)

trigger(view)

Trigger a completion (i.e. an autocomplete or calltip session) if appropriate.


Classes

class CompletionUIHandler

Constructor

CompletionUIHandler(view)

Class variables

_lastPrefix - typedAlready


_lastRecentPrecedingCompletionAttemptPos - pos


_lastRecentPrecedingCompletionAttemptTime - this._timeSvc.time()


_lastTriggerPos - triggerPos


_retriggerOnCompletion - trg.retriggerOnCompletion


_timeSvc - Components.interfaces.koITime


callTipStack - Array


constructor


enableFillups - ko.prefs.getBooleanPref()


QueryInterface


types

A mapping of autocomplete type -> image url Note that this is public and expected to be modified by extensions/scripts


view


Class functions

_getLastRecentPrecedingCompletionAttemptPos(pos)

Returns - this._lastRecentPrecedingCompletionAttemptPos


_setAutoCompleteInfo(completions, types, trg)

_setCallTipInfo(calltip, trg, explicit)
Arguments

calltip - textUtils.break_up_lines()


_setDefinitionsInfo(defns, trg)

_setLastRecentPrecedingCompletionAttemptPos(pos)

finalize()

observe(prefSet, prefName, prefSetID)

onAutoCompleteEvent(controller, event)
Arguments

event - Event


setAutoCompleteInfo(completions, types, count, trg)

setCallTipInfo(calltip, trg, explicit)

setDefinitionsInfo(count, defns, trg)

setStatusMessage(msg, highlight)

triggerPrecedingCompletion()

updateCallTip()


ko.commands

Functions

doCode(cmdId, code)

doCodeAsync(cmdId, code)

doCommand(command, options)

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 - top.document.commandDispatcher.getControllerForCommand()

Returns - found


updateCommandset(commandset)

ko.dbg

Variables

bpManager - BreakpointsTabManager


controller - DebuggerItemsController


listener - _listener


manager - DBG_Manager


Functions

bpInit()

doCommand(command, event)
Arguments

event - Event

Returns - Boolean


getDefaultInteractiveShellLanguage()

Returns - String


haveInteractiveShellExecutable(language)

Returns - languageService.getLanguageService().executablePath


is_exception_property(prop, languageName)

onload()

status()

tabInit()

tabSelect()

ko.dbg.breakpoints

Variables

manager - Components.interfaces.koIDBGPBreakpointManager


Functions

_symbolicLinkCheck(view, lineno)

Returns - Boolean


deleteAll()

Returns - Boolean


deleteAllInURI(uri)

Returns - Boolean


init()

newBreakpoint()

newSpawnpoint()

properties(bp)

toggleState(view, line)

ko.dbg.invocation

Variables

_ishellStartSafeTabIdRe


_ishellStartSafeTabIds - Array


_log - ko.logging.getLogger()


INVOKE_BUILD - Components.interfaces.koIInvocation.INVOKE_BUILD


INVOKE_DEBUG - Components.interfaces.koIInvocation.INVOKE_DEBUG


INVOKE_INTERACTIVE - Components.interfaces.koIInvocation.INVOKE_INTERACTIVE


INVOKE_PROFILE - Components.interfaces.koIInvocation.INVOKE_PROFILE


INVOKE_RUN - Components.interfaces.koIInvocation.INVOKE_RUN


log


Functions

_showInvalidInterpreterAlert(invocation, session, error_text)

doExecute(session, invoke_type, new_debugger_state)

Returns - rc


doStart(initial_step_type, invoke_type, aSession, onSuccessCallback, onErrorCallback)
Arguments

invoke_type - ko.dbg.invocation.INVOKE_DEBUG


getInteractiveInvocation(session, onSuccessCallback, onErrorCallback)

getInvocation(session, onSuccessCallback, onErrorCallback)

getStoredInvocation(prefs, scriptData)

Returns - Array


interactiveShell(language, onSuccessCallback, onErrorCallback)
Arguments

language - ko.prefs.getStringPref()


isValidInterpreter(invocation, session)

Returns - Boolean


makeDefaultInvocation(prefs, scriptData)

Returns - Array


makeInvocation(prefs, scriptData)

Returns - invocation


profileScript()

runScript()

showInvocationDialog(invocation, session, documentPrefs, projectPrefs, scriptData, alreadyValidated)
Arguments

alreadyValidated - Boolean

Returns - invocation


test()

toggleInteractiveShell()

ko.dbg.tabManager

The per-komodo-window instance of outputTabManager

ko.dbg.tabManager.getCurrentTab()

ko.dbg.tabManager.getCurrentTab().debuggerPanel

ko.dbg.tabManager.getCurrentTab().debuggerPanel.variablesTabpanels

Variables

selectedPanel


ko.dbg.tabManager.getCurrentTab().debuggerPanel.variablesTabs

Variables

selectedItem - panel.debuggerPanel.watchVariablesTab


ko.dbg.tabManager.getInteractiveShell()

ko.dbg.tabManager.getInteractiveShell().tab

ko.dbg.tabManager.getInteractiveShell().tab.parentNode

ko.dbg.tabManager.getInteractiveShell().tab.parentNode.parentNode

Variables

selectedTab - tab


ko.dialogs

Variables

alert - getKoObject().alert


yesNo - getKoObject().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

interpolateValues - Boolean

mruName - String


handleEnterKey()

internalError(error, text, exception)

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

Returns - obj.response


pickIcon()

pickPreview(url, language, mode, browserType)

Pick a HTML preview File/URL for the given file.

Arguments

url - String

Indicate the file to preview.

browserType - String

The browser type to preview with. Must be one of "default", "komodo", "firefox", "safari", "chrome", "opera", "ie". If the dialog is cancelled it returns null. Otherwise it returns an object with the following attributes: .preview The file or URL to use to preview the given URL. Note that this may be the given URL itself. .browserType When a browser choice was made, the value of that choice. .remember A boolean indicating if the current setting should be remembered so this picker need not be called again.

mode - String

One of "previewing" or "setting". The UI is slightly different depending on whether the preview file/URL is being sought to immediately _use_ it or to just set it. The default is "previewing".

language - String

The language of the current file. If this is not specified it will be automaticxally determined from the URL.

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)

renameFileWrapper(currentName)

Returns - newName


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

yesNoCancel - Boolean

selectionCondition - String


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

Returns - obj.response


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

style - String

response - String

Returns - obj.response


ko.dragdrop

Variables

genericSupportedFlavours - Array


KoDropData - KomodoDropData

Class instance to hold dropped Komodo data.


windowSupportedFlavours - this.genericSupportedFlavours.concat()


Functions

canDrop(event, session)
Arguments

event - Event

Returns - Boolean


convertKoDropData(koDropDataList)

Convert the Komodo dropped data - this may involve: o viewing the source of HTTP urls o converting mapped urls o treating dropped URLs as text

Arguments

koDropDataList - Array

- Array of KomodoDropData items.

Returns - Array


focusWindow()

isSupportedDropFlavour(flavour)

Returns - Boolean


onDragOver(event)
Arguments

event - Event

Returns - Boolean


onDrop(event)
Arguments

event - Event

Returns - Boolean


openDroppedUrls(koDropDataList)

Open all Komodo dropped files or URLs and then return the unhandled list of koDropData items.

Arguments

koDropDataList - Array

- Array of KomodoDropData items.

Returns - Array


unpackDropData(dataTransfer, acceptedFlavours)

Unpack the dropped data into a Komodo specific data structure.

Arguments

dataTransfer - Components.interfaces.nsIDOMDataTransfer

- The data.

acceptedFlavours - Array

- Optional - list of supported data types.

Returns - Array


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


browseForExeFile(defaultDirectory, defaultFilename, title)

Pick an executable file for open.

Arguments

title - String

Returns - String


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

Browse for a file.

Returns - String


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

Pick multiple files.

Arguments

defaultDirectory - ko.uriparse.dirName()

title - String

Returns - Array


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


deprecated openExeFile(defaultDirectory, defaultFilename, title)

DEPRECATED: Same as ko.filepicker.browseForExeFile.

Returns - ko.filepicker.browseForFile.apply()


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

DEPRECATED: Same as ko.filepicker.browseForFile.

Returns - ko.filepicker.browseForFile.apply()


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

DEPRECATED: Same as ko.filepicker.browseForFiles.

Returns - ko.filepicker.browseForFiles.apply()


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

title - _bundle.GetStringFromName()

defaultUrl - _lastRemoteLocation

helpTag - String

filterNames - Array

defaultFilterName - Array

defaultFilename - String

mode - Components.interfaces.nsIFilePicker.modeOpen

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

setFileStatusAttributesFromDoc(element, koDoc)

setFileStatusAttributesFromFile(element, koFile)

setFileStatusAttributesFromView(element, view)

showDiffs(fname1, fname2)
Arguments

fname2 - fname2.replace()

fname1 - fname1.replace()


ko.find

Functions

_displayFindResult(editor, findResult)

Make the view for this find result current if necessary. XXX Note that we are presuming that Komodo does not yet allow multiple views per document, which it eventually will. When this is possibly we must switch to storing unique view IDs in the find session. XXX We are currently using view.koDoc.displayPath as the view's "unique id". The view system does not currently provide a way to getViewFromDisplayPath() so we roll our own.


_doMarkerClearingReplacement(editor, scimoz, startByte, endByte, replacementText)

_doMarkerPreservingReplacement(editor, scimoz, startByte, endByte, replacementText)

_findAllInView(editor, view, context, pattern, resultsView, highlightMatches)

Find all instances of "pattern" with "replacement" in the current view context. Note: koIFindSession.StartFind() is skipped because we don't need to use this state mechanism to know when to terminate the session. Session termination is handled via .NoteUrl() and .HaveSearchedThisUrlAlready(). No return value. XXX: This internal method is required by the TODO addon.


_getNextView(editor, currView)

Return the view after this one appropriate for searching. If there is no such view (e.g. only one view), then return null. Dev Note: This in very inefficient for a lot of open files. XXX: Once all view types have viewIds we can do this more properly. I.e. don't default to 'editor' view 0 as the "next" view for any non-'editor' view. XXX: This internal method is required by the TODO addon.

Returns - searchableViews[nextIndex]


_getPreviousView(editor, currView)

Return the view before this one appropriate for searching. If there is no such view (e.g. only one view), then return null.

Returns - searchableViews[prevIndex]


_getViewFromViewId(editor, displayPath)

_isViewSearchable(view)

Returns - scimoz


_markAllInView(editor, view, context, pattern)

Mark all instances of "pattern" with "replacement" in the current view context. Note: koIFindSession.StartFind() is skipped because we don't need to use this state mechanism to know when to terminate the session. Session termination is handled via .NoteUrl() and .HaveSearchedThisUrlAlready(). Returns true if hits were found in the view, false otherwise.

Returns - foundSome


_markLinesForViewId(editor, viewId, lines)

Mark all the given find results.


_replaceAllInView(editor, view, context, pattern, replacement, firstOnLine, resultsView, highlightReplacements)

Replace all instances of "pattern" with "replacement" in the current view context. Note: koIFindSession.StartReplace() is skipped because we don't need to use this state mechanism to know when to terminate the session. Session termination is handled via .NoteUrl() and .HaveSearchedThisUrlAlready(). Returns the number of replacements made.

Returns - numReplacements


_replaceLastFindResult(editor, context, pattern, replacement)

Replace the last find result in the current find session, if there is one and if it is genuine and current. No return value.


_setupAndFindNext(editor, context, pattern, mode, check_selection_only)

Setup (i.e. do all the right things for find-session maintenance) and find the next occurrence of "pattern".

Arguments

pattern - String

the pattern to search for.

mode - String

either 'find' or 'replace'. The maintenance of a find session needs to know if a find-next operation is in the context of finding or replacing.

editor - {DOMWindow

the main Komodo window in which to work, or the view to work with

context - koIFindContext

defines the scope in which to search, e.g., in a selection, just the current doc, all open docs. (if editor is a view, context.type cannot be FCT_ALL_OPEN_DOCS)

check_selection_only - Boolean

can be set true to have only consider the current selection in the document. This is used to handle the special case of priming a find-session for "Replace" when the current selection *is* the first hit. By default this is false.

Returns - koIFindResult


_uiForCompletedFindSession(context, msgHandler)

Report the completion of a find session to the user.

Arguments

context - DOMWindow

is the koIFindContext for the find session.

msgHandler - callback

is a callback for displaying a message to the user. See ko.find.findNext documentation for details.


_uiForFindServiceError(context, exc, msgHandler)

Report an error in the find service to the user.

Arguments

exc - exception

is an optional exception, if the error was trapped via try/catch. May be null.

context - String

A short string giving context for the error, e.g. "find", "find all", "replace", ...

msgHandler - callback

is a callback for displaying a message to the user. See ko.find.findNext documentation for details. The actual error message is pulled from the koILastErrorService.


findAll(editor, context, pattern, patternAlias, msgHandler, highlightMatches)

Find all occurrences of the given pattern.

Arguments

msgHandler

pattern - String

- the pattern being sought

highlightMatches - Boolean

(optional) when set, will highlight *all* matches in the context using a scintilla indicator.

editor - window

- a reference to the komodo.xul main window

context - Components.interfaces.koIFindContext

- a koIFindContext

patternAlias - String

- shortened version of the pattern in use

Returns - Boolean


findAllInFiles(editor, context, pattern, patternAlias, msgHandler)

Find all hits in files.

Arguments

msgHandler - callback

is an optional callback for displaying a message to the user. See ko.find.findNext documentation for details.

pattern - String

the pattern to search for.

editor - DOMWindow

the main Komodo window in which to work

context - Components.interfaces.koIFindContext

patternAlias - String

a name for the pattern (for display to user)

Returns - Boolean


findAllInMacro(editor, contexttype, pattern, patternType, caseSensitivity, searchBackward, matchWord)

Called by macros -- only difference with ko.find.findAll is that contexttype is a constant, the context needs to be created, and options need to be set (and unset). XXX the APIs should be factored out so that these "inmacro" versions aren't necessary.


findNext(editor, context, pattern, mode, quiet, useMRU, msgHandler, highlightMatches, highlightTimeout)

Find (and move to) the next occurrence of the given pattern.

Arguments

msgHandler

pattern - String

- the pattern being sought

quiet - Boolean

(optional) is a boolean indicating if UI (e.g. dialogs) may be used for presenting info, e.g. wrapped the document. Interactive search typically sets this to true. Default is false.

highlightMatches - Boolean

(optional) when set, will highlight *all* matches in the context using a scintilla indicator.

highlightTimeout - Number

(optional) the maximum number of milliseconds to spend highlighting before giving up; defaults to using the user-specified preference value.

editor - {window

- a reference to the komodo.xul main window, or a scintilla view in which to search

context - Components.interfaces.koIFindContext

- a koIFindContext

useMRU - Boolean

(optional) is a boolean indicating if the pattern should be loaded into the find MRU. Default is true.

mode - String

(optional) is either "find" (the default) or "replace", indicating if this is in the context of a replace UI.

Returns - Boolean


findNextInMacro(editor, contexttype, pattern, patternType, caseSensitivity, searchBackward, matchWord, mode, quiet, useMRU)

Called by macros -- only difference with ko.find.findNext is that contexttype is a constant, and the context needs to be created. XXX the APIs should be factored out so that these "inmacro" versions aren't necessary.


getStatusbarMsgHandler(editor)

Return a callback appropriate for the 'msgHandler' callbacks that will put a message on the status bar.


highlightAllMatches(scimoz, context, pattern, timeout)

Highlight all additional find matches.

Arguments

timeout - Number

- [optional] number of milliseconds before timing out

context - Components.interfaces.koIFindContext

- a koIFindContext instance

pattern - String

- the pattern being sought

Returns - Boolean


highlightClearAll(scimoz)

Clear all of the current find and replace highlights.

Arguments

scimoz - Components.interfaces.ISciMoz

- The scimoz instance.


highlightClearPosition(scimoz, position, length)

Clear any find highlights in the edited region.

Arguments

scimoz - Components.interfaces.ISciMoz

- Scintilla instance.

length - Number

- The number of affected bytes at this position.

position - Number

- The scimoz position (byte position)


highlightingEnabled()

Check to see if find highlighting is enabled.

Returns - Boolean


markAll(editor, context, pattern, patternAlias, msgHandler)

Bookmark all occurrences of the given pattern.

Arguments

msgHandler

pattern - String

- the pattern being sought

editor - window

- a reference to the komodo.xul main window

context - Components.interfaces.koIFindContext

- a koIFindContext

patternAlias - String

a name for the pattern (for display to user)

Returns - Boolean


markAllInMacro(editor, contexttype, pattern, patternType, caseSensitivity, searchBackward, matchWord)

Called by macros -- only difference with ko.find.markAll is that contexttype is a constant, and the context needs to be created. XXX the APIs should be factored out so that these "inmacro" versions aren't necessary.


regexEscapeString(original)

Returns - original.replace()


replace(editor, context, pattern, replacement, msgHandler)

Replace one occurrence of the given pattern.

Arguments

msgHandler

pattern - String

- the pattern being sought

editor - window

- a reference to the komodo.xul main window

context - Components.interfaces.koIFindContext

- a koIFindContext

replacement - String

- the pattern to replace with

Returns - Boolean


replaceAll(editor, context, pattern, replacement, showReplaceResults, firstOnLine, msgHandler, highlightReplacements)

Replace all occurrences of the given pattern.

Arguments

msgHandler

pattern - String

- the pattern being sought

editor - window

- a reference to the komodo.xul main window

showReplaceResults - Boolean

- whether to show the results tab

highlightReplacements - Boolean

To highlight the replacements made.

firstOnLine - Boolean

A boolean indicating, if true, that only the first hit on a line should be replaced. Default is false. (This is to support Vi's replace with the 'g' flag.)

context - Components.interfaces.koIFindContext

- a koIFindContext

replacement - String

- the pattern to replace with

Returns - Boolean


replaceAllInFiles(editor, context, pattern, repl, confirm, msgHandler)

Replace all hits in files.

Arguments

msgHandler - callback

is an optional callback for displaying a message to the user. See ko.find.findNext documentation for details.

pattern - String

the pattern to search for.

confirm - Boolean

Whether to confirm replacements. Optional, true by default.

repl - String

the replacement string.

editor - DOMWindow

the main Komodo window in which to work

context - Components.interfaces.koIFindContext

defines the scope in which to search, e.g., in a selection, just the current doc, all open docs.

Returns - Boolean


replaceAllInMacro(editor, contexttype, pattern, replacement, quiet, patternType, caseSensitivity, searchBackward, matchWord)

Called by macros -- only difference with ko.find.replace is that contexttype is a constant, and the context needs to be created. XXX the APIs should be factored out so that these "inmacro" versions aren't necessary. FCT_CURRENT_DOC = 0, FCT_SELECTION, FCT_ALL_OPEN_DOCS, FCT_IN_FILES, FCT_IN_COLLECTION FOT_SIMPLE = 0, FOT_WILDCARD, FOT_REGEX_PYTHON FOC_INSENSITIVE = 0, FOC_SENSITIVE, FOC_SMART

Arguments

matchWord - Boolean

patternType - Number

- one of the following koIFindOptions values:

pattern - String

quiet - Boolean

contexttype - Number

-- one of the following koIFindContext values:

editor - Object

-- global window object

searchBackward - Boolean

caseSensitivity - Number

- one of the following koIFindOptions values:

replacement - String


replaceInMacro(editor, contexttype, pattern, replacement, patternType, caseSensitivity, searchBackward, matchWord)

Called by macros -- only difference with ko.find.replace is that contexttype is a constant, and the context needs to be created. XXX the APIs should be factored out so that these "inmacro" versions aren't necessary.


ko.find.controller

Variables

FindController - FindController


ko.findresults

Variables

managers - manager


Functions

create(id)

Returns - manager


getManager(id)

Returns - this.managers[id]


getTab(preferredId)
Arguments

preferredId - Number


nextResult()

Classes

class FindResultsTabManager

Constructor

FindResultsTabManager()

Class variables

_idprefix - String


_journalId - journalId


_opSupportsUndo - opSupportsUndo


_options - options


_pattern - pattern


_patternAlias - patternAlias


_repl - repl


_searchInProgress - Boolean


constructor


context_ - context


doc - browser.contentDocument


id - id


is_locked - Boolean


view - Components.interfaces.koIFindResultsView


Class functions

_columnClick(columnID)

_doubleClick()

_getBaseDescription(tense)

Returns - baseDesc


_updateSortIndicators(sortId)

addReplaceResult(type, url, startIndex, endIndex, value, replacement, fileName, lineNum, columnNum, context)

clear()

configure(pattern, patternAlias, repl, context, options, opSupportsUndo)

Configure the find results tab with information about the find/replace operation.

Arguments

pattern - String

the pattern searched for

opSupportsUndo - Boolean

Indicates in this find/replace operation supports undo. Optional, default false.

repl - String

the replacement pattern. Null if this is just a find operation.

context - Components.interfaces.koIFindContext

The search context for this op. (Dev Note: this is reference to a context that can change, so this isn't reliable for 'redo' operations)

options - Components.interfaces.koIFindOptions

Holds the find options. (Dev Note: this is reference to a context that can change, so this isn't reliable for 'redo' operations)

patternAlias - String

A more user-friendly name for the pattern. Optional, null if no alias.


initialize(id)

isBusy()

Returns - this._searchInProgress


jumpToNextResult()

jumpToPrevResult()

onClick(event)
Arguments

event - Event


onKeyPress(event)
Arguments

event - Event

Returns - Boolean


QueryInterface(iid)

Returns - this


searchFinished(success, numResults, numFiles, numFilesSearched, journalId)

Called to indicated that the search operation has completed.

Arguments

success - Boolean

Indicates if the find/replace was successful.

journalId - String

The identifier for the journal for a "Replace All in Files" operation. This is used to support undo. Null if not applicable.

numResults - Number

The number of find/replace hits. Optional, typically only provided for a successful completion.

numFilesSearched - Number

The number of paths searched. Optional, typically only provided for a successful completion.

numFiles - Number

The number of paths in which there were hits. Optional, typically only provided for a successful completion.


searchStarted()

setDescription(subDesc, important)
Arguments

important - Boolean


show(focus)
Arguments

focus - Boolean


stopSearch()

toggleLockResults()

undoReplace()

updateFilter()


ko.findtoolbar

Functions

addBrowsedDirectory()

findFilesKeyPress(field, event)
Arguments

event - Event


findFilesOnFocus(field, event)
Arguments

event - Event


findTextboxKeyPress(field, event)
Arguments

event - Event


gotoFindTextbox()

gotoOpenTextbox()

initialize()

openTextboxKeyPress(field, event)
Arguments

event - Event


ko.formatters

Functions

formatSubLanguageBlock(view)

Format the sub-language at the current cursor position of the view.

Arguments

view - Components.interfaces.koIScintillaView

(Optional) The view to format. Defaults to the currentview.


formatView(view, format_type)

*********************************************************** Exposed ko.formatters.XYZ functions * Format this view. If there is a selection in this view or the formatSelection argument is true, then the formatter will work upon the view's selection, else the formatter works on the complete document. The targetted text will be replaced if the formatting is successful.

Arguments

view - Components.interfaces.koIScintillaView

(Optional) The view to format. Defaults to the currentview.

format_type - Number

(Optional) the type of formatting context to use, one of (FORMAT_SELECTION, FORMAT_BLOCK, FORMAT_TEXT, ...)


formatViewUsingConfig(view, config, format_type, pos_start, pos_end)

Format the given view (defaults to the current view when not supplied) with the formatter configuration provided. If there is a selection in this view then the formatter will work upon the view's selection, else the formatter works on the complete document. The targetted text will be replaced if the formatting is successful.

Arguments

pos_end - Number

(Optional) The position to end the formatting.

view - Components.interfaces.koIScintillaView

The view to format. Defaults to the current view if null.

config - Components.interfaces.koIPreferenceSet

The formatter configuration prefset to use for formatting.

pos_start - Number

(Optional) The position to start the formatting.

format_type - String

Must be one of ["document", "sublang", "selection"]


formatViewUsingConfigName(view, configName)

Format the given view (defaults to the currentView when not supplied) with the formatter configuration that has the supplied config name. If there is a selection in this view then the formatter will work upon the view's selection, else the formatter works on the complete document. The targetted text will be replaced if the formatting is successful.

Arguments

configName - String

The name of the formatter configuration to use for formatting.

view - Components.interfaces.koIScintillaView

The view to format. Defaults to the current view if null.


formatViewUsingConfigUuid(uuid, format_type, pos_start, pos_end)

Format the current view with the formatter configuration that has the provided UUID. This is required for the formatter menu(item)'s.

Arguments

pos_end - Number

(Optional) The position to end the formatting.

uuid - String

The unique identifier of the configuration prefset.

format_type - String

Must be one of ["document", "sublang", "selection"]

pos_start - Number

(Optional) The position to start the formatting.


getAllFormatterConfigurationsForPrefset(prefset)

Return a list of all formatter configuration preferences.

Returns - Array


getFormatterConfigurationsForLangAndPrefset(lang, prefset)

Return a list of formatter configuration preferences that are setup for the given language.

Returns - Array


getFormatterConfigurationsForView(view)

Return a list of formatter configuration preferences that are setup for the current view's language and prefset.

Arguments

view - ko.views.manager.currentView

Returns - Array


highlightRegion(pos_start, pos_end)

Highlight this formatting region in the current view.

Arguments

pos_end - Number

- The scimoz end position.

pos_start - Number

- The scimoz starting position.


loadFormatterMenusForCurrentView(menupopup, event)

Populate the provided menupopup element with the available formatters for the current view.

Arguments

event - Event


unhighlightRegion()

Remove the formatter highlighting from the current view.


ko.help

Functions

alternate()

Launches the alternate help command.


language(searchTerm)

Opens language specific help for the current buffer.

Arguments

searchTerm - String

Open language help for this search term.


memoryUsage()

Open the Komodo memory usage report.


open(page)

Open the Komodo help window.

Arguments

page - String

A page tag as defined in toc.xml


tutorialProject(tutorial)

Used by the help system to open KPF files associated with a tutorial.

Arguments

tutorial - String

The name of tutorial to open.


tutorials(tutorial)

Open the Tutorial in the help browser.

Arguments

tutorial - String

The name of tutorial to open. Can optionally be used to specify a particular tutorial to start with. Valid names are "perl", "python", "php", "xslt", and null (to go to Tutorial home page).


viewErrorLog()

Open the Komodo error log for viewing.


ko.history

Variables

_recently_did_history - Boolean


Functions

_go_to_location(loc, on_load_failure)

_handle_closing_view(event)
Arguments

event - Event


_history_move(go_method_name, check_method_name, delta, explicit)

Common function for moving forward or back

Arguments

go_method_name - String

either 'go_back' or 'go_forward', used to make this routine work for both directins.

explicit - Boolean

if true, the user pressed the "Recent Locations" button. Otherwise they hit the go_back or go_forward command.

delta - Number

# of hops to make

check_method_name - String

either 'can_go_back' or 'can_go_forward', Same rationale as go_method_name


curr_session_name()

Returns - _curr_session_name


destroy()

history_back(delta, explicit)

history_forward(delta, explicit)

init_popup_menu_recent_locations(event)
Arguments

event - Event


move_to_loc_before_last_jump(view, moveToFirstVisibleChar)

note_curr_loc(view, check_section_change)

Note the current location.

Arguments

check_section_change - Boolean

view - view

An optional view in which to get the current location. If not given the current view is used.

Returns - koILocation


note_loc_unless_history_move(view)

Note the current location from functions like view.history.setMostRecentView

Arguments

view - view

An optional view in which to get the current location. If not given the current view is used.

Returns - koILocation


observe(subject, topic, data)

open_rctab(idx)

rctabs_build_menu(menupopup)

restore_prefs(prefs)

save_prefs(prefs)

tabIndex_for_view(view)

Returns - Number


ko.hyperlinks

Variables

args - args


enabled - prefs.getBooleanPref()


enabledPrefName - String


endPos - endPos


func - jump_fn


handler - handler


indic_color - indic_color


indic_style - indic_style


lang_names - lang_names


name - name


startPos - startPos


Functions

addHandler(handler)

Add a handler to the list of known hyperlink handlers.

Arguments

handler - ko.hyperlinks.BaseHandler

- The handler to add.


getAllHandlers()

Return a copy of the available hyperlink handlers.

Returns - Array


getHandlersForLang(lang_name)

Get the available hyperlink handlers for the given language name, or all hyperlink handlers when lang is not set.

Returns - Array


getHandlerWithName(name)

Return the handler with this name from the list of known hyperlink handlers.

Arguments

name - String

- The handler name to find.

Returns - ko.hyperlinks.BaseHandler


removeHandler(handler)

Remove this handler from the list of known hyperlink handlers.

Arguments

handler - ko.hyperlinks.BaseHandler

- The handler to remove.


show(view, position, reason)

Show any available hyperlink at the position in the view.

Arguments

reason - String

What the triggering event reason was, can be one of "keypress" or "mousemove".

position - Number

Position in the scimoz editor.

view - Components.interfaces.koIScintillaView

View to check.

Returns - ko.hyperlinks.BaseHandler


Classes

class BaseHandler

The base hyperlink handler class. Handlers are responsible for checking to see if an editor position is a hyperlink and then highlighting the hyperlink within the editor.

Constructor

BaseHandler(name, jump_fn, lang_names, indic_style, indic_color)
Arguments

indic_color - Number

Optional - Indicator color (BGR), i.e. 0xFFCC33

lang_names - {array

Optional - If set, the handler will only show hyperlinks when the editor language is one of these language names.

jump_fn - Function

Will be called when the user clicks on the jump point. The matching (or replaced) hyperlink value is the only argument passed to this function.

name - String

A unique name of the hyperlink handler.

indic_style - Number

Optional - Indicator style, see scimoz.INDIC_*


Class functions

dwell(view, hyperlink)

Called when the mouse dwells on this hyperlink.

Arguments

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.


jump(view, hyperlink)

Activate this hyperlink instance.

Arguments

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.


remove(view, hyperlink, reason)

Remove this hyperlink instance.

Arguments

reason - String

What the triggering event reason was, can be one of "keyup", "mousemove", "mouseup" or "blur".

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.

Returns - Boolean


setHyperlink(view, startPos, endPos, args)

Set a hyperlink at this position.

Arguments

startPos - Number

Scimoz position for the start of the hyperlink.

args - Array

Optional - Array of args to pass to the function.

endPos - Number

Scimoz position for the end of the hyperlink.

view - Components.interfaces.koIScintillaView

View to mark.

Returns - ko.hyperlinks.Hyperlink


show(view, scimoz, position, line, lineStartPos, lineEndPos, reason)

Try and show a hyperlink at the current position in the view.

Arguments

scimoz - Components.interfaces.ISciMoz

Scimoz for the view.

reason - String

What the triggering event reason was, can be one of "keypress" or "mousemove".

lineStartPos - Number

Scimoz position for the start of the line.

lineEndPos - Number

Scimoz position for the end of the line.

position - Number

Position in the scimoz editor.

line - String

The current line from the editor.

view - Components.interfaces.koIScintillaView

View to check.

Returns - Boolean



class ColorPickerHandler

Constructor

ColorPickerHandler()

Class variables

named_css_colors - Array


Class functions

_rgbToComponents(rgb_color)

Convert a CSS rgb() color string to an array of [r, g, b, a]

Arguments

rgb_color - String

The rgb() / rgba() string

Returns - Array


colorToHex(color)

Convert a CSS color specification to hexidecimal representation

Arguments

color - String

Any CSS color value

Returns - String


colorToRGB(color)

Convert a CSS color specification to rgb() representation

Arguments

color - String

Any CSS color value

Returns - String


jump(view, hyperlink)

Activate this hyperlink instance.

Arguments

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.


remove(view, hyperlink, reason)

Remove this hyperlink instance.

Arguments

reason - String

What the triggering event reason was, can be one of "keyup", "mousemove", "mouseup" or "blur".

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.

Returns - Boolean


rgb2hex(rgb_color)

Convert a CSS rgb() color string to hex "#nnnnnn"

Arguments

rgb_color - String

The rgb() string

Returns - String


show(view, scimoz, position, line, lineStartPos, lineEndPos, reason)

Try and show a hyperlink at the current position in the view.

Arguments

scimoz - Components.interfaces.ISciMoz

Scimoz for the view.

reason - String

What the triggering event reason was, can be one of "keypress" or "mousemove".

lineStartPos - Number

Scimoz position for the start of the line.

lineEndPos - Number

Scimoz position for the end of the line.

line - String

The current line from the editor.

view - Components.interfaces.koIScintillaView

View to check.

Returns - ko.hyperlinks.Hyperlink


showColorPicker(view, hyperlink)


class GotoDefinitionHandler

A goto defintion hyperlink handler.

Constructor

GotoDefinitionHandler()

Class variables

constructor


enabled - prefSet.getBooleanPref()


Class functions

destroy()

dwell(view, hyperlink)

Called when the mouse dwells on this hyperlink.

Arguments

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.


observe(prefSet, prefName, prefSetID)

remove(view, hyperlink, reason)

Remove this hyperlink instance.

Arguments

reason - String

What the triggering event reason was, can be one of "keyup", "mousemove", "mouseup" or "blur".

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.

Returns - Boolean


show(view, scimoz, position, line, lineStartPos, lineEndPos, reason)

Try and show a hyperlink at the current position in the view.

Arguments

scimoz - Components.interfaces.ISciMoz

Scimoz for the view.

reason - String

What the triggering event reason was, can be one of "keypress" or "mousemove".

lineStartPos - Number

Scimoz position for the start of the line.

lineEndPos - Number

Scimoz position for the end of the line.

line - String

The current line from the editor.

view - Components.interfaces.koIScintillaView

View to check.

Returns - ko.hyperlinks.Hyperlink



class Hyperlink

A hyperlink instance created by a handler and set on the view.

Constructor

Hyperlink(handler, startPos, endPos, args)
Arguments

startPos - Number

Scimoz position for the start of the hyperlink.

handler - ko.hyperlinks.BaseHandler

- Handler that made it.

endPos - Number

Scimoz position for the end of the hyperlink.

args - Array

Optional - Array of args to pass to the function.


Class functions

dwell(view)

Called when the mouse dwells on this hyperlink.

Arguments

view - Components.interfaces.koIScintillaView

The view instance.


jump(view)

Activate this hyperlink.

Arguments

view - Components.interfaces.koIScintillaView

The view instance.


remove(view, reason)

Remove this hyperlink.

Arguments

reason - String

What the triggering event reason was, can be one of "keyup", "mousemove", "mouseup" or "blur".

view - Components.interfaces.koIScintillaView

The view instance.

Returns - Boolean



class ImagePreviewHandler

Constructor

ImagePreviewHandler(name, regex, fn, replace_str, lang_names, indic_style, indic_color)

Class functions

dwell(view, hyperlink)

Called when the mouse dwells on this hyperlink.

Arguments

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.


remove(view, hyperlink, reason)

Remove this hyperlink instance.

Arguments

reason - String

What the triggering event reason was, can be one of "keyup", "mousemove", "mouseup" or "blur".

hyperlink - ko.hyperlinks.Hyperlink

The hyperlink instance.

view - Components.interfaces.koIScintillaView

The view instance.

Returns - Boolean



class RegexHandler

Constructor

RegexHandler(name, findRegex, fn, replace_str, lang_names, indic_style, indic_color)
Arguments

replace_str - {string

Optional - If set, will be used to change the matching text into a different value, similar to str.replace(findRegex, replace_str), so you can use the JavaScript regular expression positions: $1, $2, etc... in the string.

name - String

A unique name of the hyperlink handler.

lang_names - {array

Optional - If set, the handler will only show hyperlinks when the editor language is one of these language names.

indic_color - Number

Optional - Indicator color (BGR), i.e. 0xFFCC33

fn - Function

Will be called when the user clicks on the jump point. The matching (or replaced) hyperlink value is the only argument passed to this function.

findRegex - RegExp

Regular expression used to find the hyperlink.

indic_style - Number

Optional - Indicator style, see scimoz.INDIC_*


Class variables

findRegex - findRegex


limit_to_styles - styleNumbers


regex_match - match


replace_str - replace_str


Class functions

limitToTheseStyles(styleNumbers)

When checking for a hgyperlink match, the style at the cursor position must match one one of these values.

Arguments

styleNumbers - Array

- List of style numbers.


show(view, scimoz, position, line, lineStartPos, lineEndPos, reason)

Try and show a hyperlink at the current position in the view.

Arguments

scimoz - Components.interfaces.ISciMoz

Scimoz for the view.

reason - String

What the triggering event reason was, can be one of "keypress" or "mousemove".

lineStartPos - Number

Scimoz position for the start of the line.

lineEndPos - Number

Scimoz position for the end of the line.

position - Number

Position in the scimoz editor.

line - String

The current line from the editor.

view - Components.interfaces.koIScintillaView

View to check.

Returns - ko.hyperlinks.Hyperlink



ko.hyperlinks.handlers

Variables

activestateBugHandler - ko.hyperlinks.RegexHandler


chromePreviewHandler - ko.hyperlinks.ImagePreviewHandler


colorPreviewHandler - ko.hyperlinks.ColorPickerHandler


djangoExtendsHandler - ko.hyperlinks.RegexHandler


djangoRenderViewHandler - ko.hyperlinks.RegexHandler


fileHandler - ko.hyperlinks.RegexHandler

A generic file handler - to help in opening files. Examples: file:///foo/bar.txt /foo/bar.txt C:\foo\bar.txt \\foo\bar.txt


gotoDefinitionHandler - ko.hyperlinks.GotoDefinitionHandler


imagePreviewHandler - ko.hyperlinks.ImagePreviewHandler


ipAddressHandler - ko.hyperlinks.RegexHandler


jsGetElementByIdHandler - ko.hyperlinks.RegexHandler


networkURIHandler - ko.hyperlinks.RegexHandler


phpIncludeHandler - ko.hyperlinks.RegexHandler


srcHrefHandler - ko.hyperlinks.RegexHandler


ko.inputBuffer

Variables

id - String


Functions

finish()

Returns - contents


focus(event)
Arguments

event - Event


start()

ko.interpolate

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


interpolateString(s, bracketed, queryTitle)

Interpolate '%'-escape codes in the given string.

Arguments

bracketed - Boolean

(optional) Whether "s" uses the bracketed interpolate format

queryTitle - String

(optional) Title for any query dialogs raised during interpolation.

s - String

The string to interpolate.

Returns - String


deprecated interpolateStrings(s, bracketed, queryTitle)

DEPRECATED: [DEPRECATED] Interpolate the given string.

Returns - ko.interpolate.interpolateString()


isWordCharacter(ch)

ko.interpolate.getViewData

Variables

selection - this._stripLeadingWS()


ko.isearch

ko.keybindings

Variables

_knownconfigs - Array


commanditems


currentConfiguration - this.prefset.getStringPref()


currentPrefixString - String


currentScheme - this.keybindingSchemeService.getScheme()


document - document


inPrefixCapture - Boolean


keybindingSchemeService


keyDownLabels


keylabel2keysequence - keylabel2keysequence


keysequence2keylabel - keysequence2keylabel


prefset - ko.prefs


Functions

onload()

removeListener()

Classes

class Manager

Constructor

Manager()

Class variables

_configDirty - Boolean


_configKeyTree - cloneObject()


_configUnsaved - Boolean


_keyPressCaptureWindow - window


_knownconfigs - schemes.value


activeCommands - cloneObject()


command2key - Object


commanditems - Array


commandnames - Array


constructor


currentConfiguration - configName


currentPrefixMap - this.keyTree


currentPrefixString - String


currentScheme - scheme


inPrefixCapture - Boolean


key2command - Object


keyDownLabels


keynames - Array


keyTree - Object


lastcategory - String


prefset - prefset


rownum - Number


Class functions

_addRow(category, desc, keys)
Arguments

desc - desc.replace()

Returns - String


_clearActiveBindings()

_configKnown(newconfigname)

Returns - Boolean


_getKeyTreeRoot(keysequence)

Returns - root


_getPartFromId(param)

Returns - part


_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, isKeyPressEvent)
Arguments

isKeyPressEvent - Boolean

useShift - Boolean

event - Event

Returns - data.join()


eventBindings(event, isKeyPressEvent)
Arguments

isKeyPressEvent - Boolean

event - Event

Returns - possible


finalize(part, topic, partId)

getConfigurations()

Returns - this._knownconfigs


getKey(keyname)
Arguments

keyname - keyname.slice()


keypressHandler(event, ignorePhase)
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


manageKeyboardShortcut(part, topic, partId)

mergeSchemeConfiguration(configName, forceReload)
Arguments

forceReload - Boolean


observe(part, topic, partId)
Arguments

topic - topic.indexOf()


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.keybindings._commandParams

ko.keybindings.activeCommands

ko.keybindings.command2key

ko.keybindings.key2command

ko.keybindings.keyTree

ko.keybindings.manager

Variables

evalCommand - this._evalCommand


keyDownLabels - ko.keybindings.manager.eventBindings()


vimController - gVimController


Functions

evalCommand(event, commandname, keylabel)
Arguments

event - Event

Returns - Boolean


ko.launch

Functions

about()

Show Komodo's about dialog.


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

message - String

title - 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

pattern - String

is the pattern to search for. Optional.

collection - koICollectionFindContext

defines in what to search.

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

dirs - String

excludes - Array

pattern - String

includes - Array

Returns - ko.windowManager.openDialog()


httpInspector()

httpInspector open the HTTPInspector window

Returns - ko.windowManager.openOrFocusDialog()


newTemplate(obj)

newWindow(uri)

Returns - ko.windowManager.openDialog()


newWindowForIndex(workspaceIndex)

newWindowFromWorkspace(workspaceIndex)

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

pattern - String

The pattern to search for.

repl - String

The replacement pattern.

collection - koICollectionFindContext

defines in what to search.

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

dirs - String

excludes - Array

pattern - String

includes - Array

repl - String

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

regex - String

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

searchText - String

flagMultiline - Boolean

Whether to set the "M" match option.

matchCase - Boolean

Whether to set the "I" match option.

mode - String

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

isModal - Boolean

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

replacement - String

Returns - If


watchLocalFile()

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


ko.lint

Variables

_lastRequestId - Number


_lintSvc - Components.interfaces.koILintService


_lintTimer


errorString


languageInfo - languageInfo


languageSetup - languageSetup


lintingEnabled - this.view.koDoc.getEffectivePrefs().getBooleanPref()


lintResults


pendingRequest - Boolean


view - view


Functions

addLintPreference(preferenceName, subLanguageNameList)

clearResults()

doClick(event)
Arguments

event - Event


doRequest()

initializeGenericPrefs(prefset)

jumpToNextLintResult()

updateDocLintPreferences(prefset, preferenceName)

Classes

class lintBuffer

Constructor

lintBuffer(view)

Class variables

_lintTimer - ko.objectTimer


constructor


errorString - request.errorString


lintingEnabled - lintingEnabled


lintResults - request.results


pendingRequest - Boolean


view


Class functions

_cancelDelayedRequest()

_clearResults()

_colouriseIfNecessary(view)

_createLintRequest(linterType)

_getLinterLanguageName()

Returns - _linterLanguageNames[languageName]


_issueRequest()

_notify()

canLintLanguage()

destructor()

observe(subject, topic, data)

processPendingRequests()

QueryInterface(iid)

Returns - this


reportResults(request)

request(reason)
Arguments

reason - String


usingSubLanguage(subLanguageList)

Returns - subLanguageList.map().filter().length



ko.lint.displayer

Variables

_in_display - Number


_segmenting_updates - Boolean


Functions

_compareIndicators(a, b)

Returns - a[0]


_display(lintBuffer, lintResults)

_uniquify(a)

Returns - newArray


cancelPendingItems(lintBuffer)

continueDisplay(lintBuffer, lintResults)

display(lintBuffer, lintResults)

Returns - res


displayClear(scimoz)

doConstrainedUpdate(scimoz, lintResults, lintBuffer)

updateDisplayedIndicators(scimoz, startPos, docLen, lintResults, displayableResults)

ko.logging

Variables

_logger - logger


_logger_name - logger_name


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)

dumpStack()

dumpView(view)

getLogger(logger_name)

Returns - this.getLoggingMgr().getLogger()


getLoggingMgr()

Returns - _gLoggingMgr


globalDeprecatedByAlternative(deprecatedName, replacementName, logger)

Mark global var/function as being deprecated with an alternative. All calls to the item will be logged with a one-off warning.

Arguments

deprecatedName - String

The global variable name that is deprecated

replacementName - String

The new replacement code (an expression to eval)

logger - Logger

The logger to use (from ko.logging.getLogger), or null to use the default


LoggingMgr()

propertyDeprecatedByAlternative(object, deprecatedName, replacementName, logger)

Mark object property as being deprecated with an alternative. All gets to the item will be logged with a one-off warning.

Arguments

deprecatedName - String

The global variable name that is deprecated

replacementName - String

An expression to get the replacement; |this| is the object

object - Object

The object on which the deprecated property exists

logger - Logger

The logger to use (from ko.logging.getLogger), or null to use the default


strObject(o, name)
Arguments

name - String

Returns - s


Classes

class Logger

Constructor

Logger(logger, logger_name)

Class variables

constructor


Class functions

critical(message)

debug(message)

deprecated(message, reportDuplicates)

Log a deprecation warning message. This will also log the stack trace to show where the deprecated code was being called from. Note: This is not a core Python logging function, it's just used from JavaScript code to warn about Komodo JavaScript API deprecations.

Arguments

reportDuplicates - Boolean

Optional, when set to false it only logs the first occurance of the deprecation message.

message - String

The deprecation warning 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


CURRENT_MACRO_VERSION - Number


eventHandler - MacroEventHandler


recorder - MacroRecorder


Functions

evalAsJavaScript(__code, part, __observer_arguments, view)
Arguments

view - ko.views.manager.currentView

Returns - Boolean


recordPartInvocation(part)

ko.main

Variables

__koNum - val


windowIsClosing - Boolean

Is this window being closed?


Functions

__deprecatedNameTest(deprecatedName, supportedName)

_onClose(event)

Window "close" event handler to close the Komodo window and, if it is the last one, quit. This is called when the application's "x" close button is pressed. It is NOT called when quitting Komodo via "File -> Exit", "Cmd+Q", or equivalent.

Arguments

event - Event


_onDOMWindowClose(event)

Window "DOMWindowClose" event sent when the window is about to be closed by `window.close()`. For Komodo shutdown this is called when a window is closed via toolkit's `goQuitApplication()`, but NOT when closed via the application window's "x" close button. However, this method will be called in procedures that cause Komodo to shut down, such as during updates. It's too late to check if we can quit, but we should still save the workspace and run the willCloseHandlers. See bug 67126 for more details. http://developer.mozilla.org/en/docs/Gecko-Specific_DOM_Events#DOMWindowClose http://mxr.mozilla.org/mozilla1.8/source/dom/src/base/nsGlobalWindow.cpp#4737 ... DispatchCustomEvent("DOMWindowClose") ...

Arguments

event - Event


addCanCloseHandler(handler, object)

addWillCloseHandler(handler, object)

Register a routine to be called when a Komodo window is closed. To register a simple routine do this: ko.main.addWillCloseHandler(<routine>) To register an object method do this: ko.main.addWillCloseHandler(this.<method>, this); *XXX Do we want to add an optional argument list to pass in?


quitApplication()

removeWillCloseHandler(handler)

Remove the given handler from the list of do-close handlers.


runCanCloseHandlers()

Returns - Boolean


runWillCloseHandlers()

ko.markers

Variables

markerNum - ko.markers.MARKNUM_INTERACTIVE_PROMPT_MORE


MARKERS_MASK_SYMBOLS


MARKNUM_BOOKMARK - Number


MARKNUM_BREAKPOINT_DISABLED - Number


MARKNUM_BREAKPOINT_ENABLED - Number


MARKNUM_CURRENT_LINE_BACKGROUND - Number


MARKNUM_DEBUG_CURRENT_LINE - Number


MARKNUM_HISTORYLOC - 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


MAX_MARKNUM - Number


Functions

getPixmap(uri, force)

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

Arguments

force - Boolean

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

uri - String

file uri

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 - Components.interfaces.ISciMoz

- A plugin instance.

Returns - ko.markers.MARKERS_MASK_SYMBOLS


ko.moreKomodo

Variables

moreKomodo - moreKomodo


MoreKomodoCommon - MoreKomodoCommon


ko.mozhacks

ko.mru

Functions

add(prefName, entry, caseSensitive)

addFromACTextbox(widget)

addURL(prefName, url)

del(prefName, index, notify)
Arguments

notify - Boolean


deleteValue(prefName, prefValue, notify)
Arguments

notify - Boolean


finalize()

get(prefName, index)
Arguments

index - Number

Returns - retval


getAll(prefName, maxLength)
Arguments

maxLength - Math.max()

Returns - retval


initialize()

manageMRUList(prefName)

maxEntries(listPrefName)

Returns - maxEntries


remove(prefName, entry, caseSensitive)

Remove the given "entry" (a string) from the given MRU if it exists.

Arguments

caseSensitive - Boolean

How to match the entry.

prefName - String

The mru preference with which it is associated.

entry - String

The entry to remove from the mru.


removeURL(prefName, url)

Remove the given URL from the mru preference (if it exists).

Arguments

url - String

The URL to remove from the mru.

prefName - String

The mru preference with which it is associated.


reset(prefName)

ko.mru._prettyPrefNamePlural_From_PrefName

Variables

__XXZZ__


mruFileList - String


mruProjectList - String


mruTemplateList - String


ko.open

The open namespace contains functionality to open buffers in komodo

Variables

_audioUrlREs - Array


_imageUrlREs - Array


accessKey - _viewsBundle.GetStringFromName()


label - _viewsBundle.GetStringFromName()


preNotificationSessionSchemeName - oldSchemeName


Functions

_installAddon(uri)

_notifyHowtoRestoreOldScheme(schemeService, oldSchemeName, newSchemeName)

Display a notification box that lets the user revert the current color scheme from the one that was just imported to the previous one.

Arguments

oldSchemeName - String

schemeService - nsIScintillaSchemeService

newSchemeName - String

Returns - undefined


displayPath(displayPath, viewType, callback)

Open the given path in Komodo. If you need the view for the file that is opened from this call, pass in a callback function argument and then this function will be called after the view is opened (or re-focused if it was already open).

Arguments

callback - Function

optional, to be called when the asynchronous load is complete. This will only be called if this opens or switches to an editor view, e.g. this won't be called for a kpf file. The view will be passed as an argument to the function.

viewType - String

optional default "editor", the type of view to create for the openned path. It is ignored if the displayPath indicates an already open view.

displayPath - String

identifies the path to open. Display path may be the display path of an already open (and possibly untitled) document.


filePicker(viewType)

open a file picker, and open the files that the user selects


isAudioUrl(url)

Returns - Boolean


isImageUrl(url)

Returns - Boolean


loadSqliteDatabase(uri)

Returns - ko.dbexplorer.viewManager.addSqliteDatabaseFromURI()


multipleURIs(urls, viewType, isRecent)
Arguments

urls - urls.concat()

isRecent - Boolean


recentURI(uri, viewType, skipRecentOpenFeature)
Arguments

skipRecentOpenFeature - Boolean

viewType - String


startPage()

Open Komodo's Start Page - the view will be opened synchronously.


templatePicker(viewType)

open a file picker, and open the templates that the user selects. This allows editing the templates, it is not for creating new files from templates.


URI(uri, viewType, skipRecentOpenFeature, callback)

Asynchronously open the URI in a new Komodo tab, if the file is already open then this existing tab becomes the currently focused tab. If you need the view for the file that is opened from this call, pass in a callback function argument and then this function will be called after the view is opened (or re-focused if it was already open).

Arguments

skipRecentOpenFeature - Boolean

optional default false, can be used when the URI to open is a project file to specify that the feature to open files in that project should not be offered.

viewType - String

optional default "editor" type of view component to use. Values can be [ "editor", "browser", "diff" ].

uri - String

the path or URI to open

callback - Function

optional, to be called when the asynchronous load is complete. This will only be called if this opens or switches to an editor view, e.g. this won't be called for a kpf file. The view will be passed as an argument to the function.

Returns - ko.open.URIAtLine()


URIAtLine(uri, lineno, viewType, skipRecentOpenFeature, callback)

Asynchronously open the URI in a new Komodo tab, if the file is already open then this existing tab becomes the currently focused tab. If you need the view for the file that is opened from this call, pass in a callback function argument and then this function will be called after the view is opened (or re-focused if it was already open).

Arguments

uri - String

the path or URI to open

callback - Function

optional, to be called when the asynchronous load is complete. This will only be called if this opens or switches to an editor view, e.g. this won't be called for a kpf file. The view will be passed as an argument to the function.

skipRecentOpenFeature - Boolean

optional default false, can be used when the URI to open is a project file to specify that the feature to open files in that project should not be offered.

lineno - Number

the line number to open the file at

viewType - String

optional default "editor" type of view component to use. Values can be [ "editor", "browser", "diff" ].


ko.printing

Functions

browserPrint()

browserPrintPreview(evt)

browserPrintPreviewEnter()

browserPrintPreviewExit()

print(view, preview, tofile, selectionOnly)
Arguments

selectionOnly - Boolean

tofile - Boolean

Returns - Boolean


printPreview(view, preview, tofile, selectionOnly)

ko.projects

Variables

_toolboxParts - Array


active - this


BaseManager - BaseManager


currentProject


extensionManager - projectExtensionManager


managers - Array


peMenu - peMenu


SCC - peSCC


Functions

_detabify(s, tabWidth)

Returns - s_new


_getDirFromPart(part)

Returns - defaultDir


_stripLeadingWS(text, tabWidth, baseIndentation)

Returns - fixedLines.join()


addFile(parent_item)

Returns - parts


addFileWithURL(url, parent)

Returns - this.addPartWithURLAndType()


addGroup(parent)

Returns - part


addItem(item, parent)

addMacro(parent, part)
Arguments

part - parent.project.createPartFromType()


addMenu(parent, menu)

addMenuFromPart(part)

addNewFileFromTemplate(parent, callback)

addPartWithURLAndType(url, typename, parent)
Arguments

parent - ko.projects.active.getSelectedItem()

Returns - part


addRemoteFile(item)

Returns - parts


addRemoteFolder(item)

Returns - part


addSnippet(parent, snippet)
Arguments

snippet - ko.toolbox2.createPartFromType()

parent - ko.projects.active.getSelectedItem()


addSnippetFromText(snippettext, parent)

Returns - snippet


addToolbar(parent, toolbar)

addToolbarFromPart(part)

addURL(parent, part)
Arguments

part - parent.project.createPartFromType()


addURLFromText(URLtext, parent)
Arguments

parent - ko.toolbox2.getStandardToolbox()


commandProperties(item)

executeMacro(part, async, observer_arguments)
Arguments

async - Boolean

Returns - Boolean


executeMacroById(id, asynchronous)

Returns - Boolean


exportItems(items)

exportPackageItems(items)

fileProperties(item, view, folder)
Arguments

folder - Boolean

view - ko.views.manager.getViewForURI()

Returns - Boolean


findItemsByURL(url)

Returns - items


findPart(type, name, where, part)

findPart find a part in the toolboxes and/or a specifid part's project

Arguments

name - String

type - String

part - koIPart

defaults to the running macro if available

where - String

one of "container", "toolbox", "shared toolbox", "toolboxes" or "*" where "*" means "current part project, toolbox, shared toolbox"

Returns - koIPart


findPartById(id)

Return null if there is no part with the given ID.

Returns - ko.toolbox2.findToolById()


findPartsByURL(url)

Returns - parts


handle_parts_reload()

hasURL(url)

Returns - Boolean


importFromPackage(viewMgr, part, uri)

Import a Komodo package (filename) into the given part.

Arguments

viewMgr - Object

- The project view manager.

uri - String

- The URI of the package to import.

part - Components.interfaces.koIPart

- The part to import into.


invalidateItem(item)

invokePart(part)

Given a koIPart, invoke it (do it's "double-click" action) through whatever code path is appropriate for that part -- i.e. snippets get inserted, commands get run, etc.


invokePartById(id)

Given the ID of a part, find it and invoke it.


isToolbarRememberedAsHidden(id)

Returns - Boolean


macroProperties(item)

menuProperties(item)

onload()

onToolboxLoaded(toolboxDir)

onToolboxUnloaded(toolboxDir)

open(url, skipRecentOpenFeature, ensureVisible)
Arguments

skipRecentOpenFeature - Boolean

ensureVisible - Boolean

Returns - Boolean


partAcceptsMenuToolbar(part)
Arguments

part - part.parent

Returns - Boolean


prepareForShutdown()

refreshStatus(items)
Arguments

items - pview.manager.getSelectedItems()


registerExtension(ext)

reimportFromFileSystem(part)

Returns - Boolean


removeImportedVirtualFilesAndFolders(part)

Recursively removes virtual files and folders, but does not remove any folders that have been added manually or parts that are not files or folders (i.e. snippets, macros, etc...). This function will also remove any manually added files, that were not added as part of the import process, because there is not way to tell manually added files and imported files apart.


removeItems(items)

removeItemsByURL(url, skipDialog)

Returns - items


removeItemsByURLList(urls, skipDialog)

removeMenuForPart(part)

removeToolbarForPart(part)

renameProject(project)

runCommand(cmdPart)

saveProjectAs(project)

Returns - Boolean


snippetInsert(snippet)

snippetInsertImpl(snippet, view)

Returns - enteredUndoableTabstop


snippetProperties(item)

toggleToolbarHiddenStateInPref(id)

updateToolbarForPart(part)

URLProperties(item)

ko.projects.manager

Variables

_ensureProjectPaneVisible - ensureVisible


ko.run

Functions

buildRecentCommandsMenu(popupWidget)

canClose()

Prepare to close Komodo. Return false if cannot yet close Komodo. If there are processes still running then must wait for or kill them.

Returns - Boolean


registerProcess(command, process)

Keep a list of processes spawned by the RunCommand system. This is necessary to ensure that there are no hangs when Komodo closes because some process is still running. Before closing Komodo all process must be terminated.


runCommand(editor, command, cwd, env, insertOutput, operateOnSelection, doNotOpenOutputWindow, runIn, parseOutput, parseRegex, showParsedOutputList, name, clearOutputWindow, terminationCallback, saveInMRU, saveInMacro, viewData)

Run the given command.

Arguments

parseRegex - String

clearOutputWindow - Boolean

saveInMacro - Boolean

parseOutput - Boolean

saveInMRU - Boolean

showParsedOutputList - Boolean

Returns - Boolean


runEncodedCommand(editor, encodedCommand, terminationCallback)

Run an "encoded" command. An encoded command is a string that describes the command and possibly a number of optional arguments. The encoding is defined by koIRunService.Decode().

Returns - Boolean


runRemoteCommand(serverAliasOrURI, command, terminationCallback, parseOutput, parseRegex, showParsedOutputList, clearOutputWindow)

Run the given command.

Arguments

parseRegex - String

clearOutputWindow - Boolean

showParsedOutputList - Boolean

parseOutput - Boolean

Returns - Boolean


unregisterZombieProcess()

Remove any processes that have terminated from the list.


ko.run.output

The interface for using the run output window (where run command output goes to, in the bottom pane of the Komodo workspace). Expected usage: - Someone calls ko.run.output.initialize() at startup and ko.run.output.finalize() at shutdown. - When a command is to be run in the output window do this: * announce intention to start session ko.run.output.startSession(...); *... setup and start running the actual command calling * ko.run.output.getTerminal() and ko.run.output.show() as needed ko.run.output.setProcessHandle(p); * to allow user to kill process *... setup ko.run.output.endSession() to be run when the process * terminates.

Functions

endSession(retval)

Complete a terminal session. The command exited with the given value.


finalize()

getTerminal()

Returns - _gTerminalHandler


initialize()

kill(retval)

Kill the process currently running in the output window's terminal, if any.


onFocus(event)
Arguments

event - Event


scintillaOnClick(event)
Arguments

event - Event


setProcessHandle(process)

Pass a koIRunProcess reference to the output window so it can manipulate the process that is being run in its terminal, if necessary.


show(editor, showParsedOutputList)

Show the command output window. "editor" is the XUL window holding the command output window. "showParseOutputList" is a boolean indicating whether to show the tree parsed output list.


startSession(command, parseOutput, parseRegex, cwd, filename, clearContent)

Start a terminal session in the output window with the given command. This raises an exception if the run output window is currently busy. "command" is the command being run (note that this is the command string *for display* which might be slight different -- passwords obscured -- than the actual command) "parseOutput" is a boolean indicating whether to parse output lines "parseRegex" is the regular expression to use to parse output lines "cwd" is the directory in which the command is being run (note: ditto *for display* subtlety withh "command") "filename" is the current editor filename (if any) "clearContent" is a boolean indicating whether to clear the output window content (by default "true", i.e. the window _is_ cleared).

Arguments

clearContent - Boolean


toggleView()

treeOnClick(event)
Arguments

event - Event


treeOnKeyPress(event)
Arguments

event - Event

Returns - Boolean


ko.scc

Variables

_outputPane - window


Functions

Add(sccSvc, urls, postCallback)

Add the supplied urls to SCC.

Arguments

sccSvc - Components.interfaces.koISCC

SCC service instance.

postCallback - Function

Function to be called on completion.

urls - Array

The list of urls to be added.


Checkout(checkoutFolder)

Checkout a SCC repository.

Arguments

checkoutFolder - String

(optional) Initial checkout directory.


Commit(sccSvc, urls, message, postCallback)

Commit the changes for the supplied urls into SCC.

Arguments

postCallback - Function

Function to be called on completion.

urls - Array

The list of urls to be commited.

message - String

The checkin message.

sccSvc - Components.interfaces.koISCC

SCC service instance.


Diff(sccSvc, urls, additionalOptions, postCallback)

Perform a diff revisions, and display the results.

Arguments

sccSvc - Components.interfaces.koISCC

SCC service instance.

postCallback - Function

Function to be called on completion.

additionalOptions - String

Additional diff command options.

urls - Array

The list of urls used.


DiffRelative(sccSvc, baseURI, relpaths, additionalOptions, postCallback)

Perform a diff revisions on the relative paths, display the results.

Arguments

baseURI - String

The base uri to work from.

relpaths - Array

The list relative paths to diff.

sccSvc - Components.interfaces.koISCC

SCC service instance.

postCallback - Function

Function to be called on completion.

additionalOptions - String

Additional diff command options.


DiffRevisions(sccSvc, uri1, version1, uri2, version2, filepath, additionalOptions, postCallback)

Perform a diff revisions, and display the results.

Arguments

postCallback - Function

Function to be called on completion.

version1 - String

Version of the first file to use.

version2 - String

Version of the second file to use.

filepath - String

Local path of the file used to diff.

additionalOptions - String

Additional diff command options.

sccSvc - Components.interfaces.koISCC

SCC service instance.

uri1 - String

The second file uri to diff against.


Edit(sccSvc, urls, postCallback)

Edit the supplied urls under SCC.

Arguments

sccSvc - Components.interfaces.koISCC

SCC service instance.

postCallback - Function

Function to be called on completion.

urls - Array

The list of urls to be edited.


getAvailableSCCComponents(onlyEnabled)

Get the available scc names and components.

Arguments

onlyEnabled - Boolean

Whether to only return functional components (the default is false)

Returns - Array


getServiceForFile(koIFile)

Return the SCC services that can handles the supplied koIFile. If Komodo has not yet checked the supplied file for SCC support then it is possible this function will return with no matching service even though the file may be under a SCC system. XXX - How to avoid this, force the fileStatusService to check the file?

Arguments

koIFile - Components.interfaces.koIFileEx

File needing SCC support.

Returns - Components.interfaces.koISCC


getServiceForUrl(url)

Return the SCC services that can handles the supplied koIFile. If Komodo has not yet checked the supplied url/file for SCC support then it is possible this function will return with no matching service even though the file may be under a SCC system. XXX - How to avoid this, force the fileStatusService to check the file?

Arguments

url - wstring

Url to get the handling SCC services for.

Returns - Components.interfaces.koISCC


History(sccSvc, urls, localRevisions)

Load the SCC history dialog for the given urls.

Arguments

sccSvc - Components.interfaces.koISCC

SCC service instance.

urls - Array

The list of urls.

localRevisions - Array

The matching list of current scc file versions, must be one for every url.


initializePane()

Initialize the output pane. This is expectly to only be called from onload of the output pane.


Remove(sccSvc, urls, postCallback)

Remove the supplied urls from SCC.

Arguments

sccSvc - Components.interfaces.koISCC

SCC service instance.

postCallback - Function

Function to be called on completion.

urls - Array

The list of urls to be removed.


Revert(sccSvc, urls, postCallback)

Revert (undo changes for) the supplied urls in SCC.

Arguments

sccSvc - Components.interfaces.koISCC

SCC service instance.

postCallback - Function

Function to be called on completion.

urls - Array

The list of urls to be added.


Update(sccSvc, urls, postCallback)

Update the supplied urls for latest SCC contents.

Arguments

sccSvc - Components.interfaces.koISCC

SCC service instance.

postCallback - Function

Function to be called on completion.

urls - Array

The list of urls.


warnSSHConfiguration()

Warn the user about enabling CVS and SVN SSH integration.


ko.scc.logger

Variables

_lastMessage - ko.notifications.add()


_stringBundle


Functions

addMessage(sccName, severity, title, details)
Arguments

severity - Ci.koINotification.SEVERITY_INFO

Returns - this._lastMessage


append(text)

Adds text to the last reported SCC action

Arguments

text - String

The output text to be added


finalize()

init()

One off initialization of the SCC output panel text.


reportSCCAction(sccSvc, cmdName, urls, text, result)

Report the SCC command results in the main Komodo SCC output panel.

Arguments

text - text.getPropertyAsAString()

cmdName - String

The name of the scc command.

result - Number

The result of the action (one of koIAsyncCallback::RESULT_*)

urls - Array

The list of urls used.

sccSvc - Components.interfaces.koISCC

SCC service instance. Alternatively, a string.

Returns - message


show(message)

Show the main Komodo SCC output panel, will ask if the user wants to see it.


ko.sectionlist

Functions

finalize()

initialize()

observe(subject, topic, data)

QueryInterface(iid)

Returns - this


update(event, view, forceUpdate)

Update the 'Sections' statusbar panel label.

Arguments

event - Event

view - event.originalTarget


ko.sleuth

Variables

manager - Sleuth


tabManager - SleuthResultsTabManager


Functions

SleuthTabManager_Initialize()

Classes

class SciMozEventist

Class functions

onCharAdded()

Returns - Boolean


onDoubleClick()

Returns - Boolean


onDwellEnd()

onDwellStart()

onKey()

Returns - Boolean


onMacroRecord()

Returns - Boolean


onMarginClick()

Returns - Boolean


onModified()

onModifyAttemptRO()

Returns - Boolean


onNeedShown()

Returns - Boolean


onSavePointLeft()

Returns - Boolean


onSavePointReached()

Returns - Boolean


onStyleNeeded()

Returns - Boolean


onUpdateUI()

Returns - Boolean


QueryInterface(iid)

Returns - this



ko.statusBar

Functions

AddMessage(msg, category, timeout, highlight, interactive, log)

AddMessage Post a message to the status bar message area. "msg" is the message string. An empty string or null indicates that the message (of the given category) should be cleared. "category" is the message group to which the message belongs. It is an arbitrary string (it must be at least one character). "timeout" is the amount of time, in milliseconds, that the message should appear. A value of 0 indicates that the message does not timeout. "highlight" is a boolean indicating whether the message should be highlighted on the status bar. "interactive" is a boolean indicating whether the message corresponds to an interactive prompt (such as interactive search). These have higher 'priority' over non-interactive messages in case of conflict. "log" is a boolean indicating whether the message should be logged. This is set by default. A structure similar to a stack of status messages is maintained. The latest message is always shown. When/if it timesout then the previous message is the stack is displayed. There can only be one message per category, so reusing a category allows for removal of status messages that are no longer appropriate. To add a message that does not timeout: ko.statusBar.addMessage("hello there", "my_category", 0, false) To remove that message: ko.statusBar.addMessage(null, "my_category", 0, false) To add a highlighted message for three seconds: ko.statusBar.addMessage("hello there", "my_category", 3000, true)

Returns - _addMessage()


changeEncoding(menuitem)

Set the encoding menu for the current view.


Clear()

Clear clear all statusbar elements


ClearCheck()

ClearCheck clear the syntax checking status


dump()

dump dump the current message stack to stdout


setupEncodingMenu(menupopup)

Set the encoding menu for the current view.

Arguments

menupopup - DOMElement


ko.statusBar.browserStatusHandler

Variables

QueryInterface - XPCOMUtils.generateQI()


Functions

onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab)

setJSDefaultStatus(status)

setJSStatus(status)

setOverLink(link, context)

ko.stringutils

Functions

bytelength(s)

Returns - _sysUtils.byteLength()


charIndexFromPosition(s, p)

Returns - _sysUtils.charIndexFromPosition()


contractUser(path)

Use koIOs.expanduser to expand a leading "~". This contracts it.

Arguments

path - String

Returns - one


escapeWhitespace(text)
Arguments

text - text.replace()

Returns - String


getSubAttr(value, subattrname)
Arguments

value - part.slice().replace().replace()


strip(s)

Return a copy of s with the leading and trailing whitespace removed.

Returns - String


unescapeWhitespace(text, eol)

Returns - newtext


updateSubAttr(oldValue, subattrname, subattrvalue)

Returns - newValue


ko.tabstops

Variables

backrefNum - backrefNum


backrefNumber - backrefNumber


indicator - indicator


isBackref - isBackref


isBackrefAnchor - isBackrefAnchor


message - msg


snippet - snippet


text - String


Functions

_clearAllCurrentHits(scimoz, position)

_containsActiveLink(scimoz, indicator)

Returns - indicatorEnd


_deleteTabstopItem(view, tabstopInsertionTable, idx)

_ensureInsertMode()

_hasOtherLinks(tabstopInsertionTable, backrefNumber, idx)

Returns - Boolean


_removeIndicatorsBeforeDelete(view, targetRangeStart, targetRangeEnd)

_restoreDroppedIndicators(followingSet, prevSet, scimoz, pos, utf8Len)

_updateAllHits(scimoz, position, indicator, newUnicodeText, newUTF8Length)

_updateAllZeroWidthHits(scimoz, position, newUnicodeText, newUTF8Length)

_useIndicator(view, scimoz, indicator, spos, epos, isBackref)
Arguments

isBackref - Boolean


atEmptyLinkedTabstop(scimoz, position, utf8Length)

Are we the first string to be added in a linked tabstop?


clearLinkedTabstops(scimoz, view)

Remove linked tabstops from the document.


clearTabstopInfo(view)

Remove all traces of tabstops from the view and document.


dumpParseResult(tree)

findByIndicator(scimoz, indicator, startingPos)

Returns - Array


forceUpdateAllZeroWidthLinks(view, scimoz, position, text, utf8Length)

This method creates non-empty tabstops where only a zero-width indicator link was found. It's necessary because the indicator might be detected when 'a' is typed like so: a<*> but by the time it's processed, the user has typed 'sd', leading to this situation: asd<*> In this case, only the 'd' is found to be next to a zero-width indicator, so the 'a' and 's' don't appear in the other tabstops. This function fixes that.


handleBackspace(scimoz)

Watches for backspace at the start of a tabstop. Further comments in the code.


handleDelete(scimoz)

Similar to handleBackspace, but watches for delete actions at the right of the indicator. This routine is simpler: if we're about to step on the TSCZW indicator at the end of a linked tabstop, it's time to unlink them.


handleDeleteByUndo(view, scimoz, position, length)

If we're removing a full TSC, but not the trailing TSCZW, remove the linked items anyway. Otherwise we end up in a state where modifying the parent text doesn't affect the linked tabstops, but if we append at this point, the other tabstops get the update. It's asymmetrical, so we'll unlink.


insertEmptyIndicator(scimoz, startingPos, indicator)

Returns - finalLen


moveToNextTabstop(view)

When the user presses the tab key, this method first determines if there is a current set of linked tabstops to unlink, and then finds the next tabstop to visit. If that tabstop is the head of a set of tabstops linked by the same backref, it colors each tabstop with the TSC indicator ("Tabstop Current"), and also places an invisible TSCZW indicator to the right of each one, to allow the user to delete TSC-indicated text.

Returns - Boolean


parseLiveText(liveText)

Parse a stream of pieces of text and tabstop.

Returns - Object


textHasTabstops(text)

Returns - tabstop_re.test()


updateLinkedBackrefs(modificationType, view, position, unicodeText, utf8Length)

When the user makes a modification in a document with tabstops, this routine handles the change. It handles two main events: 1. The first linked tabstop has changed. All other linked tabstops are updated with the new value. 2. Text containing indicators is about to be deleted. This routine removes the appropriate entries from the view's tabstopIndicatorTable.


Classes

class LiveTextParser

Constructor

LiveTextParser()

Class variables

availIndicators - Array


endingIndicatorsInUse - Array


idx - Number


lastIndicatorInUse - indicator


lim - liveText.length


nestedIndicatorsInUse - Array


subjectText - liveText


Class functions

_availableIndicatorCheck()

_parseTabstopNameSequence()

Returns - retStrParts.join()


_releaseIndicators()

_shuffleIndicators(indicator)

lookingAtTabstop()

Returns - this.subjectText.substr()


parse(liveText)

Returns - Node


parseNestedLiveText(parentNode, isInner)
Arguments

isInner - Boolean


parseTabstop()

parseTextBlock(isInner)

Returns - ko.tabstops.LiveTextPlain


throwParseException(expecting, reason)


class LiveTextParserException

Exception object. The message field gives a specific message.

Constructor

LiveTextParserException(msg, snippet)

Class variables

constructor - Error.constructor


Class functions

insertLiveText(scimoz_, insertionPoint, tabstopTextTree)

Inserts the contents of parsed liveText into the buffer

Returns - Number



class LiveTextPlain

*************** LiveTextPlain ***************

Constructor

LiveTextPlain(text)

Class functions

describe(indent)

Returns - indent


insertLiveTextPart()

Returns - ko.stringutils.bytelength()



class LiveTextTabstopBackrefDef

*************** LiveTextTabstopBackrefDef ***************

Constructor

LiveTextTabstopBackrefDef(indicator, backrefNum, text)

Class functions

describe(indent)

Returns - indent


insertLiveTextPart()

Returns - insertLiveTextPartHelper()



class LiveTextTabstopBackrefUse

*************** LiveTextTabstopBackrefUse ***************

Constructor

LiveTextTabstopBackrefUse(indicator, backrefNum, text)

Class functions

describe(indent)

Returns - indent


insertLiveTextPart()

Returns - insertLiveTextPartHelper()



class LiveTextTabstopEmpty

*************** LiveTextTabstopEmpty ***************

Constructor

LiveTextTabstopEmpty()

Class functions

describe(indent)

Returns - indent


insertLiveTextPart()

Returns - ko.tabstops.insertEmptyIndicator()



class LiveTextTabstopNested

*************** LiveTextTabstopNested ***************

Constructor

LiveTextTabstopNested(indicator)

Class functions

describe(indent)

Returns - parts.join()


insertLiveTextPart()

Returns - len



class LiveTextTabstopText

*************** LiveTextTabstopText ***************

Constructor

LiveTextTabstopText(indicator, text)

Class functions

describe(indent)

Returns - indent


insertLiveTextPart()

Returns - insertLiveTextPartHelper()



class TabstopInsertionNode

Constructor

TabstopInsertionNode(indicator, isBackref, backrefNumber, isBackrefAnchor)
Arguments

isBackref - Boolean


Class functions

describe()

Returns - s



ko.tabstops._parseResultsById

ko.toolbox2

Variables

_arrowKeys - Array


_sortDirection - String


_webPackageURL - url


log - log


manager - Toolbox2Manager


multipleNodesSelected - Boolean


raggedMultipleSelection - Boolean


selectedIndices - this.getSelectedIndices()


Functions

_addFlavors(dt, currentFlavors, path, index)

_addTrailingSlash(uri)

Returns - uri


_clickedOnRoot()

_currentRow(event, tree)
Arguments

event - Event

Returns - row.value


_determineTargetDirectory_CallMethod(method)

_findCommonParent(currentParentDir, nextParentDir)

Returns - String


_getLoadedMacros(paths)

Returns - cleanMacros


_getNewSuggestedName(srcBaseName, targetDirPath)

Returns - Array


_getSelectedTool(assertOfType)

Returns - tool


_getUniqueFileName(targetDirectory, newPath)

Returns - osPathSvc.join()


_handleDroppedURLs(index, koDropDataList, copying)
Arguments

index - this.manager.view.getIndexByTool()

Returns - loadedSomething


_removeLoadedMacros(loadedMacroURIs)

_removeTrailingSlash(uri)

Returns - uri


_selectCurrentItems(isCopying)

add_command(parent, item)

add_folder(parent, item)

add_macro(parent, item)

add_menu(parent, item)

add_snippet(parent, item)

add_template(parent, item)

add_toolbar(parent, item)

add_URL(parent, item)

addItem(tool, parent, selectItem)
Arguments

parent - this.getStandardToolbox()

selectItem - Boolean


addNewItemToParent(item, parent)

addToolboxItem(itemType)

addToolboxItem_common(parent, itemType)

addToolboxItemToStdToolbox(itemType)

applyKeybindings()

copyItem(event)
Arguments

event - Event


createPartFromType(toolType)

Returns - this.manager.toolsMgr.createToolFromType()


cutItem(event)
Arguments

event - Event


deleteItem(event)
Arguments

event - Event


doDrop(event, tree)
Arguments

event - Event

Returns - Boolean


doStartDrag(event, tree)

editProperties_command(tool)
Arguments

tool - this._getSelectedTool()


editProperties_macro(tool)
Arguments

tool - this._getSelectedTool()


editProperties_menu(tool)
Arguments

tool - this._getSelectedTool()


editProperties_snippet(tool)
Arguments

tool - this._getSelectedTool()


editProperties_toolbar(tool)
Arguments

tool - this._getSelectedTool()


editProperties_URL(tool)
Arguments

tool - this._getSelectedTool()


editPropertiesItem(event)
Arguments

event - Event


editPropertiesTool(tool)

exportAsZipFile(event)
Arguments

event - Event


findToolById(id)

Returns - this.manager.toolsMgr.getToolById()


getAbbreviationSnippet(abbrev, subnames)

Returns - this.manager.toolsMgr.getAbbreviationSnippet()


getContainerForIndex(index)

Returns - index


getContainerFromIndex(index)
Arguments

index - this.manager.view.getParentIndex()

Returns - item


getCustomMenus(dbPath)

Returns - obj.value


getCustomToolbars(dbPath)

Returns - obj.value


getExtensionToolbox(extensionName)

Returns - this.manager.toolbox2Svc.getExtensionToolbox()


getProjectToolbox(uri)

Returns - this.manager.toolsMgr.getToolById()


getSelectedContainer()

Returns - item


getSelectedIndices(rootsOnly)
Arguments

rootsOnly - Boolean

Returns - ko.treeutils.getSelectedIndices()


getSelectedItem()

Returns - this.manager.view.getTool()


getStandardToolbox()

Returns - this.manager.toolbox2Svc.getStandardToolbox()


getToolboxResolvedPaths(selectedIndices)

Returns - paths


getToolsByTypeAndName(toolType, toolName)

Returns - tools.value


getToolsWithKeyboardShortcuts(dbPath)

Returns - obj.value


getTriggerMacros(dbPath)

Returns - obj.value


getViCommand(commandName)

handle_keypress_setup(event)
Arguments

event - Event

Returns - ko.toolbox2.onTreeKeyPress()


importFilesFromFileSystem(event)
Arguments

event - Event


importFilesFromFileSystem_common(defaultDirectory, index)

importFilesFromFileSystem_toStdToolbox(event)
Arguments

event - Event


importFolderFromFileSystem(event)
Arguments

event - Event


importFolderFromFileSystem_common(defaultDirectory, index)

importFolderFromFileSystem_toStdToolbox(event)
Arguments

event - Event


importPackage(event)
Arguments

event - Event


importPackage_common(targetDirectory, index)

importPackage_toStdToolbox(event)
Arguments

event - Event


importPackageFromWeb(event)
Arguments

event - Event


importPackageFromWeb_common(targetDirectory, index)

importPackageFromWeb_toStdToolbox(event)
Arguments

event - Event


invoke_editMacro(tool)
Arguments

tool - this._getSelectedTool()


invoke_executeMacro(tool)
Arguments

tool - this._getSelectedTool()


invoke_insertSnippet(tool)
Arguments

tool - this._getSelectedTool()


invoke_openTemplate(tool)
Arguments

tool - this._getSelectedTool()


invoke_openURLInBrowser(tool)
Arguments

tool - this._getSelectedTool()


invoke_openURLInTab(tool)
Arguments

tool - this._getSelectedTool()


invoke_runCommand(tool)
Arguments

tool - this._getSelectedTool()


invokeTool(tool)

onDblClick(event, checkMouseClick)
Arguments

checkMouseClick - Boolean

event - Event


onFilterKeypress(event)
Arguments

event - Event


onFocusWindow(event)
Arguments

event - Event


onload()

onTreeClick(event)
Arguments

event - Event


onTreeKeyPress(event)
Arguments

event - Event

Returns - Boolean


onUnload()

pasteIntoItem(event)
Arguments

event - Event


processMenu(menuNode, toolType)

reloadFolder(event)
Arguments

event - Event


removeItem(item)

renameItem(event)
Arguments

event - Event


saveToolsAs(event)
Arguments

event - Event


saveToolsAs_aux(event)
Arguments

event - Event

Returns - Array


showInFileManager(itemType)

sortRows(sortDirection)

updateContextMenu(event, menupopup)
Arguments

event - Event


updateFilter(event)
Arguments

event - Event

Returns - this.manager.updateFilter()


ko.toolbox2._sortValuesByName

Variables

ascending - Components.interfaces.koIToolbox2HTreeView.SORT_BY_NAME_ASCENDING


descending - Components.interfaces.koIToolbox2HTreeView.SORT_BY_NAME_DESCENDING


natural - Components.interfaces.koIToolbox2HTreeView.SORT_BY_NATURAL_ORDER


ko.toolbox2.createPartFromType

Variables

type - String


value - escapedtext


ko.toolboxes

Variables

toolboxBaseManager - toolboxBaseManager


user - ko.toolbox2


Functions

addCommand(command, cwd, env, insertOutput, operateOnSelection, doNotOpenOutputWindow, runIn, parseOutput, parseRegex, showParsedOutputList, name)
Arguments

name - command


ko.treeutils

Functions

getAllIndices(view)

Returns - a


getSelectedIndices(view, rootsOnly)

Returns - selectedIndices


ko.uilayout

Variables

_updateToolbarSeparators

Show/hide toolbar separators in response to their surrounding elements being hidden


_windowInfoList - ko.workspace.getRecentClosedWindowList()


toggleWidget - this.toggleTab


Functions

_loadRecentWindow(window_MRU_Num)

_setTabPaneLayoutForTabbox(layout, pane, position)

_updateMRUClosedWindowMenu(limit)

buildViewAsLanguageMenu(menupopup)

customizeToolbars(aToolbox)

Start toolbar customization

Arguments

aToolbox - <toolbox>

[optional] The toolbox to customize

Returns - dialog


ensureOutputPaneShown()

ensurePaneForTabHidden(tabName)

ensurePaneShown(pane)

Makes the given pane open/visible in Komodo.


ensureTabShown(widgetId, focusToo)
Arguments

focusToo - Boolean


focusPane(paneId)

fullScreen()

Toggle the full screen state of the window


handle_current_view_changed_setup(event)
Arguments

event - Event


isButtonTextShowing()

Returns - _buttonTextShowing


isCodeBrowserTabShown()

isPaneShown(pane)

Returns whether the given pane is currently opened/visible in Komodo.

Arguments

pane - {object

| id} - The pane element, or the id of the pane element.

Returns - Boolean


isTabShown(widgetId)

Returns - Boolean


leftPaneShown()

newFileFromTemplateOrTrimMRU(templateURI, mruPrefName, mruIndex)

onload()

onloadDelayed()

outputPaneShown()

populatePreviewToolbarButton(popup)

restoreTabSelections(prefs)
Arguments

prefs - _gPrefs


rightPaneShown()

saveTabSelections(prefs)
Arguments

prefs - _gPrefs


setTabPaneLayout()

Sets the user's tab pane layout to match the Komodo appearance preferences.


syncTabSelections()

toggleButtons()

toggleFullScreenToolboxAutoHide()

Toggle whether the toolbox should auto-hide in full screen mode


togglePane(paneId, force)
Arguments

force - Boolean


toggleSplitter(aCommandID)

toggleTab(widgetId, collapseIfFocused)
Arguments

collapseIfFocused - Boolean


toggleToolbarVisibility(toolbarId)

unload()

updateFullScreen()

Update the menubar menu item to reflect whether the window is in full screen mode


updateMRUMenuIfNecessary(mru, limit)
Arguments

limit - Number


updateTabpickerMenu(menupopup)

updateTitlebar(view)

updateToolbarArrangement(buttonTextShowing)
Arguments

buttonTextShowing - broadcaster.hasAttribute()


updateToolboxContextMenu()

Update the context menu for the toolbox


updateViewAsLanguageMenu(menupopup, view)
Arguments

view - ko.views.manager.currentView


updateWindowList(popup)

ko.uriparse

Functions to convert/parse strings representing URLs, files, etc. This is basically a loose shim around class URIParser in URIlib.py (somewhat obtusely via koIFileEx). Routines: ko.uriparse.localPathToURI(<localPath>) ko.uriparse.pathToURI(<URI or localPath>) ko.uriparse.URIToPath(<URI or path>) ko.uriparse.URIToLocalPath(<URI or localPath>) ko.uriparse.displayPath(<localPath or URI>) ko.uriparse.baseName(<localPath or URI>) ko.uriparse.dirName(<localPath or URI>) ko.uriparse.ext(<localPath or URI>) Dev Notes: - This module caches a single koIFileEx instance to, presumably, speed things up.

Functions

addMappedURI(uri, path)

Show the dialog for creating a new mapped URI with the supplied uri and path arguments.

Arguments

uri - String

The URI to add a mapping for.

path - String

The path the URI will be mapped to.

Returns - Boolean


baseName(file)

Get the basename (a.k.a. leafName) of the given file. "file" can be a local filename or URI. Examples: file:///D:/trentm/foo.txt -> foo.txt D:\trentm\foo.txt -> foo.txt ftp://ftp.activestate.com/ActivePython -> ActivePython

Returns - koFileEx.baseName


commonURIPrefixAndPathsFromURIs(uris)

Return an array, holding the the common URI prefix as the first element of the array and an array of the relative paths as the second array entry.

Arguments

uris - Array

Returns - Array


commonURIPrefixFromURIs(uris)

Return the common URI prefix of the given list of URIs.

Arguments

uris - Array

Returns - String


dirName(file)

Get the dirname of the given file. "file" can be a local filename or URI referring to a local file. Examples: file:///D:/trentm/foo.txt -> D:\trentm D:\trentm\foo.txt -> D:\trentm ftp://ftp.activestate.com/ActivePython -> throws exception

Returns - koFileEx.dirName


displayPath(uri)

Get an appropriate representation of the given URI for display to the user. "uri", typically, is a URI, though it can be a local filename as well. Examples: file:///D:/trentm/foo.txt -> D:\trentm\foo.txt D:\trentm\foo.txt -> D:\trentm\foo.txt ftp://ftp.activestate.com/ActivePython -> ftp://ftp.activestate.com/ActivePython

Returns - koFileEx.displayPath


ext(file)

Get the extension of the given file. "file" can be a local filename or URI

Returns - koFileEx.ext


deprecated fixupURI(uri)

DEPRECATED: Was once used to ensure URI's were properly formatted.

Returns - uri


getMappedPath(path, prefs)

This is a reverse of getMappedURI. Return a unmapped URI if there is a pref setup to match the given path, else return whatever was passed in. Note: If a mapping existed, the return result is *always* a URI.

Arguments

path - String

The path or URI to check for uri mappings.

prefs - Components.interfaces.koIPreferenceSet

Optional. The preference set to check against.

Returns - String


getMappedURI(uri, prefs)

Uses the supplied URI to check if there are any special mappings setup in order to change this URI into another location. If there is a match, return the new URI, else return the original URI.

Arguments

uri - String

The URI to check.

prefs - Components.interfaces.koIPreferenceSet

Optional. The preference set to check against.

Returns - String


localPathToURI(localPath)

Get the URI representation of the given local file path. "localPath" must be a local file path. Returns the URI for the given path or raises an exception if "localPath" is not a local path. Returned URIs are normalized ("x/./y" => "x/y", etc.) Examples: D:\trentm\foo.txt -> file:///D:/trentm/foo.txt \\planer\d\trentm\tmp\foo.txt -> file://planer/d/trentm/tmp/foo.txt file:///D:/trentm/foo.txt -> throws exception ftp://ftp.activestate.com/ActivePython -> throws exception

Returns - _normalizedPathToURI()


pathToURI(path)

Get the URI representation of the given local file path or URI "path" must be a local file path or a URI Returns the URI for the given path or the URI if one was passed in. Returned URIs are normalized ("x/./y" => "x/y", etc.) Examples: D:\trentm\foo.txt -> file:///D:/trentm/foo.txt file:///D:/trentm/foo.txt -> file:///D:/trentm/foo.txt ftp://ftp.activestate.com/ActivePython -> ftp://ftp.activestate.com/ActivePython

Returns - _normalizedPathToURI()


relativePath(fromPath, toPath)

Return the relative path from 'fromPath' to 'toPath'.

Arguments

fromPath - String

The local path to get to.

Returns - String


URIToLocalPath(uri)

Get the local file path for the given URI. "uri" may be a URI for a local file or a local path. Returns the local file path or raises an exception if there is no local file representation for that URI. Note: I would rather this explicitly raised if "uri" were a local path, but koIFileEx does not work that way. Examples: D:\trentm\foo.txt -> D:\trentm\foo.txt file:///D:/trentm/foo.txt -> D:\trentm\foo.txt ftp://ftp.activestate.com/ActivePython -> throws exception

Returns - koFileEx.path


URIToPath(uri)

Get the file path for the given URI. "uri" may be a URI for a local or remote path. Returns the file path or raises an exception if there is no local file representation for that URI. Examples: D:\trentm\foo.txt -> D:\trentm\foo.txt file:///D:/trentm/foo.txt -> D:\trentm\foo.txt ftp://ftp.activestate.com/ActivePython -> /ActivePython

Returns - koFileEx.path


ko.views

Variables

_currentView


_observingCtrlKeyUp - Boolean


_recentViews - Array


inBufferSwitchingSession - Boolean


log - ko.logging.getLogger()


manager - (anonymous 34)()


viewManager - viewManager


Functions

addDeprecatedGetter(deprecatedName, namespaceName, propertyName)

gotoLine_onkeypress_handler(event)
Arguments

event - Event


handle_current_view_changed(event)
Arguments

event - Event


handle_view_closed(event)
Arguments

event - Event


handle_view_list_closed(event)
Arguments

event - Event


handle_view_opened(event)
Arguments

event - Event


labelFromPathInfo(baseName, dirName, lineNo, tabId, viewType, sectionTitle, showDirty)

Shared code that returns a label and tooltip based on the path info, and other pertinent info on the state of the document/view object.

Arguments

tabId - String

- Komodo tab id

showDirty - Boolean

sectionTitle - String

baseName - String

viewType - String

- editor/browser/startpage/...

lineNo - Number

- one-based line number

dirName - String

Returns - String


labelsFromView(view, lineNo, showDirty, sectionTitle)

Shared code that returns a label and tooltip based on the supplied view, suitable for a menuitem.

Arguments

showDirty - Boolean

- put a "*" in the label if the view's document is dirty

sectionTitle - String

- optional string that describes a location.

lineNo - Number

- one-based line number

view - Object(koIScintillaView)

Returns - Array


nullOnModifiedHandler()

Returns - Boolean


onload()

ScimozOffsetFromUCS2Offset(scimoz, pos, delta)
Arguments

pos - scimoz.positionBefore()

Returns - pos


wrapScintillaChange(view, func)

Classes

class ViewHistory

view history controller Recently-visited views: The viewhistory object maintains a stack of recently visited lists. This information can be used to switch to recent views. The semantics of the following methods are as follows: - .getNextMostRecentView() and .getNextLeastRecentView() are used by the buffer switching commands to know which views to switch to. - .enterBufferSwitchingSession() and .exitBufferSwitchingSession() are called by the buffer swiching commands to help .setMostRecentView() know how to behave (the "recent views" stack is NOT updated during such a session). Note that .enter...() may be called multiple times for one .exit...() call. - .setMostRecentView() is called by the view manager's .selectView() and can be called directly by the buffer switching commands for proper session handling. NOTE: THIS BEHAVIOR IS TURNED OFF BY SETTING "handlestctrltab" to false on the tabbed view.

Constructor

ViewHistory()

Class variables

_keylistener


_recentViews - newStack


constructor


inBufferSwitchingSession - Boolean


Class functions

_debug_recentViews()

_getCurrentViewIdx()

Returns - currIndex


_keylistener(event)
Arguments

event - Event


_setKeyListener()

ctrlup(event)
Arguments

event - Event


doNextLeastRecentView()

doNextMostRecentView()

enterBufferSwitchingSession()

exitBufferSwitchingSession()

finalize()

genRecentViews()

Generate the view history views in order (current view first, then the next most recent view, ...).


getNextLeastRecentView()

Returns - view


getNextMostRecentView()

Returns - view


getState()

Returns - state


removeRecentView(view)

setMostRecentView(view)

setState(state, viewcontainer)


ko.widgets

Functions

getEncodingPopup(hierarchy, toplevel, action)

Returns - menuitem


ko.window

Functions

checkDiskFiles(event)

view_checkDiskFiles is only called from the window's focus handler, located in komodo.xul. it handles checking if any files have changed.

Arguments

event - Event

Returns - Boolean


focusedScintilla()

does scintilla have focus? Return the scintilla widget

Returns - Element


focusedView()

does any view widget have focus? return which one does or null

Returns - Element


getCwd()

get the current working directory for the window, which is the directory of the current buffer, or the home directory of the user

Returns - this.getHomeDirectory()


getHomeDirectory()

Returns - String


ko.windowManager

Functions

closeAll(parent)

Close all open windows (or just children of a given parent window). The normal goQuitApplication function in toolkit does this, but we want to prevent quitting if one of the dialogs prevents shutdown by not closing.

Arguments

parent - Window

An optional argument to only close windows that are children of this window.

Returns - Boolean


closeChildren()

Close children of the current main Komodo window.

Returns - this.closeAll()


fixupOpenDialogArgs(inargs)

Returns - args


fixupOpenDialogFeatures(features)

Return a "fixed-up" version of the "features" argument for window.openDialog(). This tweaks the string on Mac OS X to ensure the dialog is *not* opened as a sheet.

Arguments

features - String

The features string to fixup. Pass in null to get a reasonable default.

Returns - features


focusNextWindow()

Change the focus to the next Komodo window.

Returns - <Window>


focusPreviousWindow()

Change the focus to the previous Komodo window.

Returns - <Window>


getLastAnyWindow()

Return the last opened window - of any window type.

Returns - <Window>


getMainWindow()

return a reference to the main Komodo window

Returns - <Window>


getWindows()

Returns an array of all Komodo windows that are currently open.

Returns - Array


lastWindow()

return true if this is the only Komodo window open

Returns - <Window>


openDialog()

An alternative version of window.openDialog() that does some fixups that Komodo wants in general.

Returns - window.openDialog.apply()


openOrFocusDialog(chromeURI, windowType)

Open a window if no windows of windowType exist. Otherwise, bring the window of windowType to the front. Parameters for this function are identical to window.openDialog()

Returns - <Window>


otherWindowHasViewForURI(uri)

Returns - Boolean


windowFromWindowNum(windowNum)

ko.windowManager.getLastAnyWindow()

ko.windowManager.getLastAnyWindow().arguments[0]

Variables

uris - urllist


ko.workspace

Variables

_calledInitializeEssentials - Boolean


restoredLeftTabBoxID - workspace.getStringPref()


Functions

_getNextWorkspaceIndexToRestore(currIdx)

_getWindowWorkspace()

Returns - windowWorkspace


_restoreWindowWorkspace(workspace, currentWindow, checkWindowBounds)

_saveWorkspaceForIdx_aux(idx, restoreOnRestart, thisWindow, mainWindow, windowWorkspace, saveCoordinates)

getRecentClosedWindowList()

Returns - mruList


initializeEssentials(currentWindow, showStartPage)
Arguments

showStartPage - Boolean


markClosedWindows()

restoreInProgress()

Returns - _restoreInProgress


restoreWorkspace(currentWindow)

restore all workspace preferences and state, open files and projects

Arguments

currentWindow - ko.windowManager.getMainWindow()


restoreWorkspaceByIndex(currentWindow, idx, thisIndexOnly)
Arguments

idx - parseInt()


saveInProgress()

Returns - _saveInProgress


saveWorkspace()

save all workspace preferences and state


saveWorkspaceForIdx(idx)

xtk

Variables

flatTreeView - xtk.dataTreeView


Functions

importNS(to, from)

importNS import one namespace into another

Arguments

to - from[i]


include(ns)

include include an xtk namespace


load(uri, obj)

load load a JavaScript file into the global namespace or a defined namespace

Arguments

obj - Object

object to load the JavaScript into, if undefined loads into global namespace

uri - String

uri to a JavaScript File


Classes

class baseTreeView

Constructor

baseTreeView()

Class variables

debug - Number


mSelection - s


mSelectionCallback - f


mSingleSelect - Boolean


mSortType - Number


mTotalRows - Number


mTree - tree


rowCount


selection


selectionCallback


singleSelect


Class functions

canDrop(index, orientation)

Returns - Boolean


cycleCell(row, colID)

cycleHeader(colID, elt)

drop(row, orientation)

getCellProperties(row, colID, properties)

getCellText(row, colID)

Returns - String


getColumnProperties(colID, colElt, properties)

getImageSrc(row, colID)

getLevel(index)

Returns - Number


getParentIndex(rowIndex)

Returns - Number


getRowProperties(index, properties)

hasNextSibling(rowIndex, afterIndex)

isContainer(index)

Returns - Boolean


isContainerEmpty(index)

Returns - Boolean


isContainerOpen(index)

Returns - Boolean


isEditable(row, colID)

Returns - Boolean


isSeparator(index)

Returns - Number


isSorted()

performAction(action)

performActionOnCell(action, row, colID)

performActionOnRow(action, row)

QueryInterface(iid)

Returns - this


selectionChanged()

setCellText(row, colID, value)

setTree(tree)

toggleOpenState(index)


class Controller

Constructor

Controller()

Class functions

doCommand(command)

isCommandEnabled(command)

Returns - result


onEvent(event)
Arguments

event - Event


supportsCommand(command)

Returns - result



class dataTreeView

A flat tree implementation. Sample Usage: XUL: <tree id="sample_tree" flex="1"> <treecols> <treecol id="sample_treecol_name" flex="1" label="Name"/> <splitter class="tree-splitter"/> <treecol id="sample_treecol_value" flex="1" label="Name"/> </treecols> <!-- Tree children are dynamically generated, from our own custom tree view --> <treechildren/> </tree> JavaScript: function SampleTreeView(initial_rows) { if (!initial_rows) { // Default value then this._rows = []; } else { this._rows = initial_rows; // The following two lines ensure proper inheritance (see Flanagan, p. 144). SampleTreeView.prototype = new xtk.dataTreeView(); SampleTreeView.prototype.constructor = SampleTreeView; // Override getCellText method for assigning the celltext SampleTreeView.prototype.getCellText = function(row, column) { // forRow is an item of the _rows array var forRow = this._rows[row]; switch (column.id) { case 'sample_treecol_name': return forRow[0]; case 'sample_treecol_value': return forRow[1]; return "(Unknown column: " + column.id + ")"; // Load the tree view and assign it to a tree element var sampleTreeView = new SampleTreeView(); var sampleTree = document.getElementById("sample_tree"); sampleTree.treeBoxObject.view = sampleTreeView; // SORTING: // Sorting capabilitilies are automatically included (string sorting by // default). These are all of the sort specific attributes: // <treecol sortActive="true|false" /> - marks the default sort column // <treecol sortDirection="ascending|descending|natural" /> // <treecol sortType="string" /> - String sorting (default when not specified) // <treecol sortType="numeric" /> - Numerical sorting // <treecol sortType="function:func_name" /> - Custom sort function: // where "func_name" is a function in the SampleTreeView class. The // signature looks like: "func_name(compare1, compare2)". Each // compare argument is an object that contains these attributes: // compare1.data -> data (string) return by getCellText. // compare1.row -> the real underlying row object. // compare1.oldindex -> original row index before the sort. // See the "_doDataCompare" function below for an example.

Constructor

dataTreeView(initial_rows)

Class variables

_debug - Number


_rows - Array


_sortCaseInsensitive - Boolean


_sortColumn - column


_sortDirection - Number


_unfilteredRows - this._rows


rowCount


rows


SORT_ASCENDING - Number


SORT_DESCENDING - Number


tree - out


Class functions

_reverseRowSortOrder(rows)

_setTreeRows(rows, doReSort)

clearSortIndicators()

cycleCell(row, colId)

cycleHeader(col)

filter(text)
Arguments

text - text.toLowerCase()


getCellProperties(row, column, properties)

getCellText(row, column)

Returns - String


getCellValue(row, column)

getColumnProperties(column, prop)

getImageSrc()

getLevel(row)

Returns - Number


getRowProperties(row, prop)

isContainer(row)

Returns - Boolean


isContainerEmpty(index)

Returns - Boolean


isContainerOpen(index)

Returns - Boolean


isEditable(row, column)

Returns - Boolean


isSeparator(index)

Returns - Boolean


isSorted()

Returns - Boolean


performAction(action)

QueryInterface(iid)

Returns - this


reSort()

selectionChanged()

setCellValue(row, column, value)

setSortDirection(column, newSortDirection)

setTree(out)

setTreeRows(rows, doReSort)

sortAscending(column)

sortByColumn(col, sortDirection)
Arguments

sortDirection - xtk.dataTreeView.SORT_ASCENDING

col - colElem


sortDescending(column)


class ForwardingController

CONSTRUCTOR: Controller that forwards everything to sub-controllers

Constructor

ForwardingController(aController)
Arguments

aController - {XULElement

or nsIControllers or nsIController} A controller to forward to; this may be a nsIController, or a nsIControllers (in which case the best controller is used), or a XUL element (in which case its controllers are used)


Class variables

_controller - aController


aliases_textEntry - Object

Default set of aliases useful for normal text boxes; these are useful on <textbox>s so that we actually do the expected things instead of editing in some related <scintilla> widget. The keys are the Komodo command names, and the values are the Mozilla ones.


commandAliases - Object


wrappedJSObject - this


Class functions

_getControllerForCommand(aCommand)

Returns - controller


doCommand(aCommand)

isCommandEnabled(aCommand)

onEvent(aEventName)

supportsCommand(aCommand)


class hierarchicalTreeView

A hierarchical tree implementation (where each row may contain child nodes). Each tree row must be an object that has the following properties: attribute isContainer {bool} - whether it can have child nodes attribute hasChildren {bool} - whether the container is empty or not method getChildren() {array} - retrieve the child row nodes (children must be objects that meet the same tree requirements) attribute state {int} - tree flags, such as whether opened/closed (managed by the tree), should be 0 by default attribute level {int} - the depth of the row (managed by the tree), should be 0 by default Custom treeview for showing hierachical tree data.

Constructor

hierarchicalTreeView(initial_rows)

Class variables

_rows - new_rows


_sortFunction


_sortPropertyName


contructor


STATE_CLOSED - Number


STATE_OPENED - Number


Class functions

_expand_and_sort_child_rows(rowItem, sortPropertyName, sortFunction, sortDir)

Returns - rows


_sort_rows_of_same_depth(children, sortPropertyName, sortFunction, sortDir)

Sort sibling rows. This should be overridden by implementations that wish to implement useful sorting.

Arguments

sortFunction - Function

The function callback for sorting

sortPropertyName - String

The name of the property to sort by

sortDir - Number

The directory to sort in; may be either xtk.dataTreeView.SORT_DESCENDING or xtk.dataTreeView.SORT_ASCENDING

Returns - Array of rows


getLevel(row)

Returns - this.rows[row].level


getParentIndex(row)

Returns - row


hasNextSibling(row, afterIndex)
Arguments

row - afterIndex

Returns - Boolean


isContainer(row)

Returns - this.rows[row].isContainer


isContainerEmpty(row)

isContainerOpen(row)

Returns - this.rows[row].state


toggleOpenState(row)


xtk.clipboard

Useful clipboard functions.

Functions

_getSupportsCString(flavor)

Returns - supportCString


addTextDataFlavor(flavor, text, transferable)

Add a text flavor (eg html or plain text) to a transferable object, if passed transferable is null or not defined a new one is created. Returns the tranferable object.

Arguments

text - String

The text to add.

flavor - String

The mime-type flavor (eg "text/html").

transferable - Components.interfaces.nsITransferable

(Optional) The tranferable to use, if null a new object is created.

Returns - Components.interfaces.nsITransferable


containsFlavors(flavors)

Check if clipboard contains at least one of passed formats (ie flavor). Returns true if clipboard contains one of passed flavor, false otherwise.

Arguments

flavors - Array

Mime-type strings (eg ["text/html", "text/unicode"])

Returns - Boolean


containsHtml()

Check if clipboard contains text in HTML format. Returns true if clipboard contains HTML text, false otherwise.

Returns - Boolean


copyFromTransferable(transferable)

Copy to clipboard using a tranferable object, this allows to copy text in multiple format for example the same text as HTML and plain text.

Arguments

transferable - Components.interfaces.nsITransferable

The tranferable object


createTransferable()

Create a transferable object useful to copy multiple formats to clipboard and return with it.

Returns - Components.interfaces.nsITransferable


emptyClipboard()

getHtml()

Get HTML source code from clipboard.

Returns - String


getText()

Get plain text from clipboard.

Returns - String


getTextFlavor(textFlavor)

Returns - String


setText(text)

Set the clipboard to contain the plain text provided.

Arguments

text - String

The text to copy to clipboard.


xtk.color

Variables

black - this.RGB()


blue - this.RGB()


brightness - Number


gamma - Number


green - this.RGB()


red - this.RGB()


topScale - Number


white - this.RGB()


yellow - this.RGB()


Functions

hexToLong(hexstring)

hexToLong Converts a color of the form #ffaabb to a long

Arguments

hexstring - String

Returns - Number


isDark(hexstring)

Return whether this is a dark color.

Arguments

hexstring - String

- Hexadecimal string of the color.

Returns - Boolean


isLight(hexstring)

Return whether this is a light color.

Arguments

hexstring - String

- Hexadecimal string of the color.

Returns - Boolean


RGB(r, g, b)

RGB covert rgb value into a long int

Returns - Number


Classes

class scaler

Constructor

scaler()

Class functions

Adjust(color, factor)

Returns - Math.floor()


NanometerToRGB(nanoMetres)

Returns - r


scaleToRGB(w)

Returns - this.NanometerToRGB()



xtk.domutils

Variables

__END__


Functions

elementInFocus(el)

is this element or an ancestor focused?

Returns - Boolean


fireDataEvent(target, eventName, data)

Send out a window data event with the given event name and data settings. Listeners will need to use event.getData(key) to retrieve the data values. More on DataContainerEvent's here: http://mxr.mozilla.org/mozilla2.0/source/dom/interfaces/events/nsIDOMDataContainerEvent.idl

Arguments

eventName - String

- The name for the event.

data - Object

- (Optional) Additional data object.

target - DOMElement

- The originating target.


fireEvent(target, eventName)

Send out a window event with the given event name.

Arguments

eventName - String

- The name for the event.

target - DOMElement

- The originating target.


getFocusedAncestorByName(localName)

is the focused element, or it's ancestor a element with a matching localName?

Arguments

localName - String

Returns - Element


newElement(name, attributes)

Helper method to easily create a new DOM element with a bunch of (optional) attributes set. names to values.

Arguments

attributes - Object

- (Optional) A map object containing attributes

name - String

- The element name to create.

Returns - DOMNode


xtk.domutils.tooltips

Functions

getHandler(tooltipName)

Returns - _handlers[tooltipName]


xtk.logging

Variables

LOG_CRITICAL - Number


LOG_DEBUG - Number


LOG_ERROR - Number


LOG_INFO - Number


LOG_NOTSET - Number


LOG_WARN - Number


name - name


Functions

getLogger(name)

Returns - _logs[name]


getObjectTree(o, recurse, compress, level)
Arguments

level - Number

recurse - Number

compress - Boolean

Returns - s


Classes

class Logger

Constructor

Logger(name)

Class variables

lastErrorMsg - str


level - Number


Class functions

debug(str)

doDump(level)

error(str)

exception(e, str)
Arguments

str - xtk.logging.getObjectTree()


info(str)

setLevel(level)

warn(str)