Package com.smartgwt.client.widgets.form

Examples of com.smartgwt.client.widgets.form.DynamicForm


        return MSG.view_bundle_revertWizard_getInfoStep_name();
    }

    public Canvas getCanvas() {
        if (form == null) {
            form = new DynamicForm();
            form.setWidth100();
            form.setNumCols(2);
            form.setColWidths("50%", "*");

            bundleServer.getBundleDeploymentName(wizard.getDestination().getId(), -1, wizard.getPreviousDeployment()
View Full Code Here


    }

    @Override
    protected DynamicForm getAvailableFilterForm() {
        if (null == availableFilterForm) {
            availableFilterForm = new DynamicForm();
            availableFilterForm.setNumCols(6);
            availableFilterForm.setWidth("75%");
            final TextItem search = new TextItem("search", MSG.common_title_search());
            final SelectItem categorySelect;
View Full Code Here

    private void setLayout() {

        final BundleDeployment live = this.wizard.getLiveDeployment();
        final BundleDeployment prev = this.wizard.getPreviousDeployment();

        DynamicForm liveForm = new DynamicForm();
        liveForm.setNumCols(2);
        liveForm.setIsGroup(true);
        liveForm.setGroupTitle("<b>" + MSG.view_bundle_revertWizard_confirmStep_liveDeployment() + "<b>");

        StaticTextItem liveNameItem = new StaticTextItem("liveName", MSG.common_title_name());
        liveNameItem.setTitleAlign(Alignment.LEFT);
        liveNameItem.setAlign(Alignment.LEFT);
        liveNameItem.setWrap(false);
        liveNameItem.setWrapTitle(false);
        liveNameItem.setValue(live.getName());
        liveNameItem.setLeft(20);

        StaticTextItem liveDescItem = new StaticTextItem("liveDesc", MSG.common_title_description());
        liveDescItem.setTitleAlign(Alignment.LEFT);
        liveDescItem.setAlign(Alignment.LEFT);
        liveDescItem.setWrap(true);
        liveDescItem.setWrapTitle(false);
        liveDescItem.setVAlign(VerticalAlignment.TOP);
        liveDescItem.setTitleVAlign(VerticalAlignment.TOP);
        liveDescItem.setValue((null != live.getDescription()) ? live.getDescription() : MSG.common_val_none());

        StaticTextItem liveVersionItem = new StaticTextItem("liveVersion", MSG.view_bundle_bundleVersion());
        liveVersionItem.setTitleAlign(Alignment.LEFT);
        liveVersionItem.setAlign(Alignment.LEFT);
        liveVersionItem.setWrap(false);
        liveVersionItem.setWrapTitle(false);
        liveVersionItem.setValue(live.getBundleVersion().getVersion());

        liveForm.setItems(liveNameItem, liveVersionItem, liveDescItem);
        layout.addMember(liveForm);

        if (prev != null) {
            final DynamicForm prevForm = new DynamicForm();
            prevForm.setNumCols(2);
            prevForm.setIsGroup(true);
            prevForm.setGroupTitle("<b>" + MSG.view_bundle_revertWizard_confirmStep_prevDeployment() + "<b>");

            StaticTextItem prevNameItem = new StaticTextItem("prevName", MSG.common_title_name());
            prevNameItem.setTitleAlign(Alignment.LEFT);
            prevNameItem.setAlign(Alignment.LEFT);
            prevNameItem.setWrap(false);
            prevNameItem.setWrapTitle(false);
            prevNameItem.setValue(prev.getName());

            StaticTextItem prevDescItem = new StaticTextItem("prevDesc", MSG.common_title_description());
            prevDescItem.setTitleAlign(Alignment.LEFT);
            prevDescItem.setAlign(Alignment.LEFT);
            prevDescItem.setWrap(true);
            prevDescItem.setWrapTitle(false);
            prevDescItem.setTitleVAlign(VerticalAlignment.TOP);
            prevDescItem.setVAlign(VerticalAlignment.TOP);
            prevDescItem.setValue((null != prev.getDescription()) ? prev.getDescription() : MSG.common_val_none());

            final StaticTextItem prevVersionItem = new StaticTextItem("prevVersion", MSG.view_bundle_bundleVersion());
            prevVersionItem.setTitleAlign(Alignment.LEFT);
            prevVersionItem.setAlign(Alignment.LEFT);
            prevVersionItem.setWrap(false);
            prevVersionItem.setWrapTitle(false);
            if (prev.getBundleVersion().getVersion() == null) {
                BundleVersionCriteria c = new BundleVersionCriteria();
                c.addFilterId(prev.getBundleVersion().getId());
                bundleServer.findBundleVersionsByCriteria(c, new AsyncCallback<PageList<BundleVersion>>() {

                    @Override
                    public void onSuccess(PageList<BundleVersion> result) {
                        if (result != null && result.size() == 1) {
                            prevVersionItem.setValue(result.get(0).getVersion());
                            prevForm.markForRedraw();
                        }
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        prevVersionItem.setValue("?");
                        prevForm.markForRedraw();
                    }
                });
            } else {
                prevVersionItem.setValue(prev.getBundleVersion().getVersion());
            }

            prevForm.setItems(prevNameItem, prevVersionItem, prevDescItem);
            layout.addMember(prevForm);
        }

        Label confirmation = new Label();
        confirmation.setContents("<b>" + MSG.view_bundle_revertWizard_confirmStep_confirmation() + "</b>");
View Full Code Here

        markForRedraw();
    }

    private DynamicForm createSummaryForm() {

        DynamicForm form = new DynamicForm();
        form.setWidth100();
        form.setColWidths("20%", "40%", "40%");
        form.setNumCols(3);
        form.setAutoHeight();
        form.setWrapItemTitles(false);
        form.setExtraSpace(10);
        form.setIsGroup(true);
        form.setGroupTitle(MSG.common_title_summary());
        form.setPadding(5);

        CanvasItem actionItem = new CanvasItem("actions");
        actionItem.setColSpan(1);
        actionItem.setRowSpan(4);
        actionItem.setShowTitle(false);
        actionItem.setCanvas(getActionLayout());

        StaticTextItem versionItem = new StaticTextItem("version", MSG.common_title_version());
        versionItem.setValue(version.getVersion());

        StaticTextItem liveDeploymentsItem = new StaticTextItem("deployments", MSG.view_bundle_deployments());
        liveDeploymentsItem.setValue(version.getBundleDeployments().size());

        StaticTextItem filesItems = new StaticTextItem("files", MSG.view_bundle_files());
        filesItems.setValue(version.getBundleFiles().size());

        StaticTextItem descriptionItem = new StaticTextItem("description", MSG.common_title_description());
        descriptionItem.setValue(version.getDescription());

        form.setFields(versionItem, actionItem, liveDeploymentsItem, filesItems, descriptionItem);
        return form;
    }
View Full Code Here

        this.idsFilter = idsFilter;
    }

    protected DynamicForm getAvailableFilterForm() {
        DynamicForm availableFilterForm = new DynamicForm();
        availableFilterForm.setNumCols(4);
        final TextItem search = new TextItem("search", MSG.common_title_search());

        availableFilterForm.setItems(search);

        return availableFilterForm;
    }
View Full Code Here

        return tagEditor;
    }

    private Tab createRecipeTab() {
        Tab tab = new Tab(MSG.view_bundle_recipe());
        DynamicForm form = new DynamicForm();

        TextAreaItem recipeCanvas = new TextAreaItem("recipe", MSG.view_bundle_recipe());
        recipeCanvas.setShowTitle(false);
        recipeCanvas.setColSpan(2);
        recipeCanvas.setWidth("100%");
        recipeCanvas.setHeight("100%");
        recipeCanvas.setValue(version.getRecipe());
        recipeCanvas.addChangeHandler(new ChangeHandler() {
            @Override
            public void onChange(ChangeEvent event) {
                // makes this read-only; however, since its not disabled, user can still select/copy the text
                event.cancel();
            }
        });

        form.setHeight100();
        form.setWidth100();
        form.setItems(recipeCanvas);
        tab.setPane(form);
        return tab;
    }
View Full Code Here

        return MSG.view_bundle_deployWizard_selectVersionStep();
    }

    public Canvas getCanvas() {
        if (form == null) {
            form = new DynamicForm();
            form.setWidth100();
            form.setNumCols(2);
            form.setColWidths("50%", "*");

            setItemValues();
View Full Code Here

                }

                public void onSuccess(PackageTypeAndVersionFormatComposite result) {
                    cliScriptPackageType = result;

                    DynamicForm form = new DynamicForm();
                    form.setTitleOrientation(TitleOrientation.TOP);
                    form.setWidth(500);

                    SectionItem repoSection = new SectionItem("repoSection");
                    repoSection.setDefaultValue(MSG.view_alert_definition_notification_cliScript_editor_repository());
                    repoSection.setWidth("100%");
                    SectionItem packageSection = new SectionItem("packageSection");
                    packageSection.setDefaultValue(MSG.view_alert_definition_notification_cliScript_editor_script());
                    SectionItem userSection = new SectionItem("userSection");
                    userSection.setDefaultValue(MSG.view_alert_definition_notification_cliScript_editor_whichUser());

                    repoSelector = new SortedSelectItem("repoSelector",
                        MSG.view_alert_definition_notification_cliScript_editor_selectRepo());
                    repoSelector.setDefaultToFirstOption(true);
                    repoSelector.setWrapTitle(false);
                    repoSelector.setWidth(400);
                    repoSelector.setValueMap(MSG.common_msg_loading());
                    repoSelector.setDisabled(true);

                    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");
                    userSection.setItemIds("userSelector");

                    form.setFields(userSection, userSelector, repoSection, repoSelector, packageSection,
                        packageSelector);

                    addMember(form);

                    loadConfig(new AsyncCallback<Config>() {
View Full Code Here

    }

    private void setupUserSelector() {
        if (config.selectedSubject != null && !UserSessionManager.getSessionSubject().equals(config.selectedSubject)) {
            userSelector.setSelected(MSG.view_alert_definition_notification_cliScript_editor_anotherUser());
            DynamicForm anotherUserForm = (DynamicForm) userSelector.getSelectedComponent();
            anotherUserForm.getItem("userName").setValue(config.selectedSubject.getName());
        } else {
            userSelector.setSelected(MSG.view_alert_definition_notification_cliScript_editor_thisUser());
        }
        markForRedraw();
    }
View Full Code Here

            --config.__handlerCounter;
        }
    }

    private DynamicForm createAnotherUserForm() {
        DynamicForm form = new DynamicForm();
        form.setTitleOrientation(TitleOrientation.TOP);
        anotherUserName = new TextItem("userName", MSG.common_title_username());
        anotherUserPassword = new PasswordItem("password", MSG.common_title_password());
        anotherUserPassword.setAttribute("autocomplete", "off");
        verifyUserButton = new ButtonItem("verify",
            MSG.view_alert_definition_notification_cliScript_editor_verifyAuthentication());

        successIcon = new FormItemIcon();
        successIcon.setSrc(ImageManager.getAvailabilityIcon(Boolean.TRUE));
        successIcon.setWidth(16);
        successIcon.setHeight(16);

        failureIcon = new FormItemIcon();
        failureIcon.setSrc(ImageManager.getAvailabilityIcon(Boolean.FALSE));
        failureIcon.setWidth(16);
        failureIcon.setHeight(16);

        form.setFields(anotherUserName, anotherUserPassword, verifyUserButton);

        verifyUserButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                //just checking the auth is ok, no other action is needed.
                checkAuthenticationAndDo(new AsyncCallback<Void>() {
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.DynamicForm

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.