Package javax.swing.event

Examples of javax.swing.event.HyperlinkEvent


  if (!editor.isEditable()) {
      Point pt = new Point(e.getX(), e.getY());
      URLSelection newSelection = getIndicatedURL(pt, editor);
      if (newSelection != currentSelection) {
    if (currentSelection != null) {
        editor.fireHyperlinkUpdate(new HyperlinkEvent(currentSelection, HyperlinkEvent.EventType.EXITED, currentSelection.url));
    }
   
    if (newSelection != null) {
        editor.fireHyperlinkUpdate(new HyperlinkEvent(newSelection, HyperlinkEvent.EventType.ENTERED, newSelection.url));
    }
    currentSelection = newSelection;
      }
  }
    }
View Full Code Here


  JEditorPane editor = (JEditorPane) e.getSource();
  if (!editor.isEditable()) {
      Point pt = new Point(e.getX(), e.getY());
      URLSelection selection = getIndicatedURL(pt, editor);
      if (selection != null) {
    editor.fireHyperlinkUpdate(new HyperlinkEvent(selection, HyperlinkEvent.EventType.ACTIVATED, selection.url));
      }
  }
    }
View Full Code Here

        assertEquals("javax.swing.JEditorPane$PlainEditorKit", kit1.getClass().getName());
        assertNotSame(kit1, kit2);
    }

    private HyperlinkEvent getHyperlinkEvent(final HyperlinkEvent.EventType type) {
        return new HyperlinkEvent(jep, type, TEST_URL);
    }
View Full Code Here

        SimpleHyperlinkListener listener2 = new SimpleHyperlinkListener("2");
        SimpleHyperlinkListener listener3 = new SimpleHyperlinkListener("3");
        jep.addHyperlinkListener(listener1);
        jep.addHyperlinkListener(listener2);
        jep.addHyperlinkListener(listener3);
        HyperlinkEvent event = getHyperlinkEvent(HyperlinkEvent.EventType.ACTIVATED);
        jep.fireHyperlinkUpdate(event);
        assertEquals("321", fireOrder);
        assertEquals(event, listener1.event);
        assertEquals(event, listener2.event);
        assertEquals(event, listener3.event);
View Full Code Here

                                           final HyperlinkEvent.EventType eventID,
                                           final Element elem) {
        String urlString = getURLString(elem);

        URL base = ((HTMLDocument)pane.getDocument()).getBase();
        HyperlinkEvent event = new HyperlinkEvent(pane, eventID,
                                                  HTML.resolveURL(urlString,
                                                                  base),
                                                  urlString, elem);
        pane.fireHyperlinkUpdate(event);
    }
View Full Code Here

          }
          url = new URL(temp);
        } catch (MalformedURLException mue) {
          desc = mue.getMessage();
        }
        HyperlinkEvent he = new HyperlinkEvent(this,
            HyperlinkEvent.EventType.ACTIVATED,
            url, desc);
        fireHyperlinkUpdate(he);
      }
    }
View Full Code Here

    private class HyperlinkEnterExitBugFixer extends MouseAdapter implements HyperlinkListener {
        private boolean hyperlinkActive;

        public void mouseExited(MouseEvent e) {
            if (hyperlinkActive) {
                fireHyperlinkUpdate(new HyperlinkEvent(HtmlPane.this, HyperlinkEvent.EventType.EXITED, null));
                hyperlinkActive = true;
            }
        }
View Full Code Here

            }
        }

        public void mouseEntered(MouseEvent e) {
            if (hyperlinkActive) {
                fireHyperlinkUpdate(new HyperlinkEvent(HtmlPane.this, HyperlinkEvent.EventType.ENTERED, null));
            }
        }
View Full Code Here

      scrollPane.setPreferredSize(new Dimension(700, 800));
      manFrame.setContentPane(scrollPane);
      manFrame.pack();
      manFrame.setVisible(true);
      URL cvdLinkUrl = new URL(manURL.toString() + "#ugr.tools.cvd");
      HyperlinkEvent e = new HyperlinkEvent(editorPane, HyperlinkEvent.EventType.ACTIVATED,
          cvdLinkUrl);
      editorPane.fireHyperlinkUpdate(e);
    } catch (Exception e) {
      this.main.handleException(e);
    }
View Full Code Here

        assertEquals("javax.swing.JEditorPane$PlainEditorKit", kit1.getClass().getName());
        assertNotSame(kit1, kit2);
    }

    private HyperlinkEvent getHyperlinkEvent(final HyperlinkEvent.EventType type) {
        return new HyperlinkEvent(jep, type, TEST_URL);
    }
View Full Code Here

TOP

Related Classes of javax.swing.event.HyperlinkEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.