javax.swing.JTextPane.getEditorKit()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中javax.swing.JTextPane.getEditorKit()方法的一些代码示例,展示了JTextPane.getEditorKit()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.getEditorKit()方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:getEditorKit

JTextPane.getEditorKit介绍

暂无

代码示例

代码示例来源:origin: ron190/jsql-injection

PanelConsoles.NETWORK_TAB_PREVIEW.getEditorKit().createDefaultDocument();

代码示例来源:origin: net.sf.ingenias/editor

public void run(){
  try {
   output.getEditorKit().read(new StringReader(fout),st,st.getLength());
 } catch (IOException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
 } catch (BadLocationException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
 }
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

/**
 * Convenience method for setting the document text
 */
public void setDocumentText(String sText) {
 jtpMain.setText(sText);
 ((HTMLEditorKit) (jtpMain.getEditorKit())).setDefaultCursor(new Cursor(Cursor.TEXT_CURSOR));
 jtpSource.setText(jtpMain.getText());
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public boolean isLineNumbersVisible() {
  NumberedViewFactory viewFactory = (NumberedViewFactory) editor.getEditorKit().
      getViewFactory();
  return viewFactory.isLineNumbersVisible();
}
// Variables declaration - do not modify//GEN-BEGIN:variables

代码示例来源:origin: stackoverflow.com

JTextPane textPane = new JTextPane();
textPane.setContentType( "text/html" );
textPane.setEditable(false);
HTMLDocument doc = (HTMLDocument)textPane.getDocument();
HTMLEditorKit editorKit = (HTMLEditorKit)textPane.getEditorKit();
String text = "<a href=\"abc\">hyperlink</a>";
editorKit.insertHTML(doc, doc.getLength(), text, 0, 0, null);

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

/**
 * Convenience method for setting the source document
 */
public void setSourceDocument(StyledDocument sDoc) {
 jtpSource.getDocument().removeDocumentListener(this);
 jtpSource.setDocument(sDoc);
 jtpSource.getDocument().addDocumentListener(this);
 jtpMain.setText(jtpSource.getText());
 ((HTMLEditorKit) (jtpMain.getEditorKit())).setDefaultCursor(new Cursor(Cursor.TEXT_CURSOR));
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

protected StyledDocument createDocument() {
  DefaultStyledDocument doc = new DefaultStyledDocument();
  doc.setParagraphAttributes(0, 1, ((StyledEditorKit) editor.getEditorKit()).getInputAttributes(), true);
  return doc;
}

代码示例来源:origin: MegaMek/megamek

public static void setupStylesheet(JTextPane pane) {
    pane.setContentType("text/html");
    Font font = UIManager.getFont("Label.font");
    ((HTMLEditorKit) pane.getEditorKit()).getStyleSheet().addRule(
        "pre { font-family: " + font.getFamily()
            + "; font-size: 12pt; font-style:normal;}");
  }    
}

代码示例来源:origin: MegaMek/megamek

public static void setupStylesheet(JTextPane pane) {
  pane.setContentType("text/html");
  Font font = UIManager.getFont("Label.font");
  ((HTMLEditorKit) pane.getEditorKit()).getStyleSheet().addRule(
      "pre { font-family: " + font.getFamily() + "; font-size: 12pt; font-style:normal;}");
}

代码示例来源:origin: chatty/chatty

news.setDocument(news.getEditorKit().createDefaultDocument());
news.setText(sb.toString());
SwingUtilities.invokeLater(new Runnable() {

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

MutableAttributeSet attrs = ((StyledEditorKit) editor.getEditorKit()).getInputAttributes();
String line;
boolean isFirst = true;

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public void setLineNumbersVisible(boolean newValue) {
  NumberedViewFactory viewFactory = (NumberedViewFactory) editor.getEditorKit().
      getViewFactory();
  boolean oldValue = viewFactory.isLineNumbersVisible();
  if (oldValue != newValue) {
    viewFactory.setLineNumbersVisible(newValue);
    prefs.putBoolean("lineNumbersVisible", newValue);
    firePropertyChange("lineNumbersVisible", oldValue, newValue);
    editor.revalidate();
    editor.repaint();
  }
}

代码示例来源:origin: stackoverflow.com

try {
  bold.getDocument().remove(start, end-start);
  HTMLEditorKit htmlkit = (HTMLEditorKit) bold.getEditorKit();
  htmlkit.insertHTML((HTMLDocument) bold.getDocument(), start, "<b>"+txt+"</b>", 0, 0, HTML.Tag.B);
} catch (Exception e1) {

代码示例来源:origin: stackoverflow.com

((HTMLEditorKit) textArea.getEditorKit()).insertHTML (document, root.getElement(iEndIndex).getEndOffset(), 
           sHTMLBlock, 3, 0, HTML.Tag.P);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mobility-cldcplatform

Document doc = infoPanel.getEditorKit().createDefaultDocument();
doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE); // NOI18N
try {

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

MutableAttributeSet attrs = ((StyledEditorKit) editor.getEditorKit()).getInputAttributes();
StyleConstants.setFontFamily(attrs, font.getFamily());
StyleConstants.setFontSize(attrs, font.getSize());

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-ui

System.out.println("------------DOCUMENT------------");
System.out.println("Content Type : " + jtpMain.getContentType());
System.out.println("Editor Kit   : " + jtpMain.getEditorKit());
System.out.println("Doc Tree     :");
System.out.println("");

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-kenai-ui

topPanel.validate();
editorKit= (HTMLEditorKit) inbox.getEditorKit();

相关文章

JTextPane类方法