Package com.smartgwt.client.util

Examples of com.smartgwt.client.util.BooleanCallback


            // (one of two things - either the host fingerprint is not known and we should add it
            // or the host fingerprint has changed and we should change it), then ask the question
            // (which jsch has provided us and we put in the SSHSecurityException) and if the user
            // answers "yes" then do the work as we originally were asked to do.
            if (caught instanceof SSHSecurityException) {
                SC.ask(caught.getMessage(), new BooleanCallback() {
                    @Override
                    public void execute(Boolean value) {
                        if (value != null && value.booleanValue()) {
                            hostAuthorized = true; // the user has just authorized the host
                            doActualWork();
View Full Code Here


    @Override
    public void onRecordDoubleClick(RecordDoubleClickEvent event) {
        final Record record = event.getRecord();
        final String name = record.getAttribute(ATTR_NAME);

        SC.ask(MSG.view_searchBar_savedSearch_confirmDelete(name), new BooleanCallback() {
            public void execute(Boolean confirmed) {
                if (confirmed) {
                    Integer id = record.getAttributeAsInt(ATTR_ID);

                    GWTServiceLookup.getSearchService().deleteSavedSearch(id, new AsyncCallback<Void>() {
View Full Code Here

        final ParametrizedMessage success, final ParametrizedMessage failure, final StorageNodeOperation operationType) {
        final String operationName = (String) actionValue;
        final List<String> selectedAddresses = getSelectedAddresses(selections);
        String areYouSureQuestion = operationType == StorageNodeOperation.OTHER ? question.getMessage(operationName,
            selectedAddresses.toString()) : question.getMessage(selectedAddresses.toString());
        SC.ask(areYouSureQuestion, new BooleanCallback() {
            public void execute(Boolean confirmed) {
                if (confirmed) {
                    final CountDownLatch latch = CountDownLatch.create(selections.length, new Command() {
                        @Override
                        public void execute() {
View Full Code Here

    }
   
    private void saveFormCheckCannedExpr(final DynamicForm form, final DynaGroupChildrenView dynaGroupChildrenView,
        final boolean recalc) {
        if (this.groupDefinition.getCannedExpression() != null) {
            SC.ask(MSG.view_dynagroup_saveCannedDefWarning(this.groupDefinition.getCannedExpression().replaceAll(":.*", "")), new BooleanCallback() {
                public void execute(Boolean confirmed) {
                    if (confirmed) {
                        saveForm(form, dynaGroupChildrenView, recalc);
                    }
                }
View Full Code Here

                    if (StorageNodeConfigurationEditor.this.configuration.equals(configuration)) {
                        SC.say("Info", MSG.view_adminTopology_storageNodes_settings_noChanges());
                    } else {
                        SC.ask(
                            MSG.view_adminTopology_storageNodes_settings_confirmation(),
                            new BooleanCallback() {
                                @Override
                                public void execute(Boolean value) {
                                    if (value) {
                                        save(configuration);
                                    }
View Full Code Here

            public void onCloseClick(final TabCloseClickEvent tabCloseClickEvent) {
                tabCloseClickEvent.cancel();
                final DashboardView dashboardView = (DashboardView) tabCloseClickEvent.getTab().getPane();

                SC.ask(MSG.view_dashboards_confirm1() + " [" + dashboardView.getStoredDashboard().getName() + "]?",
                    new BooleanCallback() {
                        public void execute(Boolean confirmed) {
                            if (confirmed) {
                                dashboardsByName.remove(tabCloseClickEvent.getTab().getTitle());
                                tabSet.removeTab(tabCloseClickEvent.getTab());
                                dashboardView.delete();
View Full Code Here

        addTableAction(MSG.view_adminTopology_server_removeSelected(), ButtonColor.RED, new AuthorizedTableAction(this,
            TableActionEnablement.ANY, Permission.MANAGE_SETTINGS) {
            public void executeAction(final ListGridRecord[] selections, Object actionValue) {
                final List<String> selectedNames = getSelectedNames(selections);
                String message = MSG.view_adminTopology_message_removeAGroupsConfirm(selectedNames.toString());
                SC.ask(message, new BooleanCallback() {
                    public void execute(Boolean confirmed) {
                        if (confirmed) {
                            int[] selectedIds = getSelectedIds(selections);
                            GWTServiceLookup.getTopologyService().deleteAffinityGroups(selectedIds,
                                new AsyncCallback<Integer>() {
View Full Code Here

            IButton purgeButton = new EnhancedIButton(MSG.view_bundle_purge(), ButtonColor.RED);
            //purgeButton.setIcon("subsystems/bundle/BundleDestinationAction_Purge_16.png");
            purgeButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                @Override
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent) {
                    SC.ask(MSG.view_bundle_dest_purgeConfirm(), new BooleanCallback() {
                        @Override
                        public void execute(Boolean aBoolean) {
                            if (aBoolean) {
                                final int destinationId = deployment.getDestination().getId();
                                final String destinationName = deployment.getDestination().getName();
                                BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(600000); // 10m should be enough right?
                                bundleService.purgeBundleDestination(destinationId, new AsyncCallback<Void>() {
                                    @Override
                                    public void onFailure(Throwable caught) {
                                        getErrorHandler().handleError(
                                            MSG.view_bundle_dest_purgeFailure(destinationName), caught);
                                    }

                                    @Override
                                    public void onSuccess(Void result) {
                                        getMessageCenter().notify(
                                            new Message(MSG.view_bundle_dest_purgeSuccessful(destinationName),
                                                Message.Severity.Info));
                                        // Bundle destination is purged, go back to bundle deployment view - it is not live anymore
                                        goToView(
                                            LinkManager.getBundleDeploymentLink(bundle.getId(), deployment.getId()),
                                            true);
                                    }
                                });
                            }
                        }
                    });
                }
            });
            actionLayout.addMember(purgeButton);

            if (!canDeploy) {
                revertButton.setDisabled(true);
                purgeButton.setDisabled(true);
            }
        }

        IButton deleteButton = new EnhancedIButton(MSG.common_button_delete(), ButtonColor.RED);
        //deleteButton.setIcon("subsystems/bundle/BundleDeploymentAction_Delete_16.png");
        deleteButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                SC.ask(MSG.view_bundle_deploy_deleteConfirm(), new BooleanCallback() {
                    @Override
                    public void execute(Boolean confirmed) {
                        if (confirmed) {
                            doDeleteBundleDeployment();
                        }
View Full Code Here

                    final MissingPolicy newPolicy = MissingPolicy.valueOf((String) event.getValue());
                    String msg = MSG.view_adminConfig_missingResourcePolicy_confirm(getPolicyDisplay(newPolicy),
                        AncestryUtil.getFormattedType(type));

                    SC.ask(MSG.common_msg_areYouSure(), msg, new BooleanCallback() {
                        public void execute(Boolean value) {
                            if (Boolean.TRUE.equals(value)) {
                                // call server to flip flag on type
                                GWTServiceLookup.getResourceTypeGWTService().setResourceTypeMissingPolicy(type.getId(),
                                    newPolicy, new AsyncCallback<Void>() {
View Full Code Here


        IButton buttonConfirm = new IButton("Confirm");
        buttonConfirm.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                SC.confirm("Proceed with Operation get AJAX?", new BooleanCallback() {
                    public void execute(Boolean value) {
                        if (value != null && value) {
                            labelAnswer.setContents("OK");
                        } else {
                            labelAnswer.setContents("Cancel");
                        }
                    }
                });
            }
        });

        IButton buttonAsk = new IButton("Ask");
        buttonAsk.setLeft(150);
        buttonAsk.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                SC.ask("Are you going to stop writing great code?", new BooleanCallback() {
                    public void execute(Boolean value) {
                        if (value != null && value) {
                            labelAnswer.setContents("Yes");
                        } else {
                            labelAnswer.setContents("No");
View Full Code Here

TOP

Related Classes of com.smartgwt.client.util.BooleanCallback

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.