Package org.rhq.coregui.client.util.enhanced

Examples of org.rhq.coregui.client.util.enhanced.EnhancedIButton


        column.addMember(hr);

        HStack row = new HStack();
        row.setMembersMargin(5);
        row.setAlign(VerticalAlignment.CENTER);
        IButton okButton = new EnhancedIButton(MSG.common_button_ok());
        okButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {

                //F5 refresh check? If they've reloaded the form for some reason then bail.
                boolean credentialsEmpty = ((user == null) || (user.trim().isEmpty()) || (password == null) || (password
                    .trim().isEmpty()));
                //check for session timeout
                if (UserSessionManager.isLoggedOut() || (credentialsEmpty)) {
                    resetLogin();
                    return;
                }

                //validation
                if (inputForm.validate()) {
                    Log.trace("Successfully validated all data for user registration.");
                    //populate form
                    if (first.getValue() != null)
                        inputForm.setValue(FIRST, String.valueOf(first.getValue()));
                    if (last.getValue() != null)
                        inputForm.setValue(LAST, String.valueOf(last.getValue()));
                    inputForm.setValue(USERNAME, String.valueOf(username.getValue()));
                    if (email.getValue() != null)
                        inputForm.setValue(EMAIL, String.valueOf(email.getValue()));
                    if (phone.getValue() != null)
                        inputForm.setValue(PHONE, String.valueOf(phone.getValue()));
                    if (department.getValue() != null)
                        inputForm.setValue(DEPARTMENT, String.valueOf(department.getValue()));
                    inputForm.setValue(SESSIONID, sessionId);
                    inputForm.setValue(PASSWORD, password);
                    registerLdapUser(inputForm, callback);
                }
            }

        });
        row.addMember(okButton);

        //prepopulate form from user details returned.
        Subject subject = UserSessionManager.getSessionSubject();
        first.setValue(subject.getFirstName());
        last.setValue(subject.getLastName());
        email.setValue(subject.getEmailAddress());
        phone.setValue(subject.getPhoneNumber());
        department.setValue(subject.getDepartment());

        IButton resetButton = new EnhancedIButton(MSG.common_button_reset());
        resetButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                //F5 refresh check? If they've reloaded the form for some reason then bail.
                boolean credentialsEmpty = ((user == null) || (user.trim().isEmpty()) || (password == null) || (password
                    .trim().isEmpty()));
                if (UserSessionManager.isLoggedOut() || credentialsEmpty) {
                    resetLogin();
                    return;
                }

                //clear out all validation messages.
                String empty = "                  ";
                first.setValue(empty);
                last.setValue(empty);
                email.setValue("test@test.com");
                inputForm.validate();
                first.clearValue();
                last.clearValue();
                email.clearValue();
                phone.clearValue();
                department.clearValue();
            }
        });
        row.addMember(resetButton);

        IButton cancelButton = new EnhancedIButton(MSG.common_button_cancel());
        cancelButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                UserSessionManager.logout();
                resetLogin();
            }
        });
View Full Code Here


        toolStrip.setHeight(34);

        toolStrip.addSpacer(10);

        for (DateTimeButton dateTimeButton : DateTimeButton.values()) {
            IButton oneHourButton = new EnhancedIButton(dateTimeButton.label);
            oneHourButton.setWidth(BUTTON_WIDTH);
            oneHourButton.setActionType(SelectionType.RADIO);
            oneHourButton.setRadioGroup(TIMERANGE);
            oneHourButton.addClickHandler(dateTimeButtonBarClickHandler);

            toolStrip.addMember(oneHourButton);
        }

        IButton customButton = new EnhancedIButton(MSG.common_buttonbar_custom());
        customButton.setWidth(60);
        customButton.setActionType(SelectionType.RADIO);
        customButton.setRadioGroup(TIMERANGE);
        customButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                CustomDateRangeWindow customDateRangeWindow = new CustomDateRangeWindow(MSG
                    .common_buttonbar_custom_window_title(), MSG.common_buttonbar_custom_window_subtitle(), self,
                    new Date(CustomDateRangeState.getInstance().getStartTime()), new Date(CustomDateRangeState
                        .getInstance().getEndTime()));
                CustomDateRangeState.getInstance().setCustomDateRangeActive(true);
                customDateRangeWindow.show();
            }
        });
        toolStrip.addMember(customButton);

        toolStrip.addSpacer(30);

        dateRangeLabel = new Label();
        dateRangeLabel.setWidth(400);
        dateRangeLabel.addStyleName("graphDateTimeRangeLabel");
        showUserFriendlyTimeRange(CustomDateRangeState.getInstance().getStartTime(), CustomDateRangeState.getInstance()
            .getEndTime());
        toolStrip.addMember(dateRangeLabel);

        // Only allow auto refresh rate change in views actually performing auto refresh, otherwise offer only refresh
        toolStrip.addSpacer(20);
        if (isAutoRefresh) {
            refreshIntervalMenu = new RefreshIntervalMenu((AutoRefresh)refreshable);
            toolStrip.addMember(refreshIntervalMenu);
        } else {
            this.refreshButton = new EnhancedIButton(MSG.common_button_refresh());
            refreshButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    redrawGraphs();
                }
            });
View Full Code Here

            addItem(startBeforeEndLabel);

            HLayout buttonHLayout = new HLayout();
            buttonHLayout.setMargin(35);
            buttonHLayout.setMembersMargin(20);
            IButton cancelButton = new EnhancedIButton(MSG.common_buttonbar_custom_cancel());
            cancelButton.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent clickEvent) {
                    CustomDateRangeWindow.this.destroy();
                }
            });
            buttonHLayout.addMember(cancelButton);

            IButton saveButton = new EnhancedIButton(MSG.common_buttonbar_custom_save(), ButtonColor.BLUE);
            saveButton.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent clickEvent) {
                    //@todo: eventually get rid of deprecated calls but not in 3.2.1 minor release
                    Date newStartDate = new Date(startDateItem.getValueAsDate().getYear(), startDateItem
                        .getValueAsDate().getMonth(), startDateItem.getValueAsDate().getDate(),
View Full Code Here

        for (final TableActionInfo tableAction : tableActions) {

            if (null == tableAction.getValueMap()) {
                // button action
                IButton button = new EnhancedIButton(tableAction.getTitle(), tableAction.getButtonColor());
                button.setTooltip(tableAction.getTooltip());
                button.setDisabled(true);
                button.setOverflow(Overflow.VISIBLE);
                button.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent clickEvent) {
                        disableAllFooterControls();
                        if (tableAction.getConfirmMessage() != null) {
                            String message = tableAction.getConfirmMessage().replaceAll("\\#",
                                String.valueOf(listGrid.getSelectedRecords().length));

                            SC.ask(message, new BooleanCallback() {
                                public void execute(Boolean confirmed) {
                                    if (null == confirmed) {
                                        refreshTableInfo();
                                    } else if (confirmed) {
                                        refreshTableInfo();
                                        tableAction.action.executeAction(listGrid.getSelectedRecords(), null);
                                    } else {
                                        refreshTableInfo();
                                    }
                                }
                            });
                        } else {
                            tableAction.action.executeAction(listGrid.getSelectedRecords(), null);
                        }
                    }
                });

                tableAction.actionCanvas = button;
                footer.addMember(button);

            } else {
                // menu action
                Menu menu = new Menu();
                final Map<String, Object> menuEntries = tableAction.getValueMap();
                for (final String key : menuEntries.keySet()) {
                    MenuItem item = new MenuItem(key);
                    item.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
                        public void onClick(MenuItemClickEvent event) {
                            disableAllFooterControls();
                            tableAction.getAction().executeAction(listGrid.getSelectedRecords(), menuEntries.get(key));
                        }
                    });
                    menu.addItem(item);
                }

                IMenuButton menuButton = new IMenuButton(tableAction.getTitle());
                menuButton.setID(EnhancedUtility.getSafeId("menuButton" + id + tableAction.getTitle()));
                menuButton.setTooltip(tableAction.getTooltip());
                menuButton.setMenu(menu);
                menuButton.setDisabled(true);
                menuButton.setAutoFit(true); // this makes it pretty tight, but maybe better than the default, which is pretty wide
                menuButton.setOverflow(Overflow.VISIBLE);
                menuButton.setShowMenuBelow(false);

                tableAction.actionCanvas = menuButton;
                footer.addMember(menuButton);
            }
        }

        for (Canvas extraWidgetCanvas : extraWidgetsInMainFooter) {
            footer.addMember(extraWidgetCanvas);
        }

        footer.addMember(new LayoutSpacer());

        if (isShowFooterRefresh()) {
            this.refreshButton = new EnhancedIButton(MSG.common_button_refresh());
      //            refreshButton.setOverflow(Overflow.VISIBLE);

            refreshButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    disableAllFooterControls();
View Full Code Here

        this.footer = new ToolStrip();
        footer.setPadding(5);
        footer.setWidth100();
        footer.setMembersMargin(15);
        footer.addMember(new LayoutSpacer());
        IButton refreshButton = new EnhancedIButton(MSG.common_button_refresh());
        refreshButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                loadData();
                refresh();
            }
        });
View Full Code Here

        buttonbar.setWidth100();
        buttonbar.setExtraSpace(10);
        buttonbar.setMembersMargin(5);
        buttonbar.setLayoutMargin(5);

        this.saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        this.saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
            }
        });
View Full Code Here

    private ToolStrip createButtonBar() {
        buttonBar = new ToolStrip();
        buttonBar.setWidth100();
        buttonBar.addMember(new LayoutSpacer());

        this.saveButton = new EnhancedIButton(MSG.common_button_save());
        this.saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
            }
        });
View Full Code Here

        buttonbar.setWidth100();
        buttonbar.setExtraSpace(10);
        buttonbar.setMembersMargin(5);
        buttonbar.setLayoutMargin(5);

        this.saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        this.saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
            }
        });
View Full Code Here

        EnhancedToolStrip toolStrip = new EnhancedToolStrip();
        toolStrip.setWidth100();

        toolStrip.addMember(new LayoutSpacer());

        this.saveButton = new EnhancedIButton(MSG.common_button_save());
        this.saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
            }
        });
View Full Code Here

        buttonbar.setWidth100();
        buttonbar.setExtraSpace(10);
        buttonbar.setMembersMargin(5);
        buttonbar.setLayoutMargin(5);

        this.saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        this.saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
            }
        });
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.util.enhanced.EnhancedIButton

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.