The edit widget needs to set, before the widget may be used.<p>

@param editWidget the edit widget to wrap
186530
public void setEditWidget(I_CmsEditWidget editWidget) {

        // the edit widget may be set only once
        assert m_editWidget == null;
        m_editWidget = editWidget;
        m_mainPanel.add(m_editWidget);
        m_editWidget.asWidget().addStyleName(I_CmsLayoutBundle.INSTANCE.form().widget());
    }
412672
public void prepareSmallElement(Widget widget) {

        m_hasSmallElements = true;
        widget.addStyleName(
            org.opencms.ade.containerpage.client.ui.css.I_CmsLayoutBundle.INSTANCE.containerpageCss().smallElement());

    }
870353
private void initModeSwitch(final EditMode current) {

        FormLayout modes = new FormLayout();
        modes.setHeight("100%");
        modes.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

        m_modeSelect = new ComboBox();
        m_modeSelect.setCaption(m_messages.key(Messages.GUI_VIEW_SWITCHER_LABEL_0));

        // add Modes
        m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.DEFAULT);
        m_modeSelect.setItemCaption(
            CmsMessageBundleEditorTypes.EditMode.DEFAULT,
            m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_DEFAULT_0));
        m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.MASTER);
        m_modeSelect.setItemCaption(
            CmsMessageBundleEditorTypes.EditMode.MASTER,
            m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_MASTER_0));

        // set current mode as selected
        m_modeSelect.setValue(current);

        m_modeSelect.setNewItemsAllowed(false);
        m_modeSelect.setTextInputAllowed(false);
        m_modeSelect.setNullSelectionAllowed(false);

        m_modeSelect.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                m_listener.handleModeChange((EditMode)event.getProperty().getValue());

            }
        });

        modes.addComponent(m_modeSelect);
        m_modeSwitch = modes;
    }
540127
public void onButtonActivation(Widget widget) {

        for (Widget w : getAll()) {
            if (!(w instanceof I_CmsToolbarActivatable)) {
                continue;
            }
            ((I_CmsToolbarActivatable)w).onActivation(widget);
        }
    }
347460
public void setEditMode(EditMode currentMode) {
		super.setEditMode(currentMode);
		if (controller != null) {
			controller.setEditMode(currentMode);
		}
	}
694273
public void updateButtonVisibilty(CmsInlineEntityWidget inlineWidget) {

        int minOccurrence = 0;
        int maxOccurrence = 0;
        if (isChoiceHandler()) {
            minOccurrence = 0;
            maxOccurrence = getEntityType().getChoiceMaxOccurrence();
        } else {
            minOccurrence = getEntityType().getAttributeMinOccurrence(m_attributeName);
            maxOccurrence = getEntityType().getAttributeMaxOccurrence(m_attributeName);
        }
        CmsEntityAttribute attribute = m_entity.getAttribute(m_attributeName);
        boolean mayHaveMore = (maxOccurrence > minOccurrence)
            && ((((attribute == null) && (!getAttributeType().isSimpleType() || (inlineWidget != null)))
                || ((attribute != null) && (attribute.getValueCount() < maxOccurrence))));
        boolean needsRemove = false;
        boolean needsSort = false;
        if ((isChoiceHandler() || !getEntityType().isChoice()) && m_entity.hasAttribute(m_attributeName)) {
            int valueCount = m_entity.getAttribute(m_attributeName).getValueCount();
            needsRemove = (maxOccurrence > minOccurrence) && (valueCount > minOccurrence);
            needsSort = !isSingleValueHandler() && (valueCount > 1);
        }
        if (inlineWidget != null) {
            boolean mayEdit = (attribute != null) && (attribute.getValueCount() > inlineWidget.getAttributeIndex());
            inlineWidget.updateButtonVisibility(mayEdit, mayHaveMore, needsRemove, needsSort);
        } else {
            for (CmsAttributeValueView value : m_attributeValueViews) {
                value.updateButtonVisibility(mayHaveMore, needsRemove, needsSort);
            }
        }
    }
591190
public void setLayout(String layout)
    {
        if (layout == null)
        {
            String message = Logging.getMessage("nullValue.StringIsNull");
            Logging.logger().severe(message);
            throw new IllegalArgumentException(message);
        }
        if (!this.layout.equals(layout))
        {
            this.layout = layout;
            clearControls();
        }
    }
650946
@Override
    protected void defineWidgets() {

        setKeyPrefix(KEY_PREFIX);

        // initialize the cache object to use for the dialog
        CmsFlexController controller = (CmsFlexController)getJsp().getRequest().getAttribute(
            CmsFlexController.ATTRIBUTE_NAME);
        CmsFlexCache cache = controller.getCmsCache();

        setOffline(true);
        setOnline(true);
        setMode(MODE_ALL);

        // widgets to display
        if (cache.cacheOffline()) {
            addWidget(new CmsWidgetDialogParameter(this, "offline", PAGES[0], new CmsCheckboxWidget()));
        }
        addWidget(new CmsWidgetDialogParameter(this, "online", PAGES[0], new CmsCheckboxWidget()));
        addWidget(new CmsWidgetDialogParameter(this, "mode", PAGES[0], new CmsRadioSelectWidget(getModes())));
    }
778361
public static void setMultiSelectEditorValue(
        CmsObject cms,
        Map<String, String[]> formParameters,
        I_CmsWidgetDialog widgetDialog,
        I_CmsWidgetParameter param) {

        String[] values = formParameters.get(param.getId());
        if ((values != null) && (values.length > 0)) {
            StringBuffer value = new StringBuffer(128);
            for (int i = 0; i < values.length; i++) {
                if (i > 0) {
                    value.append(',');
                }
                value.append(values[i]);
            }
            // set the value
            param.setStringValue(cms, value.toString());
        } else {
            // erase:
            param.setStringValue(cms, "");
        }
    }
743971
public void setMnemonic(int mnemonic) {
        this.mnemonic = mnemonic;
        renderButton.setMnemonic(mnemonic);
        editButton.setMnemonic(mnemonic);
    }
717295
public void setEditable(String editable) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(editable)) {
            m_editable = Boolean.valueOf(editable).booleanValue();
        }
    }
276193
@SuppressWarnings({"rawtypes", "unchecked"})
  public void initializeEditors(final Object editor) {
    if (editor instanceof HasValueChangeHandlers && valueChangeHandler != null) {
      ((HasValueChangeHandlers) editor).addValueChangeHandler(valueChangeHandler);
      // if widget has a value change handler, validate on change
      if (validateOnVueChangeHandler != null) {
        ((HasValueChangeHandlers) editor).addValueChangeHandler(validateOnVueChangeHandler);
      }
    }
    // if widget has a key up handler, validate on key up
    if (editor instanceof HasKeyUpHandlers && validateOnKeyUpHandler != null) {
      ((HasKeyUpHandlers) editor).addKeyUpHandler(validateOnKeyUpHandler);
    }
    // try to submit form on return
    if (editor instanceof HasKeyPressHandlers && commitOnReturnHandler != null) {
      ((HasKeyPressHandlers) editor).addKeyPressHandler(commitOnReturnHandler);
    }
  }
701410
public void setValueWidget(I_CmsFormEditWidget widget, String value, String defaultValue, boolean active) {

        if (m_hasValue) {
            throw new RuntimeException("Value has already been set");
        }
        m_defaultValue = defaultValue;
        m_hasValue = true;
        m_isSimpleValue = true;
        m_widget = widget;
        if (CmsAttributeHandler.hasResizeHandler() && (m_widget instanceof HasResizeHandlers)) {
            ((HasResizeHandlers)m_widget).addResizeHandler(CmsAttributeHandler.getResizeHandler());
        }
        m_widgetHolder.clear();
        m_widget.setWidgetInfo(m_label, m_help);
        if (active) {
            m_widget.setValue(value, false);
        } else {
            m_widget.setValue("");
        }
        m_widgetHolder.add(m_widget);
        m_widget.setName(getHandler().getAttributeName());
        m_widget.addValueChangeHandler(new ChangeHandler());
        m_widget.addFocusHandler(new FocusHandler() {

            public void onFocus(FocusEvent event) {

                CmsValueFocusHandler.getInstance().setFocus(CmsAttributeValueView.this);
                activateWidget();
            }
        });
        m_widget.setActive(active);
        if (!active) {
            addActivationHandler();
        } else {
            removeStyleName(formCss().emptyValue());
        }
        addStyleName(formCss().simpleValue());

        if (m_widget instanceof CmsFormWidgetWrapper) {
            addLabelHoverHandler(((CmsFormWidgetWrapper)m_widget).getLabel());
        } else {
            removeLabelHoverHandler();
        }
    }
1322615
private void setEditorLabel(String label) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(label)) {
            setValidConfiguration(false);
            LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_LABEL_0));
        }
        m_editorLabel = label;
    }
762878
public void setButtonStyle(I_CmsButton.ButtonStyle style, I_CmsButton.ButtonColor color) {

        if (m_buttonStyle != null) {
            for (String styleName : m_buttonStyle.getAdditionalClasses()) {
                removeStyleName(styleName);
            }
        }
        if (style == ButtonStyle.TRANSPARENT) {
            setSize(null);
        }
        addStyleName(style.getCssClassName());
        m_buttonStyle = style;

        if (m_color != null) {
            removeStyleName(m_color.getClassName());
        }
        if (color != null) {
            addStyleName(color.getClassName());
        }
        m_color = color;
    }
810549
void handleEdit(CmsClientSitemapEntry editEntry, final String newTitle) {

        if (CmsStringUtil.isEmpty(newTitle)) {
            String dialogTitle = Messages.get().key(Messages.GUI_EDIT_TITLE_ERROR_DIALOG_TITLE_0);
            String dialogText = Messages.get().key(Messages.GUI_TITLE_CANT_BE_EMPTY_0);
            CmsAlertDialog alert = new CmsAlertDialog(dialogTitle, dialogText);
            alert.center();
            return;
        }
        String oldTitle = editEntry.getPropertyValue(CmsClientProperty.PROPERTY_TITLE);
        if (!oldTitle.equals(newTitle)) {
            CmsPropertyModification propMod = new CmsPropertyModification(
                getEntryId(),
                CmsClientProperty.PROPERTY_TITLE,
                newTitle,
                true);
            final List<CmsPropertyModification> propChanges = new ArrayList<CmsPropertyModification>();
            propChanges.add(propMod);
            CmsSitemapController controller = CmsSitemapView.getInstance().getController();
            controller.edit(editEntry, propChanges, CmsReloadMode.reloadEntry);
        }
    }
458211
public void removeButton(Widget w) {

        m_buttonPanel.remove(w);
        if (CmsCoreProvider.get().isIe7()) {
            m_buttonPanel.getElement().getStyle().setWidth(m_buttonPanel.getWidgetCount() * 22, Unit.PX);
        }
    }