Skip to main content

UnsupportedHyperlinkAction Class

A hyperlink action that the API does not support.

Declaration

public class UnsupportedHyperlinkAction extends OfficeHyperlinkAction

Remarks

When the API loads a hyperlink with an action that the API does not recognize (for example, a macro run or a jump to a custom show), the API creates an UnsupportedHyperlinkAction object. The API saves the original action back to the document.

The API also creates an UnsupportedHyperlinkAction object for a hyperlink that moves to a slide that the presentation does not contain.

Example

The following code snippet loads a presentation and displays the action of each shape hyperlink on the first slide:

import java.io.*;
import java.nio.file.*;
import com.devexpress.docs.office.*;
import com.devexpress.docs.presentation.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (InputStream stream = Files.newInputStream(Path.of("Document.pptx"));
             Presentation presentation = new Presentation(stream)) {
            for (ShapeBase shape : presentation.getSlides().getFirst().getShapes()) {
                OfficeHyperlink hyperlink = shape.getHyperlink();
                if (hyperlink == null)
                    continue;
                String action = switch (hyperlink.getAction()) {
                    case UriHyperlinkAction uriAction -> "opens " + uriAction.getUri();
                    case SlideHyperlinkAction slideAction ->
                        "moves to slide " + (presentation.getSlides().indexOf(slideAction.getTargetSlide()) + 1);
                    case SlideShowHyperlinkAction showAction -> "performs the " + showAction.getJump() + " action";
                    default -> "performs an action that the API does not support";
                };
                System.out.println(shape.getName() + ": " + action);
            }
        }
    }
}

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
OfficeHyperlinkAction
UnsupportedHyperlinkAction
See Also

Methods

equals(Object obj) Method

Returns whether the specified object is equal to the current UnsupportedHyperlinkAction object.

Declaration

public boolean equals(Object obj)

Parameters

Name Type Description
obj Object

The object to compare with the current object.

Returns

Type Description
boolean

true if the specified object is equal to the current object; otherwise, false.

Remarks

Two UnsupportedHyperlinkAction objects are equal if they have the same action string, target, target mode, and target frame.

getRawAction() Method

Returns the hyperlink action string that the source document specifies.

Declaration

public String getRawAction()

Returns

Type Description
String

The action string, or null if the hyperlink has no action string.

getRawTarget() Method

Returns the hyperlink target that the source document specifies.

Declaration

public String getRawTarget()

Returns

Type Description
String

The hyperlink target, or null if the hyperlink has no target.

hashCode() Method

Returns a hash code for this UnsupportedHyperlinkAction object.

Declaration

public int hashCode()

Returns

Type Description
int

The hash code.