/** * * @param uri the target uri, maybe null. * @param desktopAction the type of desktop action this class should perform, must be * BROWSE or MAIL * @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(URI uri, Action desktopAction) { super(); if (!Desktop.isDesktopSupported()) { throw new UnsupportedOperationException("Desktop API is not " + "supported on the current platform"); } if (desktopAction != Desktop.Action.BROWSE && desktopAction != Desktop.Action.MAIL) { throw new IllegalArgumentException("Illegal action type: " + desktopAction + ". Must be BROWSE or MAIL"); } this.desktopAction = desktopAction; getURIVisitor(); setTarget(uri); }
/** * * @param uri the target uri, maybe null. * @param desktopAction the type of desktop action this class should perform, must be * BROWSE or MAIL * @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(URI uri, Action desktopAction) { super(); if (!Desktop.isDesktopSupported()) { throw new UnsupportedOperationException("Desktop API is not " + "supported on the current platform"); } if (desktopAction != Desktop.Action.BROWSE && desktopAction != Desktop.Action.MAIL) { throw new IllegalArgumentException("Illegal action type: " + desktopAction + ". Must be BROWSE or MAIL"); } this.desktopAction = desktopAction; getURIVisitor(); setTarget(uri); }
/** * * @param uri the target uri, maybe null. * @param desktopAction the type of desktop action this class should perform, must be * BROWSE or MAIL * @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(URI uri, Action desktopAction) { super(); if (!Desktop.isDesktopSupported()) { throw new UnsupportedOperationException("Desktop API is not " + "supported on the current platform"); } if (desktopAction != Desktop.Action.BROWSE && desktopAction != Desktop.Action.MAIL) { throw new IllegalArgumentException("Illegal action type: " + desktopAction + ". Must be BROWSE or MAIL"); } this.desktopAction = desktopAction; getURIVisitor(); setTarget(uri); }
/** * * @param uri the target uri, maybe null. * @param desktopAction the type of desktop action this class should perform, must be * BROWSE or MAIL * @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(URI uri, Action desktopAction) { super(); if (!Desktop.isDesktopSupported()) { throw new UnsupportedOperationException("Desktop API is not " + "supported on the current platform"); } if (desktopAction != Desktop.Action.BROWSE && desktopAction != Desktop.Action.MAIL) { throw new IllegalArgumentException("Illegal action type: " + desktopAction + ". Must be BROWSE or MAIL"); } this.desktopAction = desktopAction; getURIVisitor(); setTarget(uri); }
/** * */ private void updateEnabled() { setEnabled(getURIVisitor().isEnabled(getTarget())); }
/** * */ private void updateEnabled() { setEnabled(getURIVisitor().isEnabled(getTarget())); }
/** * */ private void updateEnabled() { setEnabled(getURIVisitor().isEnabled(getTarget())); }
/** * */ private void updateEnabled() { setEnabled(getURIVisitor().isEnabled(getTarget())); }
/** * {@inheritDoc} <p> * * Implemented to perform the appropriate Desktop action if supported on the current * target. Sets the visited property to true if the desktop action doesn't throw * an exception or to false if it did. * * Does nothing if the action isn't supported. */ @Override public void actionPerformed(ActionEvent e) { if (!getURIVisitor().isEnabled(getTarget())) return; try { getURIVisitor().visit(getTarget()); setVisited(true); } catch (IOException e1) { setVisited(false); LOG.fine("cant visit Desktop " + e); } }
/** * {@inheritDoc} <p> * * Implemented to perform the appropriate Desktop action if supported on the current * target. Sets the visited property to true if the desktop action doesn't throw * an exception or to false if it did. * * Does nothing if the action isn't supported. */ @Override public void actionPerformed(ActionEvent e) { if (!getURIVisitor().isEnabled(getTarget())) return; try { getURIVisitor().visit(getTarget()); setVisited(true); } catch (IOException e1) { setVisited(false); LOG.fine("cant visit Desktop " + e); } }
/** * {@inheritDoc} <p> * * Implemented to perform the appropriate Desktop action if supported on the current * target. Sets the visited property to true if the desktop action doesn't throw * an exception or to false if it did. * * Does nothing if the action isn't supported. */ @Override public void actionPerformed(ActionEvent e) { if (!getURIVisitor().isEnabled(getTarget())) return; try { getURIVisitor().visit(getTarget()); setVisited(true); } catch (IOException e1) { setVisited(false); LOG.fine("cant visit Desktop " + e); } }
/** * {@inheritDoc} <p> * * Implemented to perform the appropriate Desktop action if supported on the current * target. Sets the visited property to true if the desktop action doesn't throw * an exception or to false if it did. * * Does nothing if the action isn't supported. */ @Override public void actionPerformed(ActionEvent e) { if (!getURIVisitor().isEnabled(getTarget())) return; try { getURIVisitor().visit(getTarget()); setVisited(true); } catch (IOException e1) { setVisited(false); LOG.fine("cant visit Desktop " + e); } }