HyperlinkManager
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.slides.IHyperlinkManager, com.aspose.slides.IDOMObject
public final class HyperlinkManager implements IHyperlinkManager, IDOMObject
Provide hyperlinks management (adding, removing).
Methods
Method | Description |
---|---|
setExternalHyperlinkClick(String url) | Set external hyperlink on click. |
setInternalHyperlinkClick(ISlide targetSlide) | Sets internal hyperlink on click. |
removeHyperlinkClick() | Removes hyperlink on click. |
setExternalHyperlinkMouseOver(String url) | Sets external hyperlink mouse over. |
setInternalHyperlinkMouseOver(ISlide targetSlide) | Sets internal hyperlink mouse over. |
removeHyperlinkMouseOver() | Removes hyperlink mouse over. |
setMacroHyperlinkClick(String macroName) | Set Macro hyperlink on a click. |
getParent_Immediate() |
setExternalHyperlinkClick(String url)
public final IHyperlink setExternalHyperlinkClick(String url)
Set external hyperlink on click.
The following sample code shows how to add Text Box with Hyperlink. // Instantiates a Presentation class that represents a PPTX Presentation pres = new Presentation(); try { // Gets the first slide in the presentation ISlide slide = pres.getSlides().get_Item(0); // Adds an AutoShape object with type set as Rectangle IShape pptxShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 150, 150, 150, 50); // Casts the shape to AutoShape IAutoShape pptxAutoShape = (IAutoShape) pptxShape; // Accesses the ITextFrame property associated with the AutoShape pptxAutoShape.addTextFrame(""); ITextFrame textFrame = pptxAutoShape.getTextFrame(); IPortion portion = textFrame.getParagraphs().get_Item(0).getPortions().get_Item(0); // Adds some text to the frame portion.setText("Aspose.Slides"); // Sets the Hyperlink for the portion text IHyperlinkManager hypMan = portion.getPortionFormat().getHyperlinkManager(); hypMan.setExternalHyperlinkClick("http://www.aspose.com"); // Saves the PPTX Presentation pres.save("hLinkPPTX_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
url | java.lang.String | Hyperlink URL. |
Returns: IHyperlink
setInternalHyperlinkClick(ISlide targetSlide)
public final IHyperlink setInternalHyperlinkClick(ISlide targetSlide)
Sets internal hyperlink on click.
Parameters:
Parameter | Type | Description |
---|---|---|
targetSlide | ISlide | Target slide. |
Returns: IHyperlink - Hyperlink.
removeHyperlinkClick()
public final void removeHyperlinkClick()
Removes hyperlink on click.
setExternalHyperlinkMouseOver(String url)
public final IHyperlink setExternalHyperlinkMouseOver(String url)
Sets external hyperlink mouse over.
Parameters:
Parameter | Type | Description |
---|---|---|
url | java.lang.String | Hyperlink URL. |
Returns: IHyperlink - Hyperlink.
setInternalHyperlinkMouseOver(ISlide targetSlide)
public final IHyperlink setInternalHyperlinkMouseOver(ISlide targetSlide)
Sets internal hyperlink mouse over.
Parameters:
Parameter | Type | Description |
---|---|---|
targetSlide | ISlide | Target slide. |
Returns: IHyperlink - Hyperlink.
removeHyperlinkMouseOver()
public final void removeHyperlinkMouseOver()
Removes hyperlink mouse over.
setMacroHyperlinkClick(String macroName)
public final IHyperlink setMacroHyperlinkClick(String macroName)
Set Macro hyperlink on a click.
Presentation pres = new Presentation(); try { IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.BlankButton, 20, 20, 80, 30); shape.getHyperlinkManager().setMacroHyperlinkClick("MacroName"); } finally { if (pres != null) pres.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
macroName | java.lang.String | Name of the macro |
Returns: IHyperlink - Hyperlink object IHyperlink
getParent_Immediate()
public final IDOMObject getParent_Immediate()
Returns Parent_Immediate object. Read-only IDOMObject.
Returns: com.aspose.slides.IDOMObject