當前位置: 首頁>>代碼示例>>Java>>正文


Java HTML.getTag方法代碼示例

本文整理匯總了Java中javax.swing.text.html.HTML.getTag方法的典型用法代碼示例。如果您正苦於以下問題:Java HTML.getTag方法的具體用法?Java HTML.getTag怎麽用?Java HTML.getTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.text.html.HTML的用法示例。


在下文中一共展示了HTML.getTag方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ulActionB_actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void ulActionB_actionPerformed(ActionEvent e) {
	String parentname =
		document
			.getParagraphElement(editor.getCaretPosition())
			.getParentElement()
			.getName();
	HTML.Tag parentTag = HTML.getTag(parentname);
	HTMLEditorKit.InsertHTMLTextAction ulAction =
		new HTMLEditorKit.InsertHTMLTextAction(
			"insertUL",
			"<ul><li></li></ul>",
			parentTag,
			HTML.Tag.UL);
	ulAction.actionPerformed(e);

}
 
開發者ID:ser316asu,項目名稱:Neukoelln_SER316,代碼行數:17,代碼來源:HTMLEditor.java

示例2: olActionB_actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void olActionB_actionPerformed(ActionEvent e) {
    String parentname =
        document
            .getParagraphElement(editor.getCaretPosition())
            .getParentElement()
            .getName();
    HTML.Tag parentTag = HTML.getTag(parentname);
    HTMLEditorKit.InsertHTMLTextAction olAction =
        new HTMLEditorKit.InsertHTMLTextAction(
            "insertOL",
            "<ol><li></li></ol>",
            parentTag,
            HTML.Tag.OL);
    olAction.actionPerformed(e);
    //removeIfEmpty(document.getParagraphElement(editor.getCaretPosition()-1));
    list = true;
}
 
開發者ID:ser316asu,項目名稱:SER316-Dresden,代碼行數:18,代碼來源:HTMLEditor.java

示例3: actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent e) {
	String elName =
		document
			.getParagraphElement(editor.getCaretPosition())
			.getName();
	/*
	 * if ((elName.toUpperCase().equals("PRE")) ||
	 * (elName.toUpperCase().equals("P-IMPLIED"))) {
	 * editor.replaceSelection("\r"); return;
	 */
	HTML.Tag tag = HTML.getTag(elName);
	if (elName.toUpperCase().equals("P-IMPLIED"))
		tag = HTML.Tag.IMPLIED;

	HTMLEditorKit.InsertHTMLTextAction hta =
		new HTMLEditorKit.InsertHTMLTextAction(
			"insertBR",
			"<br>",
			tag,
			HTML.Tag.BR);
	hta.actionPerformed(e);

	//insertHTML("<br>",editor.getCaretPosition());

}
 
開發者ID:ser316asu,項目名稱:Dahlem_SER316,代碼行數:26,代碼來源:HTMLEditor.java

示例4: olActionB_actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void olActionB_actionPerformed(ActionEvent e) {
	String parentname =
		document
			.getParagraphElement(editor.getCaretPosition())
			.getParentElement()
			.getName();
	HTML.Tag parentTag = HTML.getTag(parentname);
	HTMLEditorKit.InsertHTMLTextAction olAction =
		new HTMLEditorKit.InsertHTMLTextAction(
			"insertOL",
			"<ol><li></li></ol>",
			parentTag,
			HTML.Tag.OL);
	olAction.actionPerformed(e);
	//removeIfEmpty(document.getParagraphElement(editor.getCaretPosition()-1));
	list = true;
}
 
開發者ID:ser316asu,項目名稱:SER316-Munich,代碼行數:18,代碼來源:HTMLEditor.java

示例5: olActionB_actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void olActionB_actionPerformed(ActionEvent e) {
	String parentname =
		document
			.getParagraphElement(editor.getCaretPosition())
			.getParentElement()
			.getName();
	HTML.Tag parentTag = HTML.getTag(parentname);
	HTMLEditorKit.InsertHTMLTextAction olAction =
		new HTMLEditorKit.InsertHTMLTextAction(
			"insertOL",
			"<ol><li></li></ol>",
			parentTag,
			HTML.Tag.OL);
	olAction.actionPerformed(e);
}
 
開發者ID:ser316asu,項目名稱:Neukoelln_SER316,代碼行數:16,代碼來源:HTMLEditor.java

示例6: ulActionB_actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void ulActionB_actionPerformed(ActionEvent e) {
	String parentname =
		document
			.getParagraphElement(editor.getCaretPosition())
			.getParentElement()
			.getName();
	HTML.Tag parentTag = HTML.getTag(parentname);
	HTMLEditorKit.InsertHTMLTextAction ulAction =
		new HTMLEditorKit.InsertHTMLTextAction(
			"insertUL",
			"<ul><li></li></ul>",
			parentTag,
			HTML.Tag.UL);
	ulAction.actionPerformed(e);
	//removeIfEmpty(document.getParagraphElement(editor.getCaretPosition()-1));
	list = true;
	/*
	 * Element pEl =
	 * document.getParagraphElement(editor.getCaretPosition());
	 * StringWriter sw = new StringWriter(); try { editorKit.write(sw,
	 * document, pEl.getStartOffset(),
	 * pEl.getEndOffset()-pEl.getStartOffset()); String copy =
	 * sw.toString(); String elName = pEl.getName(); copy =
	 * copy.substring(copy.indexOf(" <"+elName)); copy =
	 * copy.substring(0,copy.indexOf(" </"+elName)+elName.length()+3);
	 * document.setOuterHTML(pEl, " <ul><li> "+copy+" </li></ul> ");
	 * System.out.println(copy); } catch (Exception ex){
	 * ex.printStackTrace();
	 */

}
 
開發者ID:ser316asu,項目名稱:SER316-Aachen,代碼行數:32,代碼來源:HTMLEditor.java

示例7: ulActionB_actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void ulActionB_actionPerformed(ActionEvent e) {
    String parentname =
        document
            .getParagraphElement(editor.getCaretPosition())
            .getParentElement()
            .getName();
    HTML.Tag parentTag = HTML.getTag(parentname);
    HTMLEditorKit.InsertHTMLTextAction ulAction =
        new HTMLEditorKit.InsertHTMLTextAction(
            "insertUL",
            "<ul><li></li></ul>",
            parentTag,
            HTML.Tag.UL);
    ulAction.actionPerformed(e);
    //removeIfEmpty(document.getParagraphElement(editor.getCaretPosition()-1));
    list = true;
    /*
     * Element pEl =
     * document.getParagraphElement(editor.getCaretPosition());
     * StringWriter sw = new StringWriter(); try { editorKit.write(sw,
     * document, pEl.getStartOffset(),
     * pEl.getEndOffset()-pEl.getStartOffset()); String copy =
     * sw.toString(); String elName = pEl.getName(); copy =
     * copy.substring(copy.indexOf(" <"+elName)); copy =
     * copy.substring(0,copy.indexOf(" </"+elName)+elName.length()+3);
     * document.setOuterHTML(pEl, " <ul><li> "+copy+" </li></ul> ");
     * Util.debug(copy); } catch (Exception ex){
     * ex.printStackTrace();
     */

}
 
開發者ID:ser316asu,項目名稱:SER316-Dresden,代碼行數:32,代碼來源:HTMLEditor.java

示例8: actionPerformed

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent e) {
	String elName =
		document
			.getParagraphElement(editor.getCaretPosition())
			.getName();
	/*
	 * if ((elName.toUpperCase().equals("PRE")) ||
	 * (elName.toUpperCase().equals("P-IMPLIED"))) {
	 * editor.replaceSelection("\r"); return;
	 */
	HTML.Tag tag = HTML.getTag(elName);
	if (elName.toUpperCase().equals("P-IMPLIED"))
	{
		tag = HTML.Tag.IMPLIED;
	}

	HTMLEditorKit.InsertHTMLTextAction hta =
		new HTMLEditorKit.InsertHTMLTextAction(
			"insertBR",
			"<br>",
			tag,
			HTML.Tag.BR);
	hta.actionPerformed(e);

	//insertHTML("<br>",editor.getCaretPosition());

}
 
開發者ID:ser316asu,項目名稱:SER316-Aachen,代碼行數:28,代碼來源:HTMLEditor.java

示例9: TagElement

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
public TagElement (Element elem, boolean fictional) {
    this.elem = elem;
    htmlTag = HTML.getTag(elem.getName());
    if (htmlTag == null) {
        htmlTag = new HTML.UnknownTag(elem.getName());
    }
    insertedByErrorRecovery = fictional;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:9,代碼來源:TagElement.java

示例10: TagElement

import javax.swing.text.html.HTML; //導入方法依賴的package包/類
/**
 * Creates a generic HTML TagElement class.
 *
 * @param elem an element
 * @param fictional if {@code true} the tag is inserted by error recovery.
 */
public TagElement (Element elem, boolean fictional) {
    this.elem = elem;
    htmlTag = HTML.getTag(elem.getName());
    if (htmlTag == null) {
        htmlTag = new HTML.UnknownTag(elem.getName());
    }
    insertedByErrorRecovery = fictional;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:TagElement.java


注:本文中的javax.swing.text.html.HTML.getTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。