Class Index | File Index

Classes


Class orion.util

This class contains static utility methods.
Defined in: </shared/eclipse/e4/orion/I201107200200/plugins/org.eclipse.orion.client.core/web/orion/util.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
This class contains static utility methods.
Method Summary
Method Attributes Method Name and Description
 
followLink(href)
Opens a link in response to some event.
 
getText(node)
Returns the text contained by a DOM node.
 
hashFromPosition(filePath, start, end, line, offset, length)
Construct a URL hash that represents the given file path at the given position, with the specified selection range.
 
Determines if the path represents the workspace root
 
Opens a dialog near the given DOM node
 
Returns whether the given event should cause a reference to open in a new window or not.
 
safeText(string)
Escapes HTML in string.
 
setUsername(username)
Sets the current user name
Class Detail
orion.util()
This class contains static utility methods. It is not intended to be instantiated.
Method Detail
followLink(href)
Opens a link in response to some event. Whether the link is opened in the same window or a new window depends on the event
Parameters:
{String} href
The link location

{String} getText(node)
Returns the text contained by a DOM node.
Parameters:
{DomNode} node
Returns:
{String} The text contained by node. Note that treatment of whitespace and child nodes is not consistent across browsers.

hashFromPosition(filePath, start, end, line, offset, length)
Construct a URL hash that represents the given file path at the given position, with the specified selection range.
Parameters:
{String} filePath
path of the file on the server
{Number} start
starting position within the content of the file
{Number} end
ending position of selection within the content of the file
{Number} line
line number within the content of the file, used only when no start is specified
{Number} offset
offset within the line number, used only when line is specified
{Number} length
length of the selection, used to compute the ending point from a start or line offset

isAtRoot()
Determines if the path represents the workspace root

openDialog()
Opens a dialog near the given DOM node

openInNewWindow(event)
Returns whether the given event should cause a reference to open in a new window or not.
Parameters:
{Object} event
The key event

{String} safeText(string)
Escapes HTML in string. Use this to sanitize user input that is destined for innerHTML.
Parameters:
{String} string
Returns:
{String} The string with HTML safely escaped.

setUsername(username)
Sets the current user name
Parameters:
{String} username
The user name

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jul 20 2011 02:04:44 GMT-0400 (EDT)