Example usage for javax.swing JTextPane getClientProperty

List of usage examples for javax.swing JTextPane getClientProperty

Introduction

In this page you can find the example usage for javax.swing JTextPane getClientProperty.

Prototype

public final Object getClientProperty(Object key) 

Source Link

Document

Returns the value of the property with the specified key.

Usage

From source file:org.languagetool.gui.ResultAreaHelper.java

static void install(ResourceBundle messages, LanguageToolSupport ltSupport, JTextPane pane) {
    Object prev = pane.getClientProperty(KEY);
    if (prev != null && prev instanceof ResultAreaHelper) {
        enable(pane);// w w w  . j  a va2 s .c  om
        return;
    }
    ResultAreaHelper helper = new ResultAreaHelper(messages, ltSupport, pane);
    pane.putClientProperty(KEY, helper);
}

From source file:org.languagetool.gui.ResultAreaHelper.java

static void enable(JTextPane pane) {
    Object helper = pane.getClientProperty(KEY);
    if (helper != null && helper instanceof ResultAreaHelper) {
        ((ResultAreaHelper) helper).enable();
    }//from ww w.  j  av a  2 s . c  o  m
}

From source file:org.languagetool.gui.ResultAreaHelper.java

static void disable(JTextPane pane) {
    Object helper = pane.getClientProperty(KEY);
    if (helper != null && helper instanceof ResultAreaHelper) {
        ((ResultAreaHelper) helper).disable();
    }//from   w w w.ja v  a 2 s. c  o m
}

From source file:org.languagetool.gui.ResultAreaHelper.java

static void uninstall(JTextPane pane) {
    Object helper = pane.getClientProperty(KEY);
    if (helper != null && helper instanceof ResultAreaHelper) {
        ((ResultAreaHelper) helper).disable();
        pane.putClientProperty(KEY, null);
    }// w w  w .j  ava2  s . c  o  m
}