Package org.rhq.coregui.client.components.form

Examples of org.rhq.coregui.client.components.form.RadioGroupWithComponentsItem$RGWCCanvas


                items.put(MSG.view_admin_plugins_update_on_agents_delayed(), delayForm);
                items.put(MSG.view_admin_plugins_update_on_agents_scheduled(), scheduleForm);

                DynamicForm form = new DynamicForm();
                form.setWidth(300);
                final RadioGroupWithComponentsItem scheduling = new RadioGroupWithComponentsItem("scheduling", "", items, form);

                form.setFields(scheduling);

                layout.addMember(form);

                ButtonItem ok = new ButtonItem("ok", MSG.common_button_ok());
                ok.setEndRow(false);
                ok.setAlign(Alignment.RIGHT);
                ButtonItem cancel = new ButtonItem("cancel", MSG.common_button_cancel());
                cancel.setStartRow(false);
                cancel.setAlign(Alignment.LEFT);

                DynamicForm buttons = new DynamicForm();
                buttons.setNumCols(2);
                buttons.setFields(ok, cancel);

                layout.addMember(buttons);

                ok.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
                    @Override
                    public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) {
                        long delay;
                        if (MSG.view_admin_plugins_update_on_agents_now().equals(scheduling.getSelected())) {
                            delay = 0;
                        } else if (MSG.view_admin_plugins_update_on_agents_delayed().equals(scheduling.getSelected())) {
                            Integer value = (Integer) startDelay.getValue();
                            TimeUnit u = startDelay.getValueUnit();

                            if (value == null) {
                                CoreGUI.getErrorHandler()
                                    .handleError(MSG.view_admin_plugins_update_on_agents_no_time_specified());
                                w.hide();
                                return;
                            }

                            delay = value;
                            switch (u) {
                            case SECONDS:
                                delay *= 1000;
                                break;
                            case MINUTES:
                                delay *= 60 * 1000;
                                break;
                            case HOURS:
                                delay *= 60 * 60 * 1000;
                                break;
                            case DAYS:
                                delay *= 24 * 60 * 60 * 1000;
                                break;
                            }
                        } else {
                            Date scheduledDate = schedule.getValueAsDate();
                            delay = scheduledDate.getTime() - new Date().getTime();
                        }

                        GWT.log("About to schedule update of the plugins on the agent in " + delay + " milliseconds.");

                        GWTServiceLookup.getPluginService().updatePluginsOnAgents(delay, new AsyncCallback<Void>() {
                            @Override
                            public void onFailure(Throwable caught) {
                                CoreGUI.getErrorHandler().handleError(
                                    MSG.view_admin_plugins_update_on_agents_failure() + " " +
                                        caught.getMessage(), caught);
                                w.hide();
                            }

                            @Override
                            public void onSuccess(Void result) {
                                w.hide();
                            }
                        });
                    }
                });

                scheduling.setValue(MSG.view_admin_plugins_update_on_agents_now());

                cancel.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
                    @Override
                    public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) {
                        w.hide();
View Full Code Here


                    LinkedHashMap<String, DynamicForm> packageSelectItems = new LinkedHashMap<String, DynamicForm>();
                    packageSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_existingScript(),
                        createExistingPackageForm());
                    packageSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_uploadNewScript(),
                        createUploadNewScriptForm());
                    packageSelector = new RadioGroupWithComponentsItem("packageSelector", "", packageSelectItems, form);
                    packageSelector.setWidth("100%");

                    LinkedHashMap<String, DynamicForm> userSelectItems = new LinkedHashMap<String, DynamicForm>();
                    userSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_thisUser(), null);
                    userSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_anotherUser(),
                        createAnotherUserForm());
                    userSelector = new RadioGroupWithComponentsItem("userSelector", "", userSelectItems, form);
                    userSelector.setWidth("100%");
                    userSelector.setShowTitle(false);

                    repoSection.setItemIds("repoSelector");
                    packageSection.setItemIds("packageSelector");
View Full Code Here

            radioItems.put(UPLOAD_OPTION, createUploadForm());
            radioItems.put(RECIPE_OPTION, createRecipeForm());

            mainCanvasForm = new RadioDynamicForm();

            radioGroup = new RadioGroupWithComponentsItem("bundleDistRadioGroup",
                MSG.view_bundle_createWizard_bundleDistro(), radioItems, mainCanvasForm);
            radioGroup.setShowTitle(false);

            mainCanvasForm.setItems(radioGroup);
        }
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.components.form.RadioGroupWithComponentsItem$RGWCCanvas

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.