本文整理了Java中javax.swing.text.JTextComponent.addPropertyChangeListener()
方法的一些代码示例,展示了JTextComponent.addPropertyChangeListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.addPropertyChangeListener()
方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:addPropertyChangeListener
暂无
代码示例来源:origin: groovy/groovy-core
public synchronized void syntheticBind() {
boundTextComponent = (JTextComponent) ((PropertyBinding)sourceBinding).getBean();
boundTextComponent.addPropertyChangeListener("document", this);
boundTextComponent.getDocument().addDocumentListener(this);
}
代码示例来源:origin: stackoverflow.com
text.addPropertyChangeListener("document", (PropertyChangeEvent e) -> {
Document d1 = (Document)e.getOldValue();
Document d2 = (Document)e.getNewValue();
代码示例来源:origin: SonarSource/sonarqube
/**
* Create a line number component for a text component.
*
* @param component the related text component
* @param minimumDisplayDigits the number of digits used to calculate
* the minimum width of the component
*/
public TextLineNumber(JTextComponent component, int minimumDisplayDigits) {
this.component = component;
setFont(component.getFont());
setBorderGap(5);
setCurrentLineForeground(Color.RED);
setDigitAlignment(RIGHT);
setMinimumDisplayDigits(minimumDisplayDigits);
component.getDocument().addDocumentListener(this);
component.addCaretListener(this);
component.addPropertyChangeListener("font", this);
}
代码示例来源:origin: pentaho/pentaho-reporting
public void registerTextField( final JTextComponent textField ) {
textField.getDocument().addDocumentListener( formTextfieldListener );
textField.addPropertyChangeListener( FormValidator.DOCUMENT_PROPERTY_NAME, formTextfieldListener );
}
代码示例来源:origin: com.google.code.validationframework/validationframework-swing
/**
* Constructor specifying the text component to which the property applies.
*
* @param textComponent Text component to which the property applies.
*/
public JTextComponentTextProperty(JTextComponent textComponent) {
this.textComponent = textComponent;
// Hook to component
textComponent.addPropertyChangeListener("document", documentTracker);
textComponent.getDocument().addDocumentListener(documentTracker);
// Set initial value
this.value = textComponent.getText();
}
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16
/**
* Listen live or on action performed.
*/
private void registerListeners(boolean live) {
if(live) {
document.addDocumentListener(filterHandler);
} else {
if(textComponent == null) throw new IllegalArgumentException("Non-live filtering supported only for JTextField (document provided)");
if(!(textComponent instanceof JTextField)) throw new IllegalArgumentException("Non-live filtering supported only for JTextField (argument class " + textComponent.getClass().getName() + ")");
JTextField textField = (JTextField) textComponent;
textField.addActionListener(filterHandler);
}
if (textComponent != null)
textComponent.addPropertyChangeListener(filterHandler);
}
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
public synchronized void syntheticBind() {
boundTextComponent = (JTextComponent) ((PropertyBinding)sourceBinding).getBean();
boundTextComponent.addPropertyChangeListener("document", this);
boundTextComponent.getDocument().addDocumentListener(this);
}
代码示例来源:origin: org.codehaus.groovy/groovy-swing
public synchronized void syntheticBind() {
boundTextComponent = (JTextComponent) ((PropertyBinding)sourceBinding).getBean();
boundTextComponent.addPropertyChangeListener("document", this);
boundTextComponent.getDocument().addDocumentListener(this);
}
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
public synchronized void syntheticBind() {
boundTextComponent = (JTextComponent) ((PropertyBinding)sourceBinding).getBean();
boundTextComponent.addPropertyChangeListener("document", this);
boundTextComponent.getDocument().addDocumentListener(this);
}
代码示例来源:origin: nativelibs4java/JNAerator
public final static void addUndoRedoSupport(final JTextComponent jtc) {
jtc.addPropertyChangeListener("document", new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
UndoRedoUtils.registerNewUndoManager(jtc);
}
});
UndoRedoUtils.registerNewUndoManager(jtc);
}
public final static JPanel makeEntriesPanel(BeansController<?> beansController,int widthMin,FormElement[] formElements) {
代码示例来源:origin: org.kohsuke.droovy/groovy
public synchronized void syntheticBind() {
boundTextComponent = (JTextComponent) ((PropertyBinding)sourceBinding).getBean();
boundTextComponent.addPropertyChangeListener("document", this);
boundTextComponent.getDocument().addDocumentListener(this);
}
代码示例来源:origin: omegat-org/omegat
public FontFallbackListener(final JTextComponent comp) {
defaultFont = comp.getFont();
comp.addPropertyChangeListener("font", evt -> {
if (evt.getNewValue() != null && !evt.getNewValue().equals(evt.getOldValue())) {
defaultFont = (Font) evt.getNewValue();
Document doc = comp.getDocument();
doStyling(doc, 0, doc.getLength());
}
});
}
代码示例来源:origin: net.java.dev.beansbinding/beansbinding
protected void listeningStarted() {
cachedText = component.getText();
handler = new Handler();
component.addPropertyChangeListener("document", handler);
if (property != PROPERTY_BASE) {
component.addFocusListener(handler);
}
if (property == ON_ACTION_OR_FOCUS_LOST && component instanceof JTextField) {
((JTextField)component).addActionListener(handler);
}
document = component.getDocument();
installDocumentListener();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-spellchecker
/** Creates a new instance of ComponentPeer */
private ComponentPeer(JTextComponent pane) {
this.pane = pane;
// reschedule();
pane.addPropertyChangeListener(this);
pane.addCaretListener(this);
pane.addAncestorListener(this);
document = pane.getDocument();
document.addDocumentListener(this);
ancestorAdded(null);
}
代码示例来源:origin: it.tidalwave.betterbeansbinding/betterbeansbinding-swingbinding
protected void listeningStarted() {
cachedText = component.getText();
handler = new Handler();
component.addPropertyChangeListener("document", handler);
if (property != PROPERTY_BASE) {
component.addFocusListener(handler);
}
if ((property == ON_ACTION_OR_FOCUS_LOST) &&
component instanceof JTextField) {
((JTextField) component).addActionListener(handler);
}
document = component.getDocument();
installDocumentListener();
}
代码示例来源:origin: atarw/material-ui-swing
@Override
protected void installListeners () {
getComponent ().addFocusListener (this);
getComponent ().addPropertyChangeListener (this);
}
代码示例来源:origin: org.zaproxy/zap
private void setupWithCaret(Caret caret) {
if (caret != null) {
textComponent.addFocusListener(this);
textComponent.addPropertyChangeListener("editable", this);
caretBlinkRate = caret.getBlinkRate();
if (!textComponent.isEditable()) {
caret.setBlinkRate(0);
}
} else {
caretBlinkRate = 0;
}
}
代码示例来源:origin: atarw/material-ui-swing
@Override
protected void installListeners() {
super.installListeners();
getComponent().addFocusListener(this);
getComponent().addPropertyChangeListener(this);
}
代码示例来源:origin: mucommander/mucommander
public TextLineNumbersPanel(JTextComponent component, int minimumDisplayDigits, Border border, int borderGap,
ALIGNMENT alignment) {
this.component = component;
setBackground(Color.LIGHT_GRAY);
setForeground(Color.black);
setCurrentLineForeground(new Color(0,0,255));
setDigitAlignment(alignment);
setBorder(border, borderGap);
setMinimumDisplayDigits( minimumDisplayDigits);
setFont(component.getFont());
component.getDocument().addDocumentListener(this);
component.addPropertyChangeListener("font", this);
component.addCaretListener(this);
}
代码示例来源:origin: org.zaproxy/zap
public void setEnforceVisibilityOnFocusGain(boolean visible) {
if (enforceCaretVisibility == visible) {
return;
}
enforceCaretVisibility = visible;
if (enforceCaretVisibility) {
setupWithCaret(textComponent.getCaret());
textComponent.addPropertyChangeListener("caret", this);
} else {
removeListenersWithCaret(textComponent.getCaret());
textComponent.removePropertyChangeListener("caret", this);
}
}
内容来源于网络,如有侵权,请联系作者删除!