Package org.rhq.coregui.client.util.message

Examples of org.rhq.coregui.client.util.message.Message


                ResourceGroupGWTServiceAsync groupManager = GWTServiceLookup.getResourceGroupService(60000);
                groupManager.deleteGroupDefinitions(groupDefinitionIds, new AsyncCallback<Void>() {
                    @Override
                    public void onSuccess(Void result) {
                        CoreGUI.getMessageCenter().notify(
                            new Message(MSG.view_dynagroup_deleteSuccessfulSelection(String
                                .valueOf(groupDefinitionIds.length)), Severity.Info));
                        GroupDefinitionListView.this.refresh();
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(MSG.view_dynagroup_deleteFailureSelection(), caught);
                    }
                });
            }
        });

        addTableAction(MSG.common_button_new(), null, ButtonColor.BLUE, new AbstractTableAction() {
            public void executeAction(ListGridRecord[] selection, Object actionValue) {
                newDetails();
            }
        });

        addTableAction(MSG.view_dynagroup_recalculate(), null, ButtonColor.GRAY, new AbstractTableAction(TableActionEnablement.ANY) {
            public void executeAction(ListGridRecord[] selection, Object actionValue) {
                final int[] groupDefinitionIds = TableUtility.getIds(selection);
                ResourceGroupGWTServiceAsync resourceGroupManager = GWTServiceLookup.getResourceGroupService();

                resourceGroupManager.recalculateGroupDefinitions(groupDefinitionIds, new AsyncCallback<Void>() {
                    public void onFailure(Throwable caught) {
                        if (caught instanceof DuplicateExpressionTypeException) {
                            CoreGUI.getMessageCenter().notify(
                                new Message(caught.getMessage(), Message.Severity.Warning));
                        } else {
                            CoreGUI.getErrorHandler().handleError(MSG.view_dynagroup_recalcFailureSelection(), caught);
                        }
                    }

                    public void onSuccess(Void result) {
                        CoreGUI.getMessageCenter().notify(
                            new Message(MSG.view_dynagroup_recalcSuccessfulSelection(String
                                .valueOf(groupDefinitionIds.length)), Severity.Info));
                        GroupDefinitionListView.this.refresh();
                    }
                });
            }
View Full Code Here


                    int i = 0;
                    for (ListGridRecord selected : selection) {
                        doomedIds[i++] = selected.getAttributeAsInt(AbstractConfigurationHistoryDataSource.Field.ID);
                        if (selected.getAttribute(AbstractConfigurationHistoryDataSource.Field.GROUP_CONFIG_UPDATE_ID) != null) {
                            CoreGUI.getMessageCenter().notify(
                                new Message(MSG.view_configurationHistoryList_cannotDeleteGroupItems(),
                                    Severity.Warning));
                            return; // abort
                        }
                        if (Boolean.parseBoolean(selected
                            .getAttribute(AbstractConfigurationHistoryDataSource.Field.CURRENT_CONFIG))) {
                            CoreGUI.getMessageCenter().notify(
                                new Message(MSG.view_configurationHistoryList_cannotDeleteCurrent(), Severity.Warning));
                            return; // abort
                        }
                    }
                    delete(doomedIds);
                }
View Full Code Here

    private void save() {
        updateSettings();
        GWTServiceLookup.getStorageService().updateClusterSettings(settings, new AsyncCallback<Void>() {
            public void onSuccess(Void result) {
                Message msg = new Message(MSG.view_adminTopology_storageNodes_clusterSettings_message_updateSuccess(),
                    Message.Severity.Info);
                CoreGUI.getMessageCenter().notify(msg);
            }

            public void onFailure(Throwable caught) {
View Full Code Here

        GWTServiceLookup.getConfigurationService().rollbackResourceConfiguration(getResourceId().intValue(),
            configHistoryIdToRollbackTo, new AsyncCallback<Void>() {
                @Override
                public void onSuccess(Void result) {
                    CoreGUI.getMessageCenter().notify(
                        new Message(MSG.view_configurationHistoryList_rollback_success(), Severity.Info));
                    refresh();
                }

                @Override
                public void onFailure(Throwable caught) {
View Full Code Here

        GWTServiceLookup.getConfigurationService().purgeResourceConfigurationUpdates(doomedIds, true,
            new AsyncCallback<Void>() {
                @Override
                public void onSuccess(Void result) {
                    CoreGUI.getMessageCenter().notify(
                        new Message(MSG.view_configurationHistoryList_delete_success(), Severity.Info));
                    refresh();
                }

                @Override
                public void onFailure(Throwable caught) {
View Full Code Here

                    caught);
            }

            public void onSuccess(Dashboard result) {
                CoreGUI.getMessageCenter().notify(
                    new Message(MSG.view_dashboardManager_success() + " " + result.getName(), Message.Severity.Info));
            }
        });

    }
View Full Code Here

        super.onDraw();

        refresh();

        if (!this.resourcePermission.isConfigureWrite()) {
            Message message = new Message(MSG.view_configurationDetails_noPermission(), Message.Severity.Info,
                EnumSet.of(Message.Option.Transient, Message.Option.Sticky));
            CoreGUI.getMessageCenter().notify(message);
        }
    }
View Full Code Here

    }

    private void doDeleteBundleVersion() {
        String deleteSubmittedMessage = MSG.view_bundle_version_deleteSubmitted(version.getVersion(), version
            .getBundle().getName());
        getMessageCenter().notify(new Message(deleteSubmittedMessage, Message.Severity.Info));
        final Duration duration = new Duration();
        bundleManager.deleteBundleVersion(version.getId(), false, new AsyncCallback<Void>() {
            @Override
            public void onFailure(final Throwable caught) {
                Timer timer = new Timer() {
                    @Override
                    public void run() {
                        String message = MSG.view_bundle_version_deleteFailure(version.getVersion());
                        getErrorHandler().handleError(message, caught);
                    }
                };
                // Delay the showing of the result to give the user some time to see the deleteSubmitted notif
                timer.schedule(Math.max(0, 3 * 1000 - duration.elapsedMillis()));
            }

            @Override
            public void onSuccess(Void result) {
                Timer timer = new Timer() {
                    @Override
                    public void run() {
                        String message = MSG.view_bundle_version_deleteSuccessful(version.getVersion());
                        getMessageCenter().notify(new Message(message, Message.Severity.Info));
                        // Bundle version is deleted, go back to main bundle view
                        goToView(LinkManager.getBundleVersionLink(version.getBundle().getId(), 0), true);
                    }
                };
                // Delay the showing of the result to give the user some time to see the deleteSubmitted notif
View Full Code Here

                        }

                        @Override
                        public void onSuccess(Void result) {
                            getMessageCenter().notify(
                                new Message(MSG.view_bundle_version_bundleVersionTagUpdateSuccessful(),
                                    Message.Severity.Info));
                        }
                    });
            }
        });
View Full Code Here

            GWTServiceLookup.getSystemService().setSystemSettings(settings, new AsyncCallback<Void>() {
                @Override
                public void onSuccess(Void result) {
                    CoreGUI.getMessageCenter().notify(
                        new Message(MSG.view_admin_systemSettings_savedSettings(), Message.Severity.Info));
                    //Now check to see if LDAP is enabled but just not available
                    GWTServiceLookup.getLdapService().checkLdapServerRequiresAttention(new AsyncCallback<Boolean>() {

                        @Override
                        public void onSuccess(Boolean requiresAttention) {
                            if (requiresAttention) {
                                CoreGUI.getMessageCenter().notify(
                                    new Message(MSG.view_admin_systemSettings_ldapNeedsAttention(),
                                        Message.Severity.Warning));
                            }//otherwise nothing to note.
                        }

                        @Override
                        public void onFailure(Throwable caught) {
                            CoreGUI.getErrorHandler().handleError(MSG.view_admin_systemSettings_ldapDownCheckFail(),
                                caught);
                        }

                    });
                }

                @Override
                public void onFailure(Throwable caught) {
                    CoreGUI.getErrorHandler().handleError(MSG.view_admin_systemSettings_saveFailure(), caught);
                }
            });
        } else {
            CoreGUI.getMessageCenter().notify(
                new Message(MSG.view_admin_systemSettings_fixBeforeSaving(), Severity.Warning, EnumSet
                    .of(Message.Option.Transient)));
        }
    }
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.util.message.Message

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.