public class FieldHyperlink extends Field
To learn more, visit the Working with Fields documentation article.
Remarks:
When selected, causes control to jump to the location such as a bookmark or a URL.
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAddress()
Gets a location where this hyperlink jumps.
|
boolean |
getOpenInNewWindow()
Gets whether to open the destination site in a new web browser window.
|
java.lang.String |
getScreenTip()
Gets the ScreenTip text for the hyperlink.
|
Inline |
getSourceNode() |
java.lang.String |
getSubAddress()
Gets a location in the file, such as a bookmark, where this hyperlink jumps.
|
int |
getSwitchType(java.lang.String switchName) |
java.lang.String |
getTarget()
Gets the target to which the link should be redirected.
|
boolean |
isImageMap()
Gets whether to append coordinates to the hyperlink for a server-side image map.
|
void |
isImageMap(boolean value)
Sets whether to append coordinates to the hyperlink for a server-side image map.
|
protected boolean |
needStoreOldResultNodes() |
void |
setAddress(java.lang.String value)
Sets a location where this hyperlink jumps.
|
void |
setOpenInNewWindow(boolean value)
Sets whether to open the destination site in a new web browser window.
|
void |
setScreenTip(java.lang.String value)
Sets the ScreenTip text for the hyperlink.
|
void |
setSubAddress(java.lang.String value)
Sets a location in the file, such as a bookmark, where this hyperlink jumps.
|
void |
setTarget(java.lang.String value)
Sets the target to which the link should be redirected.
|
getDisplayResult, getEnd, getFieldCode, getFieldCode, getFormat, getLocaleId, getResult, getSeparator, getStart, getType, isDirty, isDirty, isLocked, isLocked, remove, setLocaleId, setResult, unlink, update, updateprotected boolean needStoreOldResultNodes()
needStoreOldResultNodes in class Fieldpublic java.lang.String getTarget()
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
public void setTarget(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
value - The target to which the link should be redirected.java.lang.Exceptionpublic java.lang.String getAddress()
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
public void setAddress(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
value - A location where this hyperlink jumps.java.lang.Exceptionpublic java.lang.String getSubAddress()
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
public void setSubAddress(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
value - A location in the file, such as a bookmark, where this hyperlink jumps.java.lang.Exceptionpublic boolean isImageMap()
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
public void isImageMap(boolean value)
throws java.lang.Exception
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
value - Whether to append coordinates to the hyperlink for a server-side image map.java.lang.Exceptionpublic boolean getOpenInNewWindow()
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
public void setOpenInNewWindow(boolean value)
throws java.lang.Exception
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
value - Whether to open the destination site in a new web browser window.java.lang.Exceptionpublic java.lang.String getScreenTip()
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
public void setScreenTip(java.lang.String value)
throws java.lang.Exception
Examples:
Shows how to use HYPERLINK fields to link to documents in the local file system.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
FieldHyperlink field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document and then place the cursor at the specified bookmark.
field.setAddress(getMyDir() + "Bookmarks.docx");
field.setSubAddress("MyBookmark3");
field.setScreenTip("Open " + field.getAddress() + " on bookmark " + field.getSubAddress() + " in a new window");
builder.writeln();
// When we click this HYPERLINK field in Microsoft Word,
// it will open the linked document, and automatically scroll down to the specified iframe.
field = (FieldHyperlink) builder.insertField(FieldType.FIELD_HYPERLINK, true);
field.setAddress(getMyDir() + "Iframes.html");
field.setScreenTip("Open " + field.getAddress());
field.setTarget("iframe_3");
field.setOpenInNewWindow(true);
field.isImageMap(false);
doc.updateFields();
doc.save(getArtifactsDir() + "Field.HYPERLINK.docx");
value - The ScreenTip text for the hyperlink.java.lang.Exceptionpublic int getSwitchType(java.lang.String switchName)
public Inline getSourceNode()