本文整理匯總了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);
}