Package org.freeplane.api
Interface Link
- All Superinterfaces:
LinkRO
- All Known Subinterfaces:
Proxy.Link
public interface Link extends LinkRO
Node's link:
node.link - read-write.
To set links use the attributes of the Link and LinkRO object:
// a normal href
node.link.text = 'http://www.google.com'
// create a link to the parent node
node.link.node = node.parent
// if you have a URI object
node.link.uri = new URI('http://www.google.com')
// file
node.link.file = map.file
-
Method Summary
Modifier and Type Method Description booleanremove()removes the link.booleanset(java.lang.String target)Deprecated.voidsetFile(java.io.File file)sets target to file.voidsetNode(Node node)target is a node of the same map.voidsetText(java.lang.String target)target is a stringified URI.voidsetUri(java.net.URI uri)sets target to uri.
-
Method Details
-
setText
void setText(java.lang.String target)target is a stringified URI. Removes any link if uri is null. To get a local link (i.e. to another node) target should be: "#" + nodeId or better use setNode(Node).- Throws:
java.lang.IllegalArgumentException- if target is not convertible into aURI.- Since:
- 1.2
-
setUri
void setUri(java.net.URI uri)sets target to uri. Removes any link if uri is null.- Since:
- 1.2
-
setFile
void setFile(java.io.File file)sets target to file. Removes any link if file is null.- Since:
- 1.2
-
setNode
target is a node of the same map. Shortcut for setTarget("#" + node.nodeId) Removes any link if node is null.- Throws:
java.lang.IllegalArgumentException- if node belongs to another map.- Since:
- 1.2
-
set
@Deprecated boolean set(java.lang.String target)Deprecated.since 1.2 - usesetText(String)instead.- Returns:
- true if target could be converted to an URI and false otherwise.
-
remove
boolean remove()removes the link. Same asnode.link.text = null.- Returns:
trueif there was a link to remove.- Since:
- 1.4
-
setText(String)instead.