Example usage for javax.swing JCheckBox setEnabled

List of usage examples for javax.swing JCheckBox setEnabled

Introduction

In this page you can find the example usage for javax.swing JCheckBox setEnabled.

Prototype

public void setEnabled(boolean b) 

Source Link

Document

Enables (or disables) the button.

Usage

From source file:pl.edu.agh.lib.FileInfo.java

public void getInfoFromFS(List<Entity> entities, JTable aclList, JLabel jPath, JLabel jType, JLabel jMask,
        JLabel jFlags, JLabel jInodeNumer, JCheckBox jReadMask, JCheckBox jWriteMask, JCheckBox jExecuteMask,
        String currentPath) {//from w  w  w. j  av  a 2s  .  c o  m
    if (isReadeable(currentPath)) {
        String type = getType(currentPath);
        String mask = getMask(currentPath);
        String flags = getFlags(currentPath);
        String inode = getInodeNumber(currentPath);

        entities.clear();
        entities.addAll(aclOperator.getAclList(currentPath));

        if (currentPath.length() > 50) {
            jPath.setText("..." + currentPath.substring(currentPath.lastIndexOf("/")));
        } else {
            jPath.setText(currentPath);
        }
        if (type.length() > 60) {
            jType.setText(type.substring(0, 56) + "...");
        } else {
            jType.setText(type);
        }
        jMask.setText(mask);
        jFlags.setText(flags);
        jInodeNumer.setText(inode);

        if (mask.equals("")) {
            jReadMask.setSelected(false);
            jReadMask.setEnabled(false);
            jWriteMask.setSelected(false);
            jWriteMask.setEnabled(false);
            jExecuteMask.setSelected(false);
            jExecuteMask.setEnabled(false);
        } else {
            jWriteMask.setEnabled(true);
            jReadMask.setEnabled(true);
            jExecuteMask.setEnabled(true);
            if (mask.contains("r")) {
                jReadMask.setSelected(true);
            } else {
                columnBacklight(PermissionType.READ, true, aclList, entities);
            }
            if (mask.contains("w")) {
                jWriteMask.setSelected(true);
            } else {
                columnBacklight(PermissionType.WRITE, true, aclList, entities);
            }
            if (mask.contains("x")) {
                jExecuteMask.setSelected(true);
            } else {
                columnBacklight(PermissionType.EXECUTE, true, aclList, entities);
            }
        }
    }
}