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

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


            }
        }

        if (null == idsToImport) {
            CoreGUI.getMessageCenter().notify(
                new Message(MSG.view_autoDiscoveryQ_importSuccessful(), Message.Severity.Info));
            refresh();
            return;
        }

        importResourceService.importResources(idsToImport, new AsyncCallback<Void>() {
View Full Code Here


        }

        @Override
        public void onFailure(Throwable throwable) {
            CoreGUI.getMessageCenter().notify(
                new Message(MSG.view_operationScheduleDetails_load_example_failure(), throwable, Severity.Warning));
            latch.countDown();
        }
View Full Code Here

        @Override
        public void onSuccess(PageList<GroupOperationHistory> groupOperationHistories) {
            if (groupOperationHistories.getTotalSize() == 0) {
                CoreGUI.getMessageCenter().notify(
                    new Message(MSG.view_operationScheduleDetails_example_not_found(), Severity.Warning));
            } else if (groupOperationHistories.getTotalSize() != 1) {
                CoreGUI.getMessageCenter().notify(
                    new Message(MSG.view_operationScheduleDetails_example_not_unique(), Severity.Warning));
            } else {
                operationExample = groupOperationHistories.get(0);
            }
            latch.countDown();
        }
View Full Code Here

                        CoreGUI.getErrorHandler().handleError(MSG.view_resource_title_tagUpdateFailed(), caught);
                    }

                    public void onSuccess(Void result) {
                        CoreGUI.getMessageCenter().notify(
                            new Message(MSG.view_titleBar_common_updateTagsSuccessful(resource.getName()),
                                Message.Severity.Info));
                        // update what is essentially our local cache
                        resource.setTags(tags);
                    }
                });
View Full Code Here

            if (favorite) {
                msg = MSG.view_titleBar_common_addedFav(resource.getName());
            } else {
                msg = MSG.view_titleBar_common_removedFav(resource.getName());
            }
            CoreGUI.getMessageCenter().notify(new Message(msg, Message.Severity.Info));
            updateFavoriteButton();
        }
View Full Code Here

                            public void onSuccess(Void result) {
                                titleBar.displayGroupName(newName);

                                CoreGUI.getMessageCenter().notify(
                                    new Message(MSG.view_group_summary_nameUpdateSuccessful(
                                        String.valueOf(group.getId()), oldName, newName), Message.Severity.Info));
                            }
                        });
                }
            });
            nameItem = togglableNameItem;
        } else {
            StaticTextItem staticNameItem = new StaticTextItem();
            staticNameItem.setEscapeHTML(true);
            nameItem = staticNameItem;
        }

        nameItem.setName("name");
        nameItem.setTitle(MSG.common_title_name());
        nameItem.setValue(group.getName());

        formItems.add(nameItem);

        StaticTextItem typeItem = new StaticTextItem("memberType", MSG.view_group_summary_memberType());
        ResourceType type = group.getResourceType();
        if (type != null) {
            // compatible group
            typeItem.setTooltip(MSG.common_title_plugin() + ": " + type.getPlugin() + "\n<br>"
                + MSG.common_title_type() + ": " + type.getName());
            typeItem.setValue(type.getName() + " (" + type.getPlugin() + ")");
        } else {
            // mixed group
            typeItem.setValue("<i>" + MSG.view_group_summary_mixed() + "</i>");
        }
        formItems.add(typeItem);

        StaticTextItem countItem = new StaticTextItem("memberCount", MSG.view_group_summary_memberCount());
        long memberCount = this.groupComposite.getImplicitCount();
        countItem.setValue(memberCount);
        formItems.add(countItem);

        final FormItem descriptionItem;
        String value;
        if (canEdit) {
            final EditableFormItem togglableDescriptionItem = new EditableFormItem();
            togglableDescriptionItem.setValidators(notNullValidator);
            togglableDescriptionItem.setValueEditedHandler(new ValueEditedHandler() {
                public void editedValue(Object newValue) {
                    final String newDescription = newValue.toString();
                    final String oldDescription = group.getDescription();
                    if (newDescription.equals(oldDescription)) {
                        return;
                    }
                    group.setDescription(newDescription);
                    GeneralProperties.this.resourceGroupService.updateResourceGroup(group, false,
                        new AsyncCallback<Void>() {
                            public void onFailure(Throwable caught) {
                                CoreGUI.getErrorHandler().handleError(
                                    MSG.view_group_summary_descUpdateFailure(String.valueOf(group.getId())), caught);
                                // We failed to update it on the Server, so change back the ResourceGroup and the form item
                                // to the original value.
                                group.setDescription(oldDescription);
                                togglableDescriptionItem.setValue(oldDescription);
                            }

                            public void onSuccess(Void result) {
                                CoreGUI.getMessageCenter().notify(
                                    new Message(MSG.view_group_summary_descUpdateSuccessful(), Message.Severity.Info));
                            }
                        });
                }
            });
            descriptionItem = togglableDescriptionItem;
            value = group.getDescription();
        } else {
            descriptionItem = new StaticTextItem();
            value = StringUtility.escapeHtml(group.getDescription());
        }

        descriptionItem.setName("description");
        descriptionItem.setTitle(MSG.common_title_description());
        descriptionItem.setValue(value);

        formItems.add(descriptionItem);

        StaticTextItem dynamicItem = new StaticTextItem("dynamic", MSG.view_group_summary_dynamic());
        dynamicItem.setValue(isDynaGroup ? MSG.common_val_yes() : MSG.common_val_no());
        formItems.add(dynamicItem);

        FormItem recursiveItem;
        if (canEdit) {
            CheckboxEditableFormItem editableRecursiveItem = new CheckboxEditableFormItem("recursive",
                MSG.view_group_summary_recursive());
            editableRecursiveItem.setValueEditedHandler(new ValueEditedHandler() {
                public void editedValue(Object newValue) {
                    boolean isRecursive = ((newValue != null) && (Boolean) newValue);
                    resourceGroupService.setRecursive(group.getId(), isRecursive, new AsyncCallback<Void>() {
                        public void onSuccess(Void result) {
                            CoreGUI.getMessageCenter().notify(
                                new Message(MSG.view_group_detail_recursiveChange(group.getName())));
                        }

                        public void onFailure(Throwable caught) {
                            CoreGUI.getErrorHandler().handleError(
                                MSG.view_group_detail_failRecursiveChange(String.valueOf(group.getName())));
View Full Code Here

        }

        @Override
        public void onFailure(Throwable throwable) {
            CoreGUI.getMessageCenter().notify(
                new Message(MSG.view_operationScheduleDetails_load_example_failure(), throwable, Severity.Warning));
            latch.countDown();
        }
View Full Code Here

        @Override
        public void onSuccess(PageList<ResourceOperationHistory> resourceOperationHistories) {
            if (resourceOperationHistories.getTotalSize() == 0) {
                CoreGUI.getMessageCenter().notify(
                    new Message(MSG.view_operationScheduleDetails_example_not_found(), Severity.Warning));
            } else if (resourceOperationHistories.getTotalSize() != 1) {
                CoreGUI.getMessageCenter().notify(
                    new Message(MSG.view_operationScheduleDetails_example_not_unique(), Severity.Warning));
            } else {
                operationExample = resourceOperationHistories.get(0);
            }
            latch.countDown();
        }
View Full Code Here

            // the user must have created it already after verification step, delete it, if possible
            BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService();
            bundleServer.deleteBundleVersion(bv.getId(), true, new AsyncCallback<Void>() {
                public void onSuccess(Void result) {
                    CoreGUI.getMessageCenter().notify(
                        new Message(MSG.view_bundle_createWizard_cancelSuccessful(bv.getName(), bv.getVersion()),
                            Severity.Info));
                }

                public void onFailure(Throwable caught) {
                    String msg = MSG.view_bundle_createWizard_cancelFailure(bv.getName(), bv.getVersion());
View Full Code Here

        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                affinityGroup.setName(nameItem.getValueAsString());
                GWTServiceLookup.getTopologyService().updateAffinityGroup(affinityGroup, new AsyncCallback<Void>() {
                    public void onSuccess(Void result) {
                        Message msg = new Message(MSG.view_adminTopology_message_agroupRenamed(
                            String.valueOf(affinityGroupId), affinityGroup.getName(), nameItem.getValueAsString()),
                            Message.Severity.Info);
                        CoreGUI.getMessageCenter().notify(msg);
                    }
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.