Search in sources :

Example 6 with Role

use of net.sourceforge.processdash.tool.perm.Role in project processdash by dtuma.

the class RolesEditor method savePermissionChanges.

private void savePermissionChanges() {
    if (currentlyEditing != null && permissionList.isDirty()) {
        Role updated = new Role(currentlyEditing.getId(), //
        currentlyEditing.getName(), currentlyEditing.isInactive(), permissionList.getContents());
        rolesToSave.remove(currentlyEditing);
        rolesToSave.add(updated);
        permissionList.clearDirty();
        int pos = roles.indexOf(currentlyEditing);
        currentlyEditing = updated;
        roles.set(pos, updated);
    }
}
Also used : Role(net.sourceforge.processdash.tool.perm.Role)

Example 7 with Role

use of net.sourceforge.processdash.tool.perm.Role in project processdash by dtuma.

the class RolesEditor method addRoleToListAndSelect.

private void addRoleToListAndSelect(Role add) {
    for (int i = 0; i < roles.size(); i++) {
        Role r = roles.get(i);
        if (add.compareTo(r) < 0) {
            roles.add(i, add);
            rolesList.setSelectedValue(add, true);
            return;
        }
    }
    roles.addElement(add);
    rolesList.setSelectedValue(add, true);
}
Also used : Role(net.sourceforge.processdash.tool.perm.Role)

Aggregations

Role (net.sourceforge.processdash.tool.perm.Role)7 Component (java.awt.Component)1 Dimension (java.awt.Dimension)1 Font (java.awt.Font)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 GridLayout (java.awt.GridLayout)1 Insets (java.awt.Insets)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 DefaultListModel (javax.swing.DefaultListModel)1 JButton (javax.swing.JButton)1 JLabel (javax.swing.JLabel)1 JList (javax.swing.JList)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JTextField (javax.swing.JTextField)1 Border (javax.swing.border.Border)1 Permission (net.sourceforge.processdash.tool.perm.Permission)1 User (net.sourceforge.processdash.tool.perm.User)1