Package com.dci.intellij.dbn.connection.transaction.action

Source Code of com.dci.intellij.dbn.connection.transaction.action.UncommittedChangesTableCellRenderer

package com.dci.intellij.dbn.connection.transaction.action;

import com.dci.intellij.dbn.connection.transaction.UncommittedChange;
import com.intellij.ui.ColoredTableCellRenderer;
import com.intellij.ui.SimpleTextAttributes;

import javax.swing.JTable;

public class UncommittedChangesTableCellRenderer extends ColoredTableCellRenderer{
    @Override
    protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
        UncommittedChange change = (UncommittedChange) value;
        if (column == 0) {
            setIcon(change.getIcon());
            append(change.getDisplayFilePath(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
        } else if (column == 1) {
            append(change.getChangesCount() + " uncommitted changes", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        }

    }
}
TOP

Related Classes of com.dci.intellij.dbn.connection.transaction.action.UncommittedChangesTableCellRenderer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.