Package org.jdesktop.wonderland.modules.securitygroups.common

Examples of org.jdesktop.wonderland.modules.securitygroups.common.GroupDTO


    public static GroupDTO toDTO(GroupEntity ge, boolean members) {
        if (ge == null) {
            return null;
        }

        GroupDTO out = new GroupDTO(ge.getId());
        out.setMemberCount(ge.getMembers().size());
       
        if (members) {
            for (MemberEntity me : ge.getMembers()) {
                out.getMembers().add(new MemberDTO(me.getMemberId(),
                                                   me.isOwner()));
            }
        }

        return out;
View Full Code Here


    }

    @GET
    @Produces({"text/plain", "application/xml", "application/json"})
    public Response get() {
        GroupDTO out = GroupResourceUtil.toDTO(groups.getGroup(groupId), true);
        if (out == null) {
            return Response.status(Response.Status.NOT_FOUND).build();
        }

        // set whether or not the requesting user can edit the group
        out.setEditable(canModify());

        // return the encoded group
        return Response.ok(out).build();
    }
View Full Code Here

            je.printStackTrace();
        }
    }

    protected GroupDTO toGroup() {
        GroupDTO group = new GroupDTO(groupnameTF.getText());

        for (int i = 0; i < tableModel.getRowCount(); i++) {
            String name = (String) tableModel.getValueAt(i, 0);
            Boolean owner = (Boolean) tableModel.getValueAt(i, 1);

            group.getMembers().add(new MemberDTO(name, owner));
        }

        return group;
    }
View Full Code Here

    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        try {
            // if we are adding a group, check to see if we are overwriting
            // an existing group
            if (isAdd) {
                GroupDTO existing = GroupUtils.getGroup(baseUrl,
                        groupnameTF.getText(),
                        cm);
                if (existing != null) {
                    String groupName = groupnameTF.getText();
                    String message = BUNDLE.getString("Group_Exists_Message");
View Full Code Here

            tableModel.addRow(new Object[]{g, g.getMemberCount()});
        }
    }

    public void valueChanged(ListSelectionEvent e) {
        GroupDTO selected = null;

        if (!e.getValueIsAdjusting()) {
            selected = getSelectedGroup();
        }

        if (selected != null) {
            System.out.println("Selected: " + selected.getId() + " editable: " +
                    selected.isEditable());
        }

        boolean editable = (selected != null && selected.isEditable());
        editButton.setEnabled(editable);
        removeButton.setEnabled(editable);
    }
View Full Code Here

        GroupEditorFrame gef = new GroupEditorFrame(this, baseUrl, group, cm);
        gef.setVisible(true);
    }

    private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
        GroupDTO selected = getSelectedGroup();
        if (selected != null) {
            try {
                GroupUtils.removeGroup(baseUrl, selected.getId(), cm);
                loadGroups();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            }
        }
View Full Code Here

        @Override
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus,
                int row, int column) {
            GroupDTO group = (GroupDTO) value;
            String name = group.getId();

            return super.getTableCellRendererComponent(table, name, isSelected,
                    hasFocus, row, column);
        }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.securitygroups.common.GroupDTO

Copyright © 2018 www.massapicom. 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.