Package org.rhq.coregui.client

Examples of org.rhq.coregui.client.PopupWindow


        textArea.setHeight("*");

        form.setItems(textArea);
        layout.addMember(form);

        PopupWindow window = new PopupWindow(layout);
        window.setIsModal(false);
        window.setTitle(path + ":" + version);

        return window;
    }
View Full Code Here


                @Override
                public void executeAction(ListGridRecord[] selection, Object actionValue) {
                    ResourceResourceGroupsView membershipView = new ResourceResourceGroupsView(
                        ResourceGroupListView.this.resourceIdToModify.intValue());

                    final PopupWindow winModal = new PopupWindow(membershipView);
                    winModal.setTitle(MSG.view_tabs_common_group_membership());
                    winModal.setWidth(700);
                    winModal.setHeight(450);
                    winModal.addCloseClickHandler(new CloseClickHandler() {
                        public void onCloseClick(CloseClickEvent event) {
                            refreshTableInfo(); // make sure we re-enable the footer buttons in case user canceled
                        }
                    });

                    membershipView.setSaveButtonHandler(new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
                            winModal.markForDestroy();
                            CoreGUI.refresh();
                        }
                    });

                    winModal.show();
                }
            });
        }

        setListGridDoubleClickHandler(new DoubleClickHandler() {
View Full Code Here

        IButton updateOnAgentsButton = new EnhancedIButton(MSG.view_admin_plugins_update_on_agents(), ButtonColor.BLUE);
        updateOnAgentsButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                VLayout layout = new VLayout();
                final PopupWindow w = new PopupWindow(null);

                Canvas nowCanvas = new Canvas();
                nowCanvas.setWidth(1);
                nowCanvas.setHeight(1);


                DynamicForm delayForm = new DynamicForm();
                delayForm.setTitleOrientation(TitleOrientation.TOP);
                TreeSet<TimeUnit> timeUnits = new TreeSet<TimeUnit>();
                timeUnits.add(TimeUnit.SECONDS);
                timeUnits.add(TimeUnit.MINUTES);
                timeUnits.add(TimeUnit.HOURS);
                timeUnits.add(TimeUnit.DAYS);
                final DurationItem startDelay = new DurationItem("duration", "", timeUnits, false, false);

                delayForm.setFields(startDelay);

                DynamicForm scheduleForm = new DynamicForm();

                final DateTimeItem schedule = new DateTimeItem("schedule");
                schedule.setEnforceDate(true);
                schedule.setCenturyThreshold(99);
                schedule.setShowTitle(false);
                schedule.setStartDate(new Date());
                schedule.setUseMask(true);
                schedule.setShowHint(true);

                scheduleForm.setFields(schedule);


                LinkedHashMap<String, Canvas> items = new LinkedHashMap<String, Canvas>();
                items.put(MSG.view_admin_plugins_update_on_agents_now(), nowCanvas);
                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();
                    }
                });

                w.addItem(layout);

                w.setTitle(MSG.view_admin_plugins_update_on_agents());
                w.setHeight(200);
                w.setWidth(340);
                w.show();
            }

        });

        IButton scanForUpdatesButton = new EnhancedIButton(MSG.view_admin_plugins_scan());
View Full Code Here

    }

    private void showRemoteAgentInstallView(AgentInstall ai, String title, RemoteAgentInstallView.Type type, RemoteAgentInstallView.SuccessHandler successHandler) {
        remoteAgentView = new RemoteAgentInstallView(ai, type);
        remoteAgentView.setSuccessHandler(successHandler);
        popupWindow = new PopupWindow(remoteAgentView);
        popupWindow.setTitle(title);
        popupWindow.setHeight(350);
        popupWindow.setWidth(850);
        popupWindow.show();
        refreshTableInfo();
View Full Code Here

    }

    private void displayMemberValuesEditor(final PropertyDefinitionSimple propertyDefinitionSimple,
        final PropertySimple aggregatePropertySimple, Integer index, final FormItem aggregateValueItem) {

        final PopupWindow popup = new PopupWindow(null);
        popup.setTitle(MSG.view_groupConfigEdit_valsDiffForProp(propertyDefinitionSimple.getName()));
        popup.setWidth(800);
        popup.setHeight(600);

        EnhancedVLayout layout = buildMemberEditor(propertyDefinitionSimple, aggregatePropertySimple, index,
            aggregateValueItem, popup);

        popup.addItem(layout);
        popup.show();
    }
View Full Code Here

        canvasItem.setCanvas(canvas);

        form.setItems(canvasItem);
        layout.addMember(form);

        PopupWindow window = new PopupWindow(layout);
        window.setTitle(path + ":" + oldVersion + ":" + newVersion);
        window.setIsModal(false);

        return window;
    }
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.PopupWindow

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.