当前位置: 首页>>代码示例>>Java>>正文


Java HTMLFrameHyperlinkEvent类代码示例

本文整理汇总了Java中javax.swing.text.html.HTMLFrameHyperlinkEvent的典型用法代码示例。如果您正苦于以下问题:Java HTMLFrameHyperlinkEvent类的具体用法?Java HTMLFrameHyperlinkEvent怎么用?Java HTMLFrameHyperlinkEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HTMLFrameHyperlinkEvent类属于javax.swing.text.html包,在下文中一共展示了HTMLFrameHyperlinkEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
@Override
public void hyperlinkUpdate(final HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        final JEditorPane pane = (JEditorPane) e.getSource();
        if (e instanceof HTMLFrameHyperlinkEvent) {
            final HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
            final HTMLDocument doc = (HTMLDocument) pane.getDocument();
            doc.processHTMLFrameHyperlinkEvent(evt);
        } else {
            try {
                pane.setPage(e.getURL());
            } catch (final Throwable t) {
                MessageBox.showError(HtmlViewer.this.getParent(), t.getMessage());
            }
        }
    }
}
 
开发者ID:chadbeaudin,项目名称:DataRecorder,代码行数:18,代码来源:HtmlViewer.java

示例2: createHyperLinkListener

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
/**
 *
 */
public HyperlinkListener createHyperLinkListener() {
    return e -> {
        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
            if (e instanceof HTMLFrameHyperlinkEvent) {
                ((HTMLDocument) htmlEditorPane.getDocument()).processHTMLFrameHyperlinkEvent(
                        (HTMLFrameHyperlinkEvent) e);
            } else {
                try {
                    htmlEditorPane.setPage(e.getURL());
                } catch (IOException ioe) {
                    System.out.println("IOE: " + ioe);
                }
            }
        }
    };
}
 
开发者ID:openea,项目名称:eva2,代码行数:20,代码来源:HtmlDemo.java

示例3: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent e) {
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {

    JEditorPane pane = (JEditorPane)e.getSource();
    if (e instanceof HTMLFrameHyperlinkEvent) {
      HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
      HTMLDocument doc = (HTMLDocument)pane.getDocument();
      doc.processHTMLFrameHyperlinkEvent(evt);
    } else {
      try {
        URL nurl = e.getURL();
        if (nurl == null) nurl = new URL(m_baseurl, e.getDescription());
        if (jsmooth.Native.isAvailable()) {
          jsmooth.Native.shellExecute(jsmooth.Native.SHELLEXECUTE_OPEN, nurl.toString(), null, null, jsmooth.Native.SW_NORMAL);
        } else
          m_launcher.openURLinBrowser(nurl.toExternalForm());
      } catch (Throwable t) {
        t.printStackTrace();
      }
    }
  }
}
 
开发者ID:BisonSchweizAG,项目名称:JSmooth,代码行数:23,代码来源:HTMLPane.java

示例4: createHyperLinkListener

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
private HyperlinkListener createHyperLinkListener() {
    return new HyperlinkListener() {
        public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                if (e instanceof HTMLFrameHyperlinkEvent) {
                    ((HTMLDocument) html.getDocument()).processHTMLFrameHyperlinkEvent(
                            (HTMLFrameHyperlinkEvent) e);
                } else {
                    try {
                        html.setPage(e.getURL());
                    } catch (IOException ioe) {
                        System.out.println("IOE: " + ioe);
                    }
                }
            }
        }
    };
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:19,代码来源:EditorPaneDemo.java

示例5: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    JEditorPane pane = (JEditorPane)e.getSource();
    if (e instanceof HTMLFrameHyperlinkEvent) {
      HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
      HTMLDocument doc = (HTMLDocument)pane.getDocument();
      doc.processHTMLFrameHyperlinkEvent(evt);
    }
    else {
      URL url = e.getURL();
      if (url != null) {
        BrowserUtil.browse(url);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PluginManagerMain.java

示例6: createHyperLinkListener

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
/**
    * Creates the hyper link listener.
    *
    * @return the hyperlink listener
    */
   public HyperlinkListener createHyperLinkListener() {
return new HyperlinkListener() {
    public void hyperlinkUpdate(HyperlinkEvent e) {
	if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
	    if (e instanceof HTMLFrameHyperlinkEvent) {
		((HTMLDocument)html.getDocument()).processHTMLFrameHyperlinkEvent(
		    (HTMLFrameHyperlinkEvent)e);
	    } else {
		try {
		    html.setPage(e.getURL());
		} catch (IOException ioe) {
		    System.out.println("IOE: " + ioe);
		}
	    }
	}
    }
};
   }
 
开发者ID:JackJiang2011,项目名称:beautyeye,代码行数:24,代码来源:HtmlDemo.java

示例7: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
	JEditorPane pane = (JEditorPane) e.getSource();
	if (e instanceof HTMLFrameHyperlinkEvent) {
	    HTMLFrameHyperlinkEvent  evt = (HTMLFrameHyperlinkEvent) e;
	    HTMLDocument doc = (HTMLDocument) pane.getDocument();
	    doc.processHTMLFrameHyperlinkEvent(evt);
	} else {
	    try {
		// history
		back.push(pane.getPage());
		fwd = new Stack();

		// move
		pane.setPage(e.getURL());
		backButton.setEnabled(true);
		fwdButton.setEnabled(false);
	    } catch (Throwable t) {
		t.printStackTrace();
	    }
	}
    }
}
 
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:25,代码来源:HelpBrowser.java

示例8: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent e) {
	if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
		if (e instanceof HTMLFrameHyperlinkEvent) {
		((HTMLDocument)htmlView.getDocument()).processHTMLFrameHyperlinkEvent(
				(HTMLFrameHyperlinkEvent)e);
		} else {
			try {
				htmlView.setPage(e.getURL());
				this.setTitle("JavaShare Mini-Browser: " +
								e.getURL().toString());
			} catch (IOException ioe) {
				JOptionPane.showMessageDialog(this,
					"An Error has occured while trying to read this page.",
					"Mini-Browser Error", JOptionPane.ERROR_MESSAGE);
				this.dispose();
			}
		}
	}
}
 
开发者ID:bvarner,项目名称:javashare,代码行数:20,代码来源:HttpLinkViewer.java

示例9: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent e) {
	if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
		return;

	JEditorPane pane = (JEditorPane) e.getSource();
	if (e instanceof HTMLFrameHyperlinkEvent) {
		HTMLFrameHyperlinkEvent evt =
			(HTMLFrameHyperlinkEvent) e;
		HTMLDocument doc = (HTMLDocument) help.getDocument();
		doc.processHTMLFrameHyperlinkEvent(evt);
	} else {
		try {
			help.setPage(e.getURL());
		} catch (IOException e2) {
			help.setText("Error loading " + e.getURL());
		}
	}
}
 
开发者ID:notimetoplay,项目名称:voxeldesc,代码行数:19,代码来源:VoxelGUI.java

示例10: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent e) {
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    JEditorPane pane = (JEditorPane)e.getSource();
    if (e instanceof HTMLFrameHyperlinkEvent) {
      HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
      HTMLDocument doc = (HTMLDocument)pane.getDocument();
      doc.processHTMLFrameHyperlinkEvent(evt);
    }
    else {
      URL url = e.getURL();
      if (url != null) {
        BrowserUtil.browse(url);
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:PluginManagerMain.java

示例11: createHyperLinkListener

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public HyperlinkListener createHyperLinkListener() {
return new HyperlinkListener() {
    public void hyperlinkUpdate(HyperlinkEvent e) {
	if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
	    if (e instanceof HTMLFrameHyperlinkEvent) {
		((HTMLDocument)html.getDocument()).processHTMLFrameHyperlinkEvent(
		    (HTMLFrameHyperlinkEvent)e);
	    } else {
		try {
		    html.setPage(e.getURL());
		} catch (IOException ioe) {
		    System.out.println("IOE: " + ioe);
		}
	    }
	}
    }
};
   }
 
开发者ID:bulenkov,项目名称:Darcula,代码行数:19,代码来源:HtmlDemo.java

示例12: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        JEditorPane pane = (JEditorPane) e.getSource();
        if (e instanceof HTMLFrameHyperlinkEvent) {
            HTMLFrameHyperlinkEvent  evt = (HTMLFrameHyperlinkEvent)e;
            HTMLDocument doc = (HTMLDocument)pane.getDocument();
            doc.processHTMLFrameHyperlinkEvent(evt);
        } else {
            try {
                pane.setPage(e.getURL());
            } catch (Throwable t) {
                t.printStackTrace();
            }
        }
    }
}
 
开发者ID:effect,项目名称:graph_editor,代码行数:17,代码来源:AboutAction.java

示例13: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
/**
 * used to follow hyperlink events in the editor pane
 * @param evt a Hyperlink Event
 */
public void hyperlinkUpdate(HyperlinkEvent evt) {
    HyperlinkEvent.EventType type = evt.getEventType();
    if (type == HyperlinkEvent.EventType.ENTERED) {
        System.out.println(evt.getURL().toString());
    } else if (type == HyperlinkEvent.EventType.EXITED) {
        System.out.println("Exited");
    } else if (type == HyperlinkEvent.EventType.ACTIVATED) {
        if (evt instanceof HTMLFrameHyperlinkEvent) {
            HTMLFrameHyperlinkEvent evt1 = (HTMLFrameHyperlinkEvent) evt;
            HTMLDocument doc = (HTMLDocument) getDocument();
            doc.processHTMLFrameHyperlinkEvent(evt1);
        } else {
            try {
                setPage(evt.getURL());
                System.out.println(evt.getURL().toString());
            } catch (FileNotFoundException fnfe) {
                setText("Could not open file: <tt>" + evt.getURL() + "</tt>.<hr>");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:secondfoundation,项目名称:Second-Foundation-Src,代码行数:28,代码来源:AntiAliasedEditorPane.java

示例14: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        JEditorPane pane = (JEditorPane) e.getSource();
        if (e instanceof HTMLFrameHyperlinkEvent) {
            HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
            HTMLDocument doc = (HTMLDocument)pane.getDocument();
            doc.processHTMLFrameHyperlinkEvent(evt);
        } else {
            try {
                pane.setPage(e.getURL());
            } catch (Throwable t) {
                t.printStackTrace();
            }
        }
    }
}
 
开发者ID:dhmay,项目名称:msInspect,代码行数:17,代码来源:HtmlViewerPanel.java

示例15: hyperlinkUpdate

import javax.swing.text.html.HTMLFrameHyperlinkEvent; //导入依赖的package包/类
public void hyperlinkUpdate(HyperlinkEvent event) {
    HyperlinkEvent.EventType eventType = event.getEventType();
    if (eventType == HyperlinkEvent.EventType.ACTIVATED) {
        if (event instanceof HTMLFrameHyperlinkEvent) {
            HTMLFrameHyperlinkEvent linkEvent = (HTMLFrameHyperlinkEvent) event;
            HTMLDocument document = (HTMLDocument) displayEditorPane
                    .getDocument();
            document.processHTMLFrameHyperlinkEvent(linkEvent);
        } else {
            showPage(event.getURL(), true);
        }
    }
}
 
开发者ID:tekrei,项目名称:JavaExamples,代码行数:14,代码来源:Browser.java


注:本文中的javax.swing.text.html.HTMLFrameHyperlinkEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。