Creates the list of widgets for this dialog.<p>
495432
@Override
    protected void defineWidgets() {

        // initialize the user object to use for the dialog
        initUserObject();
        boolean webuserOu = false;
        try {
            webuserOu = OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), getParamOufqn()).hasFlagWebuser();
        } catch (CmsException e) {
            webuserOu = m_user.isWebuser();
        }
        setKeyPrefix(KEY_PREFIX);

        // widgets to display
        if (isNewUser() && isEditable(m_user)) {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsInputWidget()));
        } else {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsDisplayWidget()));
        }
        if (isEditable(m_user)) {
            addWidget(new CmsWidgetDialogParameter(this, "description", "", PAGES[0], new CmsTextareaWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "lastname", PAGES[0], new CmsInputWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "firstname", PAGES[0], new CmsInputWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "email", PAGES[0], new CmsInputWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "institution", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "address", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "zipcode", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "city", "", PAGES[0], new CmsInputWidget(), 0, 1));
            addWidget(new CmsWidgetDialogParameter(m_user, "country", "", PAGES[0], new CmsInputWidget(), 0, 1));
            if (!webuserOu) {
                addWidget(
                    new CmsWidgetDialogParameter(this, "language", PAGES[0], new CmsSelectWidget(getLanguages())));
                if (!getSites().isEmpty()) {
                    addWidget(new CmsWidgetDialogParameter(this, "site", PAGES[0], new CmsSelectWidget(getSites())));
                }
                addWidget(
                    new CmsWidgetDialogParameter(this, "startProject", PAGES[0], new CmsSelectWidget(getProjects())));
                addWidget(
                    new CmsWidgetDialogParameter(
                        this,
                        "startFolder",
                        PAGES[0],
                        new CmsVfsFileWidget(true, null, false)));
                addWidget(new CmsWidgetDialogParameter(this, "startView", PAGES[0], new CmsSelectWidget(getViews())));
                if (isNewUser()) {
                    addWidget(
                        new CmsWidgetDialogParameter(
                            this,
                            "group",
                            PAGES[0],
                            new CmsGroupWidget(null, null, getParamOufqn())));
                    addWidget(new CmsWidgetDialogParameter(this, "role", PAGES[0], new CmsSelectWidget(getRoles())));
                }
            }
        } else {
            addWidget(new CmsWidgetDialogParameter(this, "description", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "lastname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "firstname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "email", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "institution", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "address", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "zipcode", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "city", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "country", PAGES[0], new CmsDisplayWidget()));
            if (!webuserOu) {
                addWidget(new CmsWidgetDialogParameter(this, "language", PAGES[0], new CmsDisplayWidget()));
                if (!getSites().isEmpty()) {
                    addWidget(new CmsWidgetDialogParameter(this, "site", PAGES[0], new CmsDisplayWidget()));
                }
                addWidget(new CmsWidgetDialogParameter(this, "startProject", PAGES[0], new CmsDisplayWidget()));
                addWidget(new CmsWidgetDialogParameter(this, "startFolder", PAGES[0], new CmsDisplayWidget()));
                addWidget(new CmsWidgetDialogParameter(this, "startView", PAGES[0], new CmsDisplayWidget()));
            }
        }
        addWidget(new CmsWidgetDialogParameter(m_user, "enabled", PAGES[0], new CmsCheckboxWidget()));
        addWidget(new CmsWidgetDialogParameter(this, "selfManagement", PAGES[0], new CmsCheckboxWidget()));
        if (isPwdChangeAllowed(m_user)) {
            addWidget(new CmsWidgetDialogParameter(m_pwdInfo, "newPwd", PAGES[0], new CmsPasswordWidget()));
            addWidget(new CmsWidgetDialogParameter(m_pwdInfo, "confirmation", PAGES[0], new CmsPasswordWidget()));
        }
    }
701767
@Override
    protected void defineWidgets() {

        // initialize the object to use for the dialog
        initSynchronizeSettingsObject();
        setKeyPrefix(KEY_PREFIX);
        addWidget(new CmsWidgetDialogParameter(m_synchronizeSettings, "enabled", PAGES[0], new CmsCheckboxWidget()));
        addWidget(
            new CmsWidgetDialogParameter(
                m_synchronizeSettings,
                "destinationPathInRfs",
                PAGES[0],
                new CmsInputWidget()));
        addWidget(
            new CmsWidgetDialogParameter(
                m_synchronizeSettings,
                "sourceListInVfs",
                "/",
                PAGES[0],
                new CmsVfsFileWidget(false, ""),
                1,
                CmsWidgetDialogParameter.MAX_OCCURENCES));

    }
835522
@Override
    protected void defineWidgets() {

        super.defineWidgets();
        if (CmsStringUtil.isEmpty(m_module.getName())) {
            addWidget(new CmsWidgetDialogParameter(m_module, "name", PAGES[0], new CmsInputWidget()));
        } else {
            addWidget(new CmsWidgetDialogParameter(m_module, "name", PAGES[0], new CmsDisplayWidget()));
        }
        addWidget(new CmsWidgetDialogParameter(m_module, "niceName", PAGES[0], new CmsInputWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "description", PAGES[0], new CmsTextareaWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "version.version", PAGES[0], new CmsInputWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "group", PAGES[0], new CmsInputWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "actionClass", PAGES[0], new CmsInputWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "importScript", PAGES[0], new CmsTextareaWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "importSite", PAGES[0], new CmsInputWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "authorName", PAGES[0], new CmsInputWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "authorEmail", PAGES[0], new CmsInputWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "reducedExportMode", PAGES[0], new CmsCheckboxWidget()));
        // add the second page only when creating a new module
        if (CmsStringUtil.isEmpty(m_module.getName())) {
            addWidget(new CmsWidgetDialogParameter(m_module, "createModuleFolder", PAGES[0], new CmsCheckboxWidget()));
            addWidget(
                new CmsWidgetDialogParameter(m_module, "createTemplateFolder", PAGES[0], new CmsCheckboxWidget()));
            addWidget(
                new CmsWidgetDialogParameter(m_module, "createElementsFolder", PAGES[0], new CmsCheckboxWidget()));
            addWidget(
                new CmsWidgetDialogParameter(m_module, "createFormattersFolder", PAGES[0], new CmsCheckboxWidget()));
            addWidget(
                new CmsWidgetDialogParameter(m_module, "createResourcesFolder", PAGES[0], new CmsCheckboxWidget()));
            addWidget(new CmsWidgetDialogParameter(m_module, "createSchemasFolder", PAGES[0], new CmsCheckboxWidget()));
            addWidget(new CmsWidgetDialogParameter(m_module, "createClassesFolder", PAGES[0], new CmsCheckboxWidget()));
            addWidget(new CmsWidgetDialogParameter(m_module, "createLibFolder", PAGES[0], new CmsCheckboxWidget()));
        }
    }
81521
private List buildResourceTypeSelectWidgetList() {

        List fileFormats = new ArrayList();
        // get all OpenCms resource types
        List resourceTypes = OpenCms.getResourceManager().getResourceTypes();
        // put for every resource type type id and name into list object for select widget
        Iterator iter = resourceTypes.iterator();
        while (iter.hasNext()) {
            I_CmsResourceType type = (I_CmsResourceType)iter.next();
            // only xml resource types
            if (type.isDirectEditable() && !type.getTypeName().toUpperCase().equals("JSP")) {
                CmsSelectWidgetOption option = new CmsSelectWidgetOption(
                    new Integer(type.getTypeId()).toString(),
                    false,
                    type.getTypeName());
                fileFormats.add(option);
            }
        }
        return fileFormats;
    }
176059
def create_widget(self):
        
        d = self.declaration
        self.widget = TextView(self.get_context(), None,
                               d.style or '@attr/textViewStyle')
193898
private List<CmsPushButton> getDialogButtons() {

        List<CmsPushButton> result = new ArrayList<CmsPushButton>();
        result.add(m_cancelButton);
        result.add(m_okButton);
        return result;
    }
697422
private CmsListItemWidget createListWidget(final CmsModelPageEntry modelPage) {

        CmsListItemWidget result = new CmsModelPageListItemWidget(modelPage.getListInfoBean());
        if (modelPage.isDefault()) {
            Widget label = result.getShortExtraInfoLabel();
            label.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().subtitleSuffix());
            result.setExtraInfo("(*)");
        }
        if (m_isModelGroup || CmsEditModelPageMenuEntry.checkVisible(modelPage.getStructureId())) {
            result.addIconClickHandler(new ClickHandler() {

                public void onClick(ClickEvent event) {

                    CmsEditModelPageMenuEntry.editModelPage(modelPage.getSitePath(), isModelGroup());
                }
            });
        }
        return result;
    }
1223977
private List<CmsSelectWidgetOption> getTokenizedWidgetConfiguration() {

        List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
        result.add(new CmsSelectWidgetOption("true", true));
        result.add(new CmsSelectWidgetOption("false", false));
        result.add(new CmsSelectWidgetOption("untokenized", false));
        return result;
    }
828212
public List<Widget> getAll() {

        List<Widget> all = new ArrayList<Widget>();
        Iterator<Widget> it = m_buttonPanelLeft.iterator();
        while (it.hasNext()) {
            all.add(it.next());
        }
        it = m_buttonPanelRight.iterator();
        while (it.hasNext()) {
            all.add(it.next());
        }
        return all;
    }
366226
@Override
    protected void defineWidgets() {

        initModule();
        setKeyPrefix(CmsModulesEditBase.KEY_PREFIX);
        addWidget(new CmsWidgetDialogParameter(m_module, "name", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "niceName", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "description", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "version.version", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "group", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "actionClass", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "authorName", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_module, "authorEmail", PAGES[0], new CmsDisplayWidget()));

    }
42925
private List<CmsSelectWidgetOption> createNavOpts(CmsSiteBean currSite) {

        List<CmsSite> sites = new ArrayList<CmsSite>();
        for (CmsSite site : OpenCms.getSiteManager().getAvailableSites(getCms(), true)) {
            if (site.getSiteMatcher() != null) {
                sites.add(site);
            }
        }

        float maxValue = 0;
        float nextPos = 0;

        // calculate value for the first navigation position
        float firstValue = 1;
        if (sites.size() > 0) {
            try {
                maxValue = sites.get(0).getPosition();
            } catch (Exception e) {
                // should usually never happen
            }
        }

        if (maxValue != 0) {
            firstValue = maxValue / 2;
        }

        List<String> options = new ArrayList<String>(sites.size() + 1);
        List<String> values = new ArrayList<String>(sites.size() + 1);

        // add the first entry: before first element
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_FIRST_0));
        values.add(firstValue + "");

        // show all present navigation elements in box
        for (int i = 0; i < sites.size(); i++) {
            String navText = sites.get(i).getTitle();
            float navPos = sites.get(i).getPosition();
            String siteRoot = sites.get(i).getSiteRoot();
            // get position of next nav element
            nextPos = navPos + 2;
            if ((i + 1) < sites.size()) {
                nextPos = sites.get(i + 1).getPosition();
            }
            // calculate new position of current nav element
            float newPos;
            if ((nextPos - navPos) > 1) {
                newPos = navPos + 1;
            } else {
                newPos = (navPos + nextPos) / 2;
            }
            // check new maxValue of positions and increase it
            if (navPos > maxValue) {
                maxValue = navPos;
            }
            // if the element is the current file, mark it in select box
            if ((currSite != null) && (currSite.getSiteRoot() != null) && currSite.getSiteRoot().equals(siteRoot)) {
                options.add(
                    CmsEncoder.escapeHtml(
                        getMessages().key(
                            org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_CURRENT_1,
                            new Object[] {sites.get(i).getSiteRoot()})));
                values.add("-1");
            } else {
                options.add(CmsEncoder.escapeHtml(navText + " [" + sites.get(i).getSiteRoot() + "/]"));
                values.add(newPos + "");
            }
        }

        // add the entry: at the last position
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_LAST_0));
        values.add((maxValue + 1) + "");

        // add the entry: no change
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_NO_CHANGE_0));
        if ((currSite != null) && (currSite.getPosition() == Float.MAX_VALUE)) {
            // current resource has no valid position, use "last position"
            values.add((maxValue + 1) + "");
        } else {
            // current resource has valid position, use "-1" for no change
            values.add("-1");
        }
        List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
        for (int i = 0; i < values.size(); i++) {
            String val = values.get(i);
            String opt = options.get(i);
            result.add(new CmsSelectWidgetOption(val, false, opt));
        }
        return result;
    }
613663
@Override
    protected void defineWidgets() {

        initModule();

        addWidget(new CmsWidgetDialogParameter(m_exportpoint, "uri", PAGES[0], new CmsDisplayWidget()));
        addWidget(
            new CmsWidgetDialogParameter(m_exportpoint, "configuredDestination", PAGES[0], new CmsDisplayWidget()));
        addWidget(new CmsWidgetDialogParameter(m_exportpoint, "destinationPath", PAGES[0], new CmsDisplayWidget()));

    }
967462
@Override
    protected void defineWidgets() {

        // initialize the user object to use for the dialog
        initUserObject();

        setKeyPrefix(KEY_PREFIX);

        // widgets to display
        if (isOverview()) {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "description", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "lastname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "firstname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "email", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "institution", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "address", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "zipcode", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "city", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "country", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "enabled", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "selfManagement", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "lastlogin", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "created", PAGES[0], new CmsDisplayWidget()));
        } else {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "lastname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_user, "firstname", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
        }
    }
552761
@Override
    protected void defineWidgets() {

        // initialize the user object to use for the dialog
        initGroupObject();
        setKeyPrefix(KEY_PREFIX);

        // widgets to display
        if ((m_group.getId() == null) && isEditable(m_group)) {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsInputWidget()));
        } else {
            addWidget(new CmsWidgetDialogParameter(this, "name", PAGES[0], new CmsDisplayWidget()));
        }
        if (isEditable(m_group)) {
            addWidget(new CmsWidgetDialogParameter(this, "description", PAGES[0], new CmsTextareaWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_group, "enabled", PAGES[0], new CmsCheckboxWidget()));
        } else {
            addWidget(new CmsWidgetDialogParameter(this, "description", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(this, "assignedOu", PAGES[0], new CmsDisplayWidget()));
            addWidget(new CmsWidgetDialogParameter(m_group, "enabled", PAGES[0], new CmsDisplayWidget()));
        }
    }
130575
private List<CmsSelectWidgetOption> getProjects() {

        List<CmsSelectWidgetOption> projects = new ArrayList<CmsSelectWidgetOption>();

        try {
            String defProject = null;
            if ((m_user != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_user.getName())) {
                defProject = new CmsUserSettings(m_user).getStartProject();
            }
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(defProject)) {
                defProject = getParamOufqn() + OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartProject();
            }
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(defProject)) {
                defProject = getCms().getRequestContext().getCurrentProject().getName();
            }

            List<CmsProject> projectsList;
            projectsList = OpenCms.getOrgUnitManager().getAllAccessibleProjects(getCms(), getParamOufqn(), false);

            Iterator<CmsProject> itProjects = projectsList.iterator();

            while (itProjects.hasNext()) {
                boolean selected = false;
                CmsProject project = itProjects.next();

                String projectName = project.getName();
                if (projectName.equals(defProject)) {
                    selected = true;
                }
                if (isNewUser()) {
                    projects.add(
                        new CmsSelectWidgetOption(project.getSimpleName(), selected, project.getSimpleName(), null));
                } else {
                    projects.add(new CmsSelectWidgetOption(project.getName(), selected, project.getSimpleName(), null));
                }
            }

        } catch (CmsException e) {
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }

        return projects;
    }
1042275
def add_widgets(self, *widgets_or_spacings):
        """"""
        layout = self.layout()
        for widget_or_spacing in widgets_or_spacings:
            if isinstance(widget_or_spacing, int):
                layout.addSpacing(widget_or_spacing)
            else:
                layout.addWidget(widget_or_spacing)
463773
public I_CmsFormWidget createFormWidget(
        String key,
        Map<String, String> widgetParams,
        Optional<String> defaultValue) {

        if (key == null) {
            key = "";
        }
        I_CmsFormWidgetFactory factory = m_widgetFactories.get(key);
        if (factory == null) {
            // if the given widget type is not found, fall back to text box widget
            factory = m_widgetFactories.get(CmsTextBox.WIDGET_TYPE);
        }
        return factory.createWidget(widgetParams, defaultValue);

    }