Package org.rhq.coregui.client.components.table

Examples of org.rhq.coregui.client.components.table.ResourceAuthorizedTableAction


        return true;
    }

    protected void setupTableInteractions(final boolean hasWriteAccess) {
        addTableAction(MSG.common_button_ack(), MSG.view_alerts_ack_confirm(), ButtonColor.BLUE,
            new ResourceAuthorizedTableAction(AlertHistoryView.this, TableActionEnablement.ANY, (hasWriteAccess ? null
                : Permission.MANAGE_ALERTS), new RecordExtractor<Integer>() {
                public Collection<Integer> extract(Record[] records) {
                    List<Integer> result = new ArrayList<Integer>(records.length);
                    for (Record record : records) {
                        result.add(record.getAttributeAsInt("resourceId"));
                    }
                    return result;
                }
            }) {

            public void executeAction(ListGridRecord[] selection, Object actionValue) {
                acknowledge(selection);
            }
        });
        if (canSupportDeleteAndAcknowledgeAll()) {
            addTableAction(MSG.common_button_ack_all(), MSG.view_alerts_ack_confirm_all(), new TableAction() {
                public boolean isEnabled(ListGridRecord[] selection) {
                    ListGrid grid = getListGrid();
                    ResultSet resultSet = (null != grid) ? grid.getResultSet() : null;
                    return (hasWriteAccess && grid != null && resultSet != null && !resultSet.isEmpty());
                }

                public void executeAction(ListGridRecord[] selection, Object actionValue) {
                    acknowledgeAll();
                }
            });
        }

        addTableAction(MSG.common_button_delete(), MSG.view_alerts_delete_confirm(), ButtonColor.RED,
            new ResourceAuthorizedTableAction(AlertHistoryView.this, TableActionEnablement.ANY, (hasWriteAccess ? null
                : Permission.MANAGE_ALERTS), new RecordExtractor<Integer>() {
                public Collection<Integer> extract(Record[] records) {
                    List<Integer> result = new ArrayList<Integer>(records.length);
                    for (Record record : records) {
                        result.add(record.getAttributeAsInt("resourceId"));
View Full Code Here


    protected void configureTable() {
        List<ListGridField> fields = createFields();
        setListGridFields(fields.toArray(new ListGridField[fields.size()]));

        addTableAction(MSG.common_button_uninventory(), MSG.view_inventory_resources_uninventoryConfirm(),
            ButtonColor.RED, new ResourceAuthorizedTableAction(ResourceSearchView.this, TableActionEnablement.ANY,
                Permission.DELETE_RESOURCE, new RecordExtractor<Integer>() {

                    public Collection<Integer> extract(Record[] records) {
                        List<Integer> result = new ArrayList<Integer>(records.length);
                        for (Record record : records) {
View Full Code Here

     * Adds an ignore button to the list of table buttons. Subclasses normally do not have to override
     * this - instead, look at {@link #shouldShowIgnoreButton()}.
     */
    protected void addIgnoreButton() {
        addTableAction(MSG.common_button_ignore(), MSG.view_inventory_resources_ignoreConfirm(),
            new ResourceAuthorizedTableAction(ResourceSearchView.this, TableActionEnablement.ANY,
                Permission.DELETE_RESOURCE, new RecordExtractor<Integer>() {
                    public Collection<Integer> extract(Record[] records) {
                        List<Integer> result = new ArrayList<Integer>(records.length);
                        for (Record record : records) {
                            // we only care about those that are not platforms since you cannot ignore platforms outside of discovery queue anyway
View Full Code Here

     * Adds an unignore button to the list of table buttons. Subclasses normally do not have to override
     * this - instead, look at {@link #shouldShowUnignoreButton()}.
     */
    protected void addUnignoreButton() {
        addTableAction(MSG.common_button_unignore(), MSG.view_inventory_resources_unignoreConfirm(),
            new ResourceAuthorizedTableAction(ResourceSearchView.this, TableActionEnablement.ANY,
                Permission.DELETE_RESOURCE, new RecordExtractor<Integer>() {
                    public Collection<Integer> extract(Record[] records) {
                        List<Integer> result = new ArrayList<Integer>(records.length);
                        for (Record record : records) {
                            result.add(record.getAttributeAsInt("id"));
View Full Code Here

        // We override this method, because button enablement implementation from super class for "Delete All"
        // and "Acknowledge All" doesn't work correctly for table with using grouping. Also adding additional
        // button for enabling / disabling the alerts grouping.

        addTableAction(MSG.common_button_delete(), MSG.view_alerts_delete_confirm(), ButtonColor.RED,
            new ResourceAuthorizedTableAction(StorageNodeAlertHistoryView.this, TableActionEnablement.ANY,
                (hasWriteAccess ? null : Permission.MANAGE_ALERTS), new RecordExtractor<Integer>() {
                    public Collection<Integer> extract(Record[] records) {
                        List<Integer> result = new ArrayList<Integer>(records.length);
                        for (Record record : records) {
                            result.add(record.getAttributeAsInt("resourceId"));
                        }
                        return result;
                    }
                }) {

                public void executeAction(ListGridRecord[] selection, Object actionValue) {
                    delete(selection);
                }
            });
        addTableAction(MSG.common_button_ack(), MSG.view_alerts_ack_confirm(), ButtonColor.BLUE,
            new ResourceAuthorizedTableAction(StorageNodeAlertHistoryView.this, TableActionEnablement.ANY,
                (hasWriteAccess ? null : Permission.MANAGE_ALERTS), new RecordExtractor<Integer>() {
                    public Collection<Integer> extract(Record[] records) {
                        List<Integer> result = new ArrayList<Integer>(records.length);
                        for (Record record : records) {
                            result.add(record.getAttributeAsInt("resourceId"));
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.components.table.ResourceAuthorizedTableAction

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.