Class CellRendererText.Builder<B extends CellRendererText.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
CellRendererAccel.Builder, CellRendererCombo.Builder, CellRendererSpin.Builder
Enclosing class:
CellRendererText

public static class CellRendererText.Builder<B extends CellRendererText.Builder<B>> extends CellRenderer.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public CellRendererText build()
      Finish building the CellRendererText object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to CellRendererText.
      Overrides:
      build in class CellRenderer.Builder<B extends CellRendererText.Builder<B>>
      Returns:
      a new instance of CellRendererText with the properties that were set in the Builder object.
    • setAlignSet

      public B setAlignSet(boolean alignSet)
    • setAlignment

      public B setAlignment(Alignment alignment)

      Specifies how to align the lines of text with respect to each other.

      Note that this property describes how to align the lines of text in case there are several of them. The "xalign" property of GtkCellRenderer, on the other hand, sets the horizontal alignment of the whole text.

      Parameters:
      alignment - the value for the alignment property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setAttributes

      public B setAttributes(AttrList attributes)
    • setBackground

      public B setBackground(String background)
    • setBackgroundRgba

      public B setBackgroundRgba(RGBA backgroundRgba)
      Background color as a GdkRGBA
      Parameters:
      backgroundRgba - the value for the background-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setBackgroundSet

      public B setBackgroundSet(boolean backgroundSet)
    • setEditable

      public B setEditable(boolean editable)
    • setEditableSet

      public B setEditableSet(boolean editableSet)
    • setEllipsize

      public B setEllipsize(EllipsizeMode ellipsize)
      Specifies the preferred place to ellipsize the string, if the cell renderer does not have enough room to display the entire string. Setting it to EllipsizeMode.NONE turns off ellipsizing. See the wrap-width property for another way of making the text fit into a given width.
      Parameters:
      ellipsize - the value for the ellipsize property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setEllipsizeSet

      public B setEllipsizeSet(boolean ellipsizeSet)
    • setFamily

      public B setFamily(String family)
    • setFamilySet

      public B setFamilySet(boolean familySet)
    • setFont

      public B setFont(String font)
    • setFontDesc

      public B setFontDesc(FontDescription fontDesc)
    • setForeground

      public B setForeground(String foreground)
    • setForegroundRgba

      public B setForegroundRgba(RGBA foregroundRgba)
      Foreground color as a GdkRGBA
      Parameters:
      foregroundRgba - the value for the foreground-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setForegroundSet

      public B setForegroundSet(boolean foregroundSet)
    • setLanguage

      public B setLanguage(String language)
    • setLanguageSet

      public B setLanguageSet(boolean languageSet)
    • setMarkup

      public B setMarkup(String markup)
    • setMaxWidthChars

      public B setMaxWidthChars(int maxWidthChars)

      The desired maximum width of the cell, in characters. If this property is set to -1, the width will be calculated automatically.

      For cell renderers that ellipsize or wrap text; this property controls the maximum reported width of the cell. The cell should not receive any greater allocation unless it is set to expand in its GtkCellLayout and all of the cell's siblings have received their natural width.

      Parameters:
      maxWidthChars - the value for the max-width-chars property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPlaceholderText

      public B setPlaceholderText(String placeholderText)
      The text that will be displayed in the GtkCellRenderer if GtkCellRendererText:editable is true and the cell is empty.
      Parameters:
      placeholderText - the value for the placeholder-text property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRise

      public B setRise(int rise)
    • setRiseSet

      public B setRiseSet(boolean riseSet)
    • setScale

      public B setScale(double scale)
    • setScaleSet

      public B setScaleSet(boolean scaleSet)
    • setSingleParagraphMode

      public B setSingleParagraphMode(boolean singleParagraphMode)
    • setSize

      public B setSize(int size)
    • setSizePoints

      public B setSizePoints(double sizePoints)
    • setSizeSet

      public B setSizeSet(boolean sizeSet)
    • setStretch

      public B setStretch(Stretch stretch)
    • setStretchSet

      public B setStretchSet(boolean stretchSet)
    • setStrikethrough

      public B setStrikethrough(boolean strikethrough)
    • setStrikethroughSet

      public B setStrikethroughSet(boolean strikethroughSet)
    • setStyle

      public B setStyle(Style style)
    • setStyleSet

      public B setStyleSet(boolean styleSet)
    • setText

      public B setText(String text)
    • setUnderline

      public B setUnderline(Underline underline)
    • setUnderlineSet

      public B setUnderlineSet(boolean underlineSet)
    • setVariant

      public B setVariant(Variant variant)
    • setVariantSet

      public B setVariantSet(boolean variantSet)
    • setWeight

      public B setWeight(int weight)
    • setWeightSet

      public B setWeightSet(boolean weightSet)
    • setWidthChars

      public B setWidthChars(int widthChars)
      The desired width of the cell, in characters. If this property is set to -1, the width will be calculated automatically, otherwise the cell will request either 3 characters or the property value, whichever is greater.
      Parameters:
      widthChars - the value for the width-chars property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWrapMode

      public B setWrapMode(WrapMode wrapMode)
      Specifies how to break the string into multiple lines, if the cell renderer does not have enough room to display the entire string. This property has no effect unless the wrap-width property is set.
      Parameters:
      wrapMode - the value for the wrap-mode property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWrapWidth

      public B setWrapWidth(int wrapWidth)
      Specifies the minimum width at which the text is wrapped. The wrap-mode property can be used to influence at what character positions the line breaks can be placed. Setting wrap-width to -1 turns wrapping off.
      Parameters:
      wrapWidth - the value for the wrap-width property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onEdited

      public B onEdited(CellRendererText.EditedCallback handler)

      This signal is emitted after renderer has been edited.

      It is the responsibility of the application to update the model and store newText at the position indicated by path.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: