swingx
  1. swingx
  2. SWINGX-1530

HyperlinkAction: check if Desktop.browse blocks

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Misc Component
    • Labels:
      None

      Description

      If Desktop.browse (and mail) blocks for any perceptible time, it should not happen on the EDT. In that case need to connect asynchronously, probably via a worker (because we need some means of success/failure feedback)

        Activity

        Hide
        Karl Schaefer added a comment -

        That API does not have return values. Are you referring to possible exceptions that may be thrown? If so, I don't think we care about those in the places we are currently using Desktop.

        Show
        Karl Schaefer added a comment - That API does not have return values. Are you referring to possible exceptions that may be thrown? If so, I don't think we care about those in the places we are currently using Desktop.
        Hide
        kleopatra added a comment -

        Hi Karl,

        True that the Desktop.action itself has no return value, it's the HyperlinkAction waiting for it to return (or throw an exception) so that it can update its visited property:

            // in hyperlinkAction.actionPerformed
            try {
                // this basically delegates to Desktop 
                getURIVisitor().visit(getTarget());
                setVisited(true);
            } catch (IOException e1) {
                setVisited(false);
                LOG.fine("cant visit Desktop " + e);
            }
        
        

        if that delegating call blocks (should write a quick test .. sigh), it probably should be done in a worker, IMO

        thanks for chiming in
        Jeanette

        Show
        kleopatra added a comment - Hi Karl, True that the Desktop.action itself has no return value, it's the HyperlinkAction waiting for it to return (or throw an exception) so that it can update its visited property: // in hyperlinkAction.actionPerformed try { // this basically delegates to Desktop getURIVisitor().visit(getTarget()); setVisited( true ); } catch (IOException e1) { setVisited( false ); LOG.fine( "cant visit Desktop " + e); } if that delegating call blocks (should write a quick test .. sigh), it probably should be done in a worker, IMO thanks for chiming in Jeanette
        Hide
        kleopatra added a comment -

        okay, added a quick visual test: appears to return as soon as the browser is contacted.

        Its concrete behaviour (how/if the 'contact' is spawned on a separate thread) isn't documented, but might be safe to assume that it's a fail-fast procedure: either find a suitable application, pass-over the arguments and return or not find it and throw an error.

        Jeanette

        Show
        kleopatra added a comment - okay, added a quick visual test: appears to return as soon as the browser is contacted. Its concrete behaviour (how/if the 'contact' is spawned on a separate thread) isn't documented, but might be safe to assume that it's a fail-fast procedure: either find a suitable application, pass-over the arguments and return or not find it and throw an error. Jeanette
        Hide
        kleopatra added a comment -

        the SO thread which triggered this issue:
        http://stackoverflow.com/a/8387251/203657

        and comment by @Stefan as to when/why it might block:

        It seems you couldn't reproduce the blocking behaviour of Desktop.browse - on my slow machine it does block for sure, most notably if the browser is not open yet

        Show
        kleopatra added a comment - the SO thread which triggered this issue: http://stackoverflow.com/a/8387251/203657 and comment by @Stefan as to when/why it might block: It seems you couldn't reproduce the blocking behaviour of Desktop.browse - on my slow machine it does block for sure, most notably if the browser is not open yet

          People

          • Assignee:
            kleopatra
            Reporter:
            kleopatra
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: