Example usage for javax.swing JTextPane setEditable

List of usage examples for javax.swing JTextPane setEditable

Introduction

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

Prototype

@BeanProperty(description = "specifies if the text can be edited")
public void setEditable(boolean b) 

Source Link

Document

Sets the specified boolean to indicate whether or not this TextComponent should be editable.

Usage

From source file:org.zaproxy.zap.extension.customFire.ExtensionCustomFire.java

private AbstractPanel getStatusPanel() {
    if (statusPanel == null) {
        statusPanel = new AbstractPanel();
        statusPanel.setLayout(new CardLayout());
        statusPanel.setName(Constant.messages.getString(PREFIX + ".panel.title"));
        statusPanel.setIcon(ICON);//from  w w w  .ja v a  2 s  .c o  m
        JTextPane pane = new JTextPane();
        pane.setEditable(false);
        pane.setFont(new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12));
        pane.setContentType("text/html");
        pane.setText(Constant.messages.getString(PREFIX + ".panel.msg"));
        statusPanel.add(pane);
    }
    return statusPanel;
}

From source file:psidev.psi.mi.filemakers.xmlMaker.gui.XsdTreePanelImpl.java

/**
 * create a new instance of XslTree The nodes will be automaticaly
 * duplicated if the schema specify that more than one element of this type
 * are mandatory/*from w w  w .j a v  a 2s. com*/
 */
public XsdTreePanelImpl(XsdTreeStructImpl xsdTree, JTextPane messagePane) {
    super(xsdTree);

    messagePane.setEditable(false);

    JScrollPane scrollpane = new JScrollPane(messagePane);
    scrollpane.setMaximumSize(new Dimension(Short.MAX_VALUE, 150));
    scrollpane.setMinimumSize(new Dimension(200, 150));
    scrollpane.setPreferredSize(new Dimension(200, 150));
    scrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollpane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrollpane.setBorder(new TitledBorder("Messages"));

    add(scrollpane, BorderLayout.SOUTH);
    add(getButtonPanel(), BorderLayout.EAST);
    MouseListener mouseListener = new TreeMouseAdapter();
    xsdTree.tree.addMouseListener(mouseListener);
}

From source file:tufts.vue.ui.InspectorPane.java

private static JComponent buildSummary(final Resource r, final MetaMap data) {
    final JTextPane htmlText = new JTextPane();
    htmlText.setEditable(false);
    htmlText.setContentType("text/html");
    htmlText.setName("description:" + r);
    htmlText.addHyperlinkListener(DefaultHyperlinkListener);

    //final MetaMap data = (node == null ? null : node.getRawData());

    final String desc = findProperty(r, data, "descriptionSummary", "Description", "Summary");

    final String summary;

    if (desc != null || r == null) {

        summary = buildSummaryWithDescription(r, data, desc);
        if (summary == null || summary.length() == 0)
            return null;
        //htmlText.setText("No Description");// todo: should just hide panel
        else/*from   w w  w .jav a 2s . c o  m*/
            htmlText.setText(summary);

        if (DEBUG.DATA && data != null)
            data.put("$reformatted", "[" + summary + "]");

    } else { //if (r != null) {

        //------------------------------------------------------------------
        // No description was found: build a summary from just the Resource
        //------------------------------------------------------------------

        summary = buildSummaryFromResource(r);

        htmlText.setText(summary);

        if (DEBUG.DATA)
            r.setProperty("~reformatted", summary);

    }
    //else return null;

    // This must be done last.  Why this doesn't work up front I don't know: there
    // must be some other way...

    GUI.setDocumentFont(htmlText, GUI.ContentFace);

    return htmlText;

    //         if (loader != null) {
    //             // this not actually helping, other than we get to see "Loading..." before it hangs.
    //             final Thread _loader = loader;
    //             GUI.invokeAfterAWT(new Runnable() { public void run() {
    //                 _loader.start();
    //             }});
    //         }

}