Example usage for javax.swing.table DefaultTableCellRenderer putClientProperty

List of usage examples for javax.swing.table DefaultTableCellRenderer putClientProperty

Introduction

In this page you can find the example usage for javax.swing.table DefaultTableCellRenderer putClientProperty.

Prototype

public final void putClientProperty(Object key, Object value) 

Source Link

Document

Adds an arbitrary key/value "client property" to this component.

Usage

From source file:com.mirth.connect.client.ui.browsers.event.EventBrowser.java

private void makeAttributesTable() {
    setEventAttributes(null, true);//from  w w  w.  jav a2  s.c  om

    // listen for trigger button and double click to edit channel.
    eventAttributesTable.addMouseListener(new java.awt.event.MouseAdapter() {

        public void mouseClicked(java.awt.event.MouseEvent evt) {
            if (eventAttributesTable.rowAtPoint(new Point(evt.getX(), evt.getY())) == -1) {
                return;
            }

            if (evt.getClickCount() >= 2) {
                new ViewContentDialog((String) eventAttributesTable.getModel().getValueAt(
                        eventAttributesTable.getSelectedModelIndex(), ATTRIBUTES_VALUE_COLUMN_NUMBER));
            }
        }
    });

    eventAttributesTable.setSelectionMode(0);

    // Disable HTML in a column.
    DefaultTableCellRenderer noHTMLRenderer = new DefaultTableCellRenderer();
    noHTMLRenderer.putClientProperty("html.disable", Boolean.TRUE);
    eventAttributesTable.getColumnExt(ATTRIBUTES_VALUE_COLUMN_NAME).setCellRenderer(noHTMLRenderer);

    eventAttributesPane.setViewportView(eventAttributesTable);
}

From source file:com.mirth.connect.client.ui.browsers.message.MessageBrowser.java

/**
 * Sets the properties and adds the listeners for the Mappings Table. No data is loaded at this
 * point.//from w ww. ja v a  2 s  .  c o m
 */
private void makeMappingsTable() {
    updateMappingsTable(null, true);

    // listen for trigger button and double click to edit channel.
    mappingsTable.addMouseListener(new java.awt.event.MouseAdapter() {

        public void mouseClicked(java.awt.event.MouseEvent evt) {
            if (mappingsTable.rowAtPoint(new Point(evt.getX(), evt.getY())) == -1) {
                return;
            }

            if (evt.getClickCount() >= 2) {
                new ViewContentDialog((String) mappingsTable.getModel()
                        .getValueAt(mappingsTable.convertRowIndexToModel(mappingsTable.getSelectedRow()), 2));
            }
        }
    });

    mappingsTable.setSelectionMode(0);
    mappingsTable.getColumnExt(SCOPE_COLUMN_NAME).setMinWidth(UIConstants.MIN_WIDTH);
    mappingsTable.getColumnExt(SCOPE_COLUMN_NAME).setMaxWidth(UIConstants.MAX_WIDTH);

    // Disable HTML in a column.
    DefaultTableCellRenderer noHTMLRenderer = new DefaultTableCellRenderer();
    noHTMLRenderer.putClientProperty("html.disable", Boolean.TRUE);
    mappingsTable.getColumnExt(VALUE_COLUMN_NAME).setCellRenderer(noHTMLRenderer);

    mappingsPane.setViewportView(mappingsTable);
}