javax.swing.JEditorPane.getClientProperty()方法的使用及代码示例

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

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

JEditorPane.getClientProperty介绍

暂无

代码示例

代码示例来源:origin: org.nuiton/nuiton-widgets

static protected void removeUndoRedoSupport(JEditorPane editor) {
  UndoManager undo = (UndoManager) editor.getClientProperty(UNDO_MANAGER);
  if (undo != null) {
    Document doc = editor.getDocument();
    doc.removeUndoableEditListener(undo);
  }
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra

static protected void removeUndoRedoSupport(JEditorPane editor) {
  UndoManager undo = (UndoManager) editor.getClientProperty(UNDO_MANAGER);
  if (undo != null) {
    Document doc = editor.getDocument();
    doc.removeUndoableEditListener(undo);
  }
}

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

private void setLineWrap() {
  if(null != textfield.getClientProperty("EditNodeTextField.linewrap") || inputMethodInUseListener.isIMEInUse()){
    return;
  }
  final HTMLDocument document = (HTMLDocument) textfield.getDocument();
  document.getStyleSheet().addRule("body { width: " + (maxWidth - 1) + "}");
  // bad hack: call "setEditable" only to update view
  textfield.setEditable(false);
  textfield.setEditable(true);
  textfield.putClientProperty("EditNodeTextField.linewrap", true);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void deinstall(JEditorPane c) {
  executeDeinstallActions(c);
  c.updateUI();
  
  // #41209: reset ancestor override flag if previously set
  if (c.getClientProperty("ancestorOverride") != null) { // NOI18N
    c.putClientProperty("ancestorOverride", Boolean.FALSE); // NOI18N
  }
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra

static protected void addUndoRedoSupport(JEditorPane editor) {
  UndoManager undo = (UndoManager) editor.getClientProperty(UNDO_MANAGER);
  if (undo == null) {
    undo = new UndoManager();
    editor.putClientProperty(UNDO_MANAGER, undo);
    Action undoAction = new UndoAction(undo);
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_Z,
                        Event.CTRL_MASK);
    editor.getInputMap().put(key, "undo");
    editor.getActionMap().put("undo", undoAction);
    Action redoAction = new RedoAction(undo);
    key = KeyStroke.getKeyStroke(KeyEvent.VK_Z, KeyEvent.CTRL_MASK
        + KeyEvent.SHIFT_DOWN_MASK);
    editor.getInputMap().put(key, "redo");
    editor.getActionMap().put("redo", redoAction);
  }
  Document doc = editor.getDocument();
  doc.addUndoableEditListener(undo);
}

代码示例来源:origin: org.nuiton/nuiton-widgets

static protected void addUndoRedoSupport(JEditorPane editor) {
  UndoManager undo = (UndoManager) editor.getClientProperty(UNDO_MANAGER);
  if (undo == null) {
    undo = new UndoManager();
    editor.putClientProperty(UNDO_MANAGER, undo);
    Action undoAction = new UndoAction(undo);
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_Z,
        Event.CTRL_MASK);
    editor.getInputMap().put(key, "undo");
    editor.getActionMap().put("undo", undoAction);
    Action redoAction = new RedoAction(undo);
    key = KeyStroke.getKeyStroke(KeyEvent.VK_Z, KeyEvent.CTRL_MASK
        + KeyEvent.SHIFT_DOWN_MASK);
    editor.getInputMap().put(key, "redo");
    editor.getActionMap().put("redo", redoAction);
  }
  Document doc = editor.getDocument();
  doc.addUndoableEditListener(undo);
}

相关文章

JEditorPane类方法