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

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


    private void buildRegistrationWindow(final String user, final String sessionId, final String password,
        final AsyncCallback<Subject> callback) {
        int fieldWidth = 120;

        //Build registration window.
        EnhancedVLayout column = new EnhancedVLayout();
        column.setMargin(25);
        HeaderItem header = new HeaderItem();
        //Locate product info for registration screen.
        if (productInfo != null) {
            header.setValue(MSG.view_login_welcomeMsg(productInfo.getName()));
        } else {//if not available, let registration continue. Errors already logged and no functionality lost.
            header.setValue(MSG.view_login_welcomeMsg(""));
        }
        header.setWidth("100%");
        //build ui elements for registration screen
        first = new TextItem(FIRST, MSG.dataSource_users_field_firstName());
        first.setRequired(true);
        first.setWrapTitle(false);
        first.setWidth(fieldWidth);
        last = new TextItem(LAST, MSG.dataSource_users_field_lastName());
        last.setWrapTitle(false);
        last.setWidth(fieldWidth);
        last.setRequired(true);
        final TextItem username = new TextItem(USERNAME, MSG.common_title_username());
        username.setValue(user);
        username.setDisabled(true);
        username.setWidth(fieldWidth);
        email = new TextItem(EMAIL, MSG.dataSource_users_field_emailAddress());
        email.setRequired(true);
        email.setWidth(fieldWidth);
        email.setWrapTitle(false);
        phone = new TextItem(PHONE, MSG.dataSource_users_field_phoneNumber());
        phone.setWidth(fieldWidth);
        phone.setWrapTitle(false);
        department = new TextItem(DEPARTMENT, MSG.dataSource_users_field_department());
        department.setWidth(fieldWidth);
        SpacerItem space = new SpacerItem();
        space.setColSpan(1);

        inputForm = new DynamicForm();
        inputForm.setAutoFocus(true);
        inputForm.setErrorOrientation(FormErrorOrientation.LEFT);
        inputForm.setNumCols(4);
        //moving header to it's own container for proper display. Didn't display right in production mode
        inputForm.setFields(username, first, last, email, phone, department);
        loadValidators(inputForm);
        inputForm.setValidateOnExit(true);
        DynamicForm headerWrapper = new DynamicForm();
        headerWrapper.setFields(header);
        column.addMember(headerWrapper);
        column.addMember(inputForm);

        HTMLFlow hr = new HTMLFlow("<br/><hr/><br/><br/>");
        hr.setWidth(620);
        hr.setAlign(Alignment.CENTER);
        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();
            }
        });
        row.addMember(cancelButton);
        Label logoutLabel = new Label(MSG.view_login_registerLater());
        logoutLabel.setWrap(false);
        row.addMember(logoutLabel);
        column.addMember(row);

        window = new Window();
        window.setWidth(670);
        window.setHeight(370);
        window.setTitle(MSG.view_login_registerUser());
View Full Code Here


        // This VLayout allows us to set overflow on it and be able to scroll the config editor but always
        // be able to see the wizard's next/cancel buttons. This vlayout also provides for easier expansion if we add more items.
        if (vLayout == null) {

            vLayout = new EnhancedVLayout();

            vLayout.setOverflow(Overflow.AUTO);

            Configuration startingConfig = wizard.getSnapshotDriftDef().getConfiguration();
            ConfigurationDefinition def = DriftConfigurationDefinition.getNewPinnedTemplateInstance();
View Full Code Here

    }

    public void setContent(Canvas newContent) {
        currentContent = newContent;
        if (newContent instanceof HasViewName) {
            EnhancedVLayout decoratedContent = decorateWithTitleBar(((HasViewName) newContent).getViewName(),
                newContent);
            contentCanvas.addChild(decoratedContent);
        } else {
            contentCanvas.addChild(newContent);
        }
View Full Code Here

    public Set<Permission> getGlobalPermissions() {
        return globalPermissions;
    }

    private EnhancedVLayout decorateWithTitleBar(ViewName viewName, Canvas pageBody){
        EnhancedVLayout vLayout = new EnhancedVLayout();
        vLayout.setWidth100();
        vLayout.setHeight100();
        // default to 24x24 otherwise use 16x16
        String iconPath = (viewName.getIcon().getIcon24x24Path() != null) ? viewName.getIcon().getIcon24x24Path() : viewName.getIcon().getIcon16x16Path();
        vLayout.addMember(new TitleBar(viewName.getTitle(), iconPath));
        vLayout.addMember(pageBody);
        return vLayout;

    }
View Full Code Here

     * @return the Layout for all of the Table contents
     * @see #configureTableContents(Layout)
     */
    protected EnhancedVLayout createTableContents() {
        if (null == contents) {
            contents = new EnhancedVLayout();
        }

        return contents;
    }
View Full Code Here

            this.titleCanvas = new HTMLFlow();
            updateTitleCanvas(this.titleString);

            if (showHeader) {
                // titleLayout not really needed now as TitleBar has a VLayout
                titleLayout = new EnhancedVLayout();
                titleLayout.setAutoHeight();
                titleLayout.setAlign(VerticalAlignment.BOTTOM);
                contents.addMember(titleLayout, 0);
            }
View Full Code Here

        form.setFields(items.toArray(new FormItem[items.size()]));
        addMember(form);

        // Parameters (if applicable)
        if (operationHistory.getParameters() != null) {
            EnhancedVLayout parametersSection = new EnhancedVLayout();

            Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_parameters() + "</h4>");
            title.setHeight(27);
            parametersSection.addMember(title);

            OperationDefinition operationDefinition = operationHistory.getOperationDefinition();
            ConfigurationDefinition parametersConfigurationDefinition = operationDefinition
                .getParametersConfigurationDefinition();
            if (parametersConfigurationDefinition != null
                && !parametersConfigurationDefinition.getPropertyDefinitions().isEmpty()) {
                ConfigurationEditor editor = new ConfigurationEditor(parametersConfigurationDefinition,
                    operationHistory.getParameters());
                editor.setReadOnly(true);
                parametersSection.addMember(editor);
            } else {
                Label noParametersLabel = new Label("This operation does not take any parameters.");
                noParametersLabel.setHeight(17);
                parametersSection.addMember(noParametersLabel);
            }

            addMember(parametersSection);
        }
View Full Code Here

    public TestTopView() {
        super(VIEW_ID.getName());
    }

    protected Canvas defaultView() {
        EnhancedVLayout vLayout = new EnhancedVLayout();
        vLayout.setWidth100();

        // TODO: Help icon.
        TitleBar titleBar = new TitleBar(MSG.view_testTop_title());
        vLayout.addMember(titleBar);

        Label label = new Label(MSG.view_testTop_description());
        label.setPadding(10);
        vLayout.addMember(label);

        return vLayout;
    }
View Full Code Here

    public Canvas getCanvas() {
        // This VLayout allows us to set overflow on it and be able to scroll the config editor but always
        // be able to see the wizard's next/cancel buttons. This vlayout also provides for easier expansion if we add more items.
        if (vLayout == null || !wizard.getNewStartingConfiguration().equals(startingConfig)) {

            vLayout = new EnhancedVLayout();

            vLayout.setOverflow(Overflow.AUTO);

            // keep a reference to the startingConfig in case the user navs back and changes it
            startingConfig = wizard.getNewStartingConfiguration();
View Full Code Here

        this.wizard = wizard;
    }

    public Canvas getCanvas() {
        if (null == canvas) {
            canvas = new EnhancedVLayout();
            canvas.setWidth100();

            radioForm = new DynamicForm();
            radioForm.setNumCols(1);
            // These settings (as opposed to setWidth100()) allow for contextual help to be better placed
View Full Code Here

TOP

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

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.