Sets the current text of the preference. By setting a value, it will be persisted.

@param text
The text, which should be set, as a {@link String}
13738
public final void setText(@Nullable final String text) {
        boolean hasDisabledDependents = shouldDisableDependents();
        this.text = text;
        persistString(text);
        boolean isDisablingDependents = shouldDisableDependents();

        if (isDisablingDependents != hasDisabledDependents) {
            notifyDependencyChange(isDisablingDependents);
        }

        notifyChanged();
    }
86146
public void showTextKerned(String text) {
        if (state.fontDetails == null)
            throw new NullPointerException("Font and size must be set before writing any text");
        BaseFont bf = state.fontDetails.getBaseFont();
        if (bf.hasKernPairs())
            showText(getKernArray(text, bf));
        else
            showText(text);
    }
260059
public void setText(CharSequence text, TextView.BufferType type) {
        mEditText.setText(text, type);
    }
52738
public void setAside(String text) {
        if (text == null)
            throw new RuntimeException("Cannot set aside to null. Call removeAside() if you wanted to remove the aside text");

        if (asideElem == null)
            createAndAttachAsideElem();
        asideElem.setInnerText(text);
    }
22666
public void setText(String value) {
		this.value = value;
		if (cursorPos > value.length()) {
			cursorPos = value.length();
		}
	}
729140
@Override
    public void setAsText(String text) {
        if (BeanUtils.isNull(text)) {
            setValue(null);
            return;
        }
        ParseException pe = null;

        for (int i = 0; i < formats.length; i++) {
            try {
                // try to parse the date
                DateFormat df = formats[i];
                Date date = df.parse(text);

                // store the date in both forms
                this.text = text;
                super.setValue(date);

                // done
                return;
            } catch (ParseException e) {
                // remember the last seen exception
                pe = e;
            }
        }
        // couldn't parse
        throw new IllegalArgumentException("Failed to parse to Date!", pe);
    }
291367
public void addValue(String text) {
        Token[] tokens = TokenParser.makeTokens(text, isTokenize());
        addValue(tokens);
    }
1221705
def set_text(self, text):
        """"""
        text = text.strip()
        new_text = self.text() + text
        self.setText(new_text)
869091
public static void setText(JTextComponent textComp, String text){
        if(text==null)
            text = "";
        
        if(textComp.getCaret() instanceof DefaultCaret){
            DefaultCaret caret = (DefaultCaret)textComp.getCaret();
            int updatePolicy = caret.getUpdatePolicy();
            caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
            try{
                textComp.setText(text);
            }finally{
                caret.setUpdatePolicy(updatePolicy);
            }
        }else{
            int mark = textComp.getCaret().getMark();
            int dot = textComp.getCaretPosition();
            try{
                textComp.setText(text);
            }finally{
                int len = textComp.getDocument().getLength();
                if(mark>len)
                    mark = len;
                if(dot>len)
                    dot = len;
                textComp.setCaretPosition(mark);
                if(dot!=mark)
                    textComp.moveCaretPosition(dot);
            }
        }
    }
76124
public void addText(String text)
    throws ConfigException, PatternSyntaxException
  {
    text = text.trim();

    if (! text.equals(""))
      setName(text);
  }
618932
public void setTextForNullSelection(String text) {

        // do nothing if there's no null option
        CmsLabelSelectCell cell = m_selectCells.get("");
        if (cell == null) {
            return;
        }
        cell.setText(text);
        // if the null option is selected, we still need to update the opener
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_selectedValue)) {
            selectValue("");
        }
    }
479417
protected function onSetText(string $text): void
    {
        parent::onSetText($text);

        $this->isInvalid = false;
        $this->value = null;

        if ($this->hasError()) {
            return;
        }

        if ($this->isEmpty()) {
            return;
        }

        try {
            $this->setValue(new \DateTimeImmutable($text));
        } catch (\Exception $exception) {
            $this->setError('Invalid value');
            $this->isInvalid = true;
        }
    }
825794
def set_value(self, text):
        
        if self.single_line:
            text = text.replace('\n', '')
        self.set_text(text)
1334641
def setText(self, text):
        
        self._text = text
        
        # update the label
        btn = self.widget()
        if btn:
            btn.setText(text)
349243
public void init(String text)
    {
        m_iCurrentState = OFF;
        if (m_iconOff == null)
        {
            m_iconOff = BaseApplet.getSharedInstance().loadImageIcon(CHECKBOX_OFF);
            m_iconOn = BaseApplet.getSharedInstance().loadImageIcon(CHECKBOX_ON);
            m_iconNull = BaseApplet.getSharedInstance().loadImageIcon(CHECKBOX_NULL);
        }
        this.setIcon(m_iconOff);
        this.setBorder(null);
        this.setMargin(JScreenConstants.NO_INSETS);
        this.setOpaque(false);
        
        this.addActionListener(this);
    }
841591
public function addText($text)
    {
        $currentDescription = $this->project->getDescription();
        if ($currentDescription === null) {
            $this->project->setDescription($text);
        } else {
            $this->project->setDescription($currentDescription . $text);
        }
    }
173416
public void setSearchText(String searchText) {
        if (TextUtils.isEmpty(searchText)) {
            searchText = null;
        }
        this.searchText = searchText;
        if (this.searchBox != null) {
            this.searchBox.setText(searchText);
        }
    }