Set the enabled state of automatically resizing text.
433272
public AutofitHelper setEnabled(boolean enabled) {
        if (mEnabled != enabled) {
            mEnabled = enabled;

            if (enabled) {
                mTextView.addTextChangedListener(mTextWatcher);
                mTextView.addOnLayoutChangeListener(mOnLayoutChangeListener);

                autofit();
            } else {
                mTextView.removeTextChangedListener(mTextWatcher);
                mTextView.removeOnLayoutChangeListener(mOnLayoutChangeListener);

                mTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTextSize);
            }
        }
        return this;
    }
345108
private void resizeStaticText() {
        double maxWidth = width * 0.28472222;
        double fontSize = height * 0.12631579;

        minValueText.setFont(Fonts.latoRegular(fontSize));
        if (minValueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(minValueText, maxWidth, fontSize); }
        minValueText.relocate((width * 0.28472222) - minValueText.getLayoutBounds().getWidth(), height * 0.885);

        maxValueText.setFont(Fonts.latoRegular(fontSize));
        if (maxValueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(maxValueText, maxWidth, fontSize); }
        maxValueText.relocate(width * 0.71527778, height * 0.885);

        maxWidth = width * 0.9;
        titleText.setFont(Fonts.latoRegular(fontSize));
        if (titleText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(titleText, maxWidth, fontSize); }
        titleText.relocate((width - titleText.getLayoutBounds().getWidth()) * 0.5, height * 0.95);
    }
887973
private void applySettings() {
		// reset the container.
		container.reset();

		// create the new collapsible.
		WText component1 = new WText("Here is some text that is collapsible via ajax.");
		WCollapsible collapsible1 = new WCollapsible(component1, "Collapsible",
				(CollapsibleMode) rbCollapsibleSelect.getSelected());
		collapsible1.setCollapsed(cbCollapsed.isSelected());
		collapsible1.setVisible(cbVisible.isSelected());

		if (collapsible1.getMode() == CollapsibleMode.DYNAMIC) {
			component1.setText(component1.getText() + "\u00a0Generated on " + new Date());
		}

		if (drpHeadingLevels.getSelected() != null) {
			collapsible1.setHeadingLevel((HeadingLevel) drpHeadingLevels.getSelected());
		}

		// add the new collapsible to the container.
		container.add(collapsible1);

	}
1335956
protected void onResize() {

        Widget parent = getParent();
        while (parent != null) {
            if (parent instanceof I_CmsDescendantResizeHandler) {
                ((I_CmsDescendantResizeHandler)parent).onResizeDescendant();
                break;
            }
            parent = parent.getParent();
        }
    }
516941
def _resize(self):
        ''''''
        lines = self.text.split('\n')
        xsize, ysize = 0, 0
        for line in lines:
            size = self.textctrl.GetTextExtent(line)
            xsize = max(xsize, size[0])
            ysize = ysize + size[1]
        xsize = int(xsize*1.2)
        self.textctrl.SetSize((xsize, ysize))
        self.textctrl.SetMinSize((xsize, ysize))
1179894
public void setState(State state) {
    this.state = state;
    setText(state.isPrimary() ? text1 : text2);
  }
606099
def setShowRichText(self, state):
        
        self._showRichText = state
        text = self.text()
        
        if state:
            label = self.richTextLabel()
            label.setText(text)
            label.show()
            super(XPushButton, self).setText('')
        else:
            if self._richTextLabel:
                self._richTextLabel.hide()
            
            super(XPushButton, self).setText(text)
1004836
public void setTextSize(int sizeSp) {
        mTextSize = sizeSp * mDisplayMetrics.scaledDensity;
        mTextPaint.setTextSize(mTextSize);
        invalidate();
    }
916927
public void resizeText() {

		int heightLimit = getHeight() - getPaddingBottom() - getPaddingTop();
		int widthLimit = getWidth() - getPaddingLeft() - getPaddingRight();
		resizeText(widthLimit, heightLimit);
	}
975225
@Override protected void resizeDynamicText() {
        double maxWidth = unitText.isVisible() ? width - size * 0.275 : width - size * 0.1;
        double fontSize = size * 0.24;
        valueText.setFont(Fonts.latoRegular(fontSize));
        if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(valueText, maxWidth, fontSize); }
    }
940826
def _set_master_state(self, state):
        """"""
        if state == 'init':
            self._service_state.update_current_state('init', force=True)
            self.set_state(DevState.INIT)

        elif state == 'on':
            self.set_state(DevState.ON)
            self._service_state.update_current_state('on')
223446
function set(textAlign, scale) {
         this.textAlign = textAlign; // updated scaled Size

         if (scale) {
           this.resize(scale);
         }

         this.isDirty = true;
         return this;
       }
5692
def set_font_size(self, pt=None, px=None):
        """"""
        self.font.set_size(pt, px)

        self._render()
790384
def on_leTitle_textChanged(self):
        
        self.parent.pbnNext.setEnabled(bool(self.leTitle.text()))
603250
public void setAutoTextColor(final boolean AUTOMATIC) {
        if (null == autoTextColor) {
            _autoTextColor = AUTOMATIC;
            adjustTextColors();
            redraw();
        } else {
            autoTextColor.set(AUTOMATIC);
        }
    }
76056
public void setText (String text)
    {
        if (_label.setText(text)) {
            _dirty = true;
            // clear out our constrained size where appropriate
            if (_constrain == HORIZONTAL || _constrain == VERTICAL) {
                _constrainedSize = 0;
                _label.clearTargetDimens();
            }
            revalidate();
            repaint();
        }
    }
1063027
def on_resize(self, event):
        """"""
        self.context.set_viewport(0, 0, event.size[0], event.size[1])
        for visual in self.visuals:
            visual.on_resize(event.size)
        self.update()