本文整理汇总了Java中java.awt.Desktop.Action.BROWSE属性的典型用法代码示例。如果您正苦于以下问题:Java Action.BROWSE属性的具体用法?Java Action.BROWSE怎么用?Java Action.BROWSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.Desktop.Action
的用法示例。
在下文中一共展示了Action.BROWSE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createURIVisitor
/**
* @return
*/
private URIVisitor createURIVisitor() {
return getDesktopAction() == Action.BROWSE ?
new BrowseVisitor() : new MailVisitor();
}
示例2: createHyperlinkAction
/**
* Factory method to create and return a HyperlinkAction for the given uri. Tries
* to guess the appropriate type from the uri. If uri is not null and has a
* scheme of mailto, create one of type Mail. In all other cases, creates one
* for BROWSE.
*
* @param uri to uri to create a HyperlinkAction for, maybe null.
* @return a HyperlinkAction for the given URI.
* @throws HeadlessException if {@link
* GraphicsEnvironment#isHeadless()} returns {@code true}
* @throws UnsupportedOperationException if the current platform doesn't support
* Desktop
*/
public static HyperlinkAction createHyperlinkAction(URI uri) {
Action type = isMailURI(uri) ? Action.MAIL : Action.BROWSE;
return createHyperlinkAction(uri, type);
}
示例3: HyperlinkAction
/**
* Instantiates a HyperlinkAction with action type BROWSE.
*
* @throws HeadlessException if {@link
* GraphicsEnvironment#isHeadless()} returns {@code true}
* @throws UnsupportedOperationException if the current platform doesn't support
* Desktop
* @throws IllegalArgumentException if unsupported action type
*/
public HyperlinkAction() {
this(Action.BROWSE);
}