Class TextTag.Builder<B extends TextTag.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
Tag.Builder
Enclosing class:
TextTag

public static class TextTag.Builder<B extends TextTag.Builder<B>> extends GObject.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 TextTag build()
      Finish building the TextTag object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to TextTag.
      Overrides:
      build in class GObject.Builder<B extends TextTag.Builder<B>>
      Returns:
      a new instance of TextTag with the properties that were set in the Builder object.
    • setAccumulativeMargin

      public B setAccumulativeMargin(boolean accumulativeMargin)

      Whether the margins accumulate or override each other.

      When set to true the margins of this tag are added to the margins of any other non-accumulative margins present. When set to false the margins override one another (the default).

      Parameters:
      accumulativeMargin - the value for the accumulative-margin property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setAllowBreaks

      public B setAllowBreaks(boolean allowBreaks)
      Whether breaks are allowed.
      Parameters:
      allowBreaks - the value for the allow-breaks property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setAllowBreaksSet

      public B setAllowBreaksSet(boolean allowBreaksSet)
      Whether the allow-breaks property is set.
      Parameters:
      allowBreaksSet - the value for the allow-breaks-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setBackground

      public B setBackground(String background)
      Background color as a string.
      Parameters:
      background - the value for the background property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setBackgroundFullHeight

      public B setBackgroundFullHeight(boolean backgroundFullHeight)
      Whether the background color fills the entire line height or only the height of the tagged characters.
      Parameters:
      backgroundFullHeight - the value for the background-full-height property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setBackgroundFullHeightSet

      public B setBackgroundFullHeightSet(boolean backgroundFullHeightSet)
      Whether the background-full-height property is set.
      Parameters:
      backgroundFullHeightSet - the value for the background-full-height-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • 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)
      Whether the background property is set.
      Parameters:
      backgroundSet - the value for the background-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDirection

      public B setDirection(TextDirection direction)
      Text direction, e.g. right-to-left or left-to-right.
      Parameters:
      direction - the value for the direction property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setEditable

      public B setEditable(boolean editable)
      Whether the text can be modified by the user.
      Parameters:
      editable - the value for the editable property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setEditableSet

      public B setEditableSet(boolean editableSet)
      Whether the editable property is set.
      Parameters:
      editableSet - the value for the editable-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFallback

      public B setFallback(boolean fallback)

      Whether font fallback is enabled.

      When set to true, other fonts will be substituted where the current font is missing glyphs.

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

      public B setFallbackSet(boolean fallbackSet)
      Whether the fallback property is set.
      Parameters:
      fallbackSet - the value for the fallback-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFamily

      public B setFamily(String family)
      Name of the font family, e.g. Sans, Helvetica, Times, Monospace.
      Parameters:
      family - the value for the family property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFamilySet

      public B setFamilySet(boolean familySet)
      Whether the family property is set.
      Parameters:
      familySet - the value for the family-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFont

      public B setFont(String font)

      Font description as string, e.g. \"Sans Italic 12\".

      Note that the initial value of this property depends on the internals of PangoFontDescription.

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

      public B setFontDesc(FontDescription fontDesc)
      Font description as a PangoFontDescription.
      Parameters:
      fontDesc - the value for the font-desc property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFontFeatures

      public B setFontFeatures(String fontFeatures)
      OpenType font features, as a string.
      Parameters:
      fontFeatures - the value for the font-features property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFontFeaturesSet

      public B setFontFeaturesSet(boolean fontFeaturesSet)
      Whether the font-features property is set.
      Parameters:
      fontFeaturesSet - the value for the font-features-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setForeground

      public B setForeground(String foreground)
      Foreground color as a string.
      Parameters:
      foreground - the value for the foreground property
      Returns:
      the Builder instance is returned, to allow method chaining
    • 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)
      Whether the foreground property is set.
      Parameters:
      foregroundSet - the value for the foreground-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setIndent

      public B setIndent(int indent)

      Amount to indent the paragraph, in pixels.

      A negative value of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.

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

      public B setIndentSet(boolean indentSet)
      Whether the indent property is set.
      Parameters:
      indentSet - the value for the indent-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInsertHyphens

      public B setInsertHyphens(boolean insertHyphens)
      Whether to insert hyphens at breaks.
      Parameters:
      insertHyphens - the value for the insert-hyphens property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInsertHyphensSet

      public B setInsertHyphensSet(boolean insertHyphensSet)
      Whether the insert-hyphens property is set.
      Parameters:
      insertHyphensSet - the value for the insert-hyphens-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setInvisible

      public B setInvisible(boolean invisible)

      Whether this text is hidden.

      Note that there may still be problems with the support for invisible text, in particular when navigating programmatically inside a buffer containing invisible segments.

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

      public B setInvisibleSet(boolean invisibleSet)
      Whether the invisible property is set.
      Parameters:
      invisibleSet - the value for the invisible-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setJustification

      public B setJustification(Justification justification)
      Left, right, or center justification.
      Parameters:
      justification - the value for the justification property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setJustificationSet

      public B setJustificationSet(boolean justificationSet)
      Whether the justification property is set.
      Parameters:
      justificationSet - the value for the justification-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLanguage

      public B setLanguage(String language)

      The language this text is in, as an ISO code.

      Pango can use this as a hint when rendering the text. If not set, an appropriate default will be used.

      Note that the initial value of this property depends on the current locale, see also Gtk.getDefaultLanguage().

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

      public B setLanguageSet(boolean languageSet)
      Whether the language property is set.
      Parameters:
      languageSet - the value for the language-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLeftMargin

      public B setLeftMargin(int leftMargin)
      Width of the left margin in pixels.
      Parameters:
      leftMargin - the value for the left-margin property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLeftMarginSet

      public B setLeftMarginSet(boolean leftMarginSet)
      Whether the left-margin property is set.
      Parameters:
      leftMarginSet - the value for the left-margin-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLetterSpacing

      public B setLetterSpacing(int letterSpacing)
      Extra spacing between graphemes, in Pango units.
      Parameters:
      letterSpacing - the value for the letter-spacing property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLetterSpacingSet

      public B setLetterSpacingSet(boolean letterSpacingSet)
      Whether the letter-spacing property is set.
      Parameters:
      letterSpacingSet - the value for the letter-spacing-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setLineHeight

      public B setLineHeight(float lineHeight)
      Factor to scale line height by.
      Parameters:
      lineHeight - the value for the line-height property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • setLineHeightSet

      public B setLineHeightSet(boolean lineHeightSet)
      Whether the line-height property is set.
      Parameters:
      lineHeightSet - the value for the line-height-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setName

      public B setName(String name)

      The name used to refer to the tag.

      null for anonymous tags.

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

      public B setOverline(Overline overline)
      Style of overline for this text.
      Parameters:
      overline - the value for the overline property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setOverlineRgba

      public B setOverlineRgba(RGBA overlineRgba)

      This property modifies the color of overlines.

      If not set, overlines will use the foreground color.

      Parameters:
      overlineRgba - the value for the overline-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setOverlineRgbaSet

      public B setOverlineRgbaSet(boolean overlineRgbaSet)
      Whether the overline-rgba property is set.
      Parameters:
      overlineRgbaSet - the value for the overline-rgba-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setOverlineSet

      public B setOverlineSet(boolean overlineSet)
      Whether the overline property is set.
      Parameters:
      overlineSet - the value for the overline-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setParagraphBackground

      public B setParagraphBackground(String paragraphBackground)
      The paragraph background color as a string.
      Parameters:
      paragraphBackground - the value for the paragraph-background property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setParagraphBackgroundRgba

      public B setParagraphBackgroundRgba(RGBA paragraphBackgroundRgba)
      The paragraph background color as a GdkRGBA.
      Parameters:
      paragraphBackgroundRgba - the value for the paragraph-background-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setParagraphBackgroundSet

      public B setParagraphBackgroundSet(boolean paragraphBackgroundSet)
      Whether the paragraph-background property is set.
      Parameters:
      paragraphBackgroundSet - the value for the paragraph-background-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPixelsAboveLines

      public B setPixelsAboveLines(int pixelsAboveLines)
      Pixels of blank space above paragraphs.
      Parameters:
      pixelsAboveLines - the value for the pixels-above-lines property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPixelsAboveLinesSet

      public B setPixelsAboveLinesSet(boolean pixelsAboveLinesSet)
      Whether the pixels-above-lines property is set.
      Parameters:
      pixelsAboveLinesSet - the value for the pixels-above-lines-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPixelsBelowLines

      public B setPixelsBelowLines(int pixelsBelowLines)
      Pixels of blank space below paragraphs.
      Parameters:
      pixelsBelowLines - the value for the pixels-below-lines property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPixelsBelowLinesSet

      public B setPixelsBelowLinesSet(boolean pixelsBelowLinesSet)
      Whether the pixels-below-lines property is set.
      Parameters:
      pixelsBelowLinesSet - the value for the pixels-below-lines-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPixelsInsideWrap

      public B setPixelsInsideWrap(int pixelsInsideWrap)
      Pixels of blank space between wrapped lines in a paragraph.
      Parameters:
      pixelsInsideWrap - the value for the pixels-inside-wrap property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setPixelsInsideWrapSet

      public B setPixelsInsideWrapSet(boolean pixelsInsideWrapSet)
      Whether the pixels-inside-wrap property is set.
      Parameters:
      pixelsInsideWrapSet - the value for the pixels-inside-wrap-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRightMargin

      public B setRightMargin(int rightMargin)
      Width of the right margin, in pixels.
      Parameters:
      rightMargin - the value for the right-margin property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRightMarginSet

      public B setRightMarginSet(boolean rightMarginSet)
      Whether the right-margin property is set.
      Parameters:
      rightMarginSet - the value for the right-margin-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setRise

      public B setRise(int rise)

      Offset of text above the baseline, in Pango units.

      Negative values go below the baseline.

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

      public B setRiseSet(boolean riseSet)
      Whether the rise property is set.
      Parameters:
      riseSet - the value for the rise-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setScale

      public B setScale(double scale)

      Font size as a scale factor relative to the default font size.

      This properly adapts to theme changes, etc. so is recommended. Pango predefines some scales such as PANGO_SCALE_X_LARGE.

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

      public B setScaleSet(boolean scaleSet)
      Whether the scale property is set.
      Parameters:
      scaleSet - the value for the scale-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSentence

      public B setSentence(boolean sentence)

      Whether this tag represents a single sentence.

      This affects cursor movement.

      Parameters:
      sentence - the value for the sentence property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • setSentenceSet

      public B setSentenceSet(boolean sentenceSet)
      Whether the sentence property is set.
      Parameters:
      sentenceSet - the value for the sentence-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowSpaces

      public B setShowSpaces(Set<ShowFlags> showSpaces)
      How to render invisible characters.
      Parameters:
      showSpaces - the value for the show-spaces property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowSpacesSet

      public B setShowSpacesSet(boolean showSpacesSet)
      Whether the show-spaces property is set.
      Parameters:
      showSpacesSet - the value for the show-spaces-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSize

      public B setSize(int size)
      Font size in Pango units.
      Parameters:
      size - the value for the size property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSizePoints

      public B setSizePoints(double sizePoints)
      Font size in points.
      Parameters:
      sizePoints - the value for the size-points property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSizeSet

      public B setSizeSet(boolean sizeSet)
      Whether the size property is set.
      Parameters:
      sizeSet - the value for the size-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStretch

      public B setStretch(Stretch stretch)
      Font stretch as a PangoStretch, e.g. Stretch.CONDENSED.
      Parameters:
      stretch - the value for the stretch property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStretchSet

      public B setStretchSet(boolean stretchSet)
      Whether the stretch property is set.
      Parameters:
      stretchSet - the value for the stretch-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStrikethrough

      public B setStrikethrough(boolean strikethrough)
      Whether to strike through the text.
      Parameters:
      strikethrough - the value for the strikethrough property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStrikethroughRgba

      public B setStrikethroughRgba(RGBA strikethroughRgba)

      This property modifies the color of strikeouts.

      If not set, strikeouts will use the foreground color.

      Parameters:
      strikethroughRgba - the value for the strikethrough-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStrikethroughRgbaSet

      public B setStrikethroughRgbaSet(boolean strikethroughRgbaSet)
      If the strikethrough-rgba property has been set.
      Parameters:
      strikethroughRgbaSet - the value for the strikethrough-rgba-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStrikethroughSet

      public B setStrikethroughSet(boolean strikethroughSet)
      Whether the strikethrough property is set.
      Parameters:
      strikethroughSet - the value for the strikethrough-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStyle

      public B setStyle(Style style)
      Font style as a PangoStyle, e.g. Style.ITALIC.
      Parameters:
      style - the value for the style property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setStyleSet

      public B setStyleSet(boolean styleSet)
      Whether the style property is set.
      Parameters:
      styleSet - the value for the style-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTabs

      public B setTabs(TabArray tabs)
      Custom tabs for this text.
      Parameters:
      tabs - the value for the tabs property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTabsSet

      public B setTabsSet(boolean tabsSet)
      Whether the tabs property is set.
      Parameters:
      tabsSet - the value for the tabs-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTextTransform

      public B setTextTransform(TextTransform textTransform)
      How to transform the text for display.
      Parameters:
      textTransform - the value for the text-transform property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • setTextTransformSet

      public B setTextTransformSet(boolean textTransformSet)
      Whether the text-transform property is set.
      Parameters:
      textTransformSet - the value for the text-transform-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUnderline

      public B setUnderline(Underline underline)
      Style of underline for this text.
      Parameters:
      underline - the value for the underline property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUnderlineRgba

      public B setUnderlineRgba(RGBA underlineRgba)

      This property modifies the color of underlines.

      If not set, underlines will use the foreground color.

      If Gtk.TextTag:underline is set to Underline.ERROR, an alternate color may be applied instead of the foreground. Setting this property will always override those defaults.

      Parameters:
      underlineRgba - the value for the underline-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUnderlineRgbaSet

      public B setUnderlineRgbaSet(boolean underlineRgbaSet)
      If the underline-rgba property has been set.
      Parameters:
      underlineRgbaSet - the value for the underline-rgba-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUnderlineSet

      public B setUnderlineSet(boolean underlineSet)
      Whether the underline property is set.
      Parameters:
      underlineSet - the value for the underline-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVariant

      public B setVariant(Variant variant)
      Font variant as a PangoVariant, e.g. Variant.SMALL_CAPS.
      Parameters:
      variant - the value for the variant property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVariantSet

      public B setVariantSet(boolean variantSet)
      Whether the variant property is set.
      Parameters:
      variantSet - the value for the variant-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWeight

      public B setWeight(int weight)
      Font weight as an integer.
      Parameters:
      weight - the value for the weight property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWeightSet

      public B setWeightSet(boolean weightSet)
      Whether the weight property is set.
      Parameters:
      weightSet - the value for the weight-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWord

      public B setWord(boolean word)

      Whether this tag represents a single word.

      This affects line breaks and cursor movement.

      Parameters:
      word - the value for the word property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • setWordSet

      public B setWordSet(boolean wordSet)
      Whether the word property is set.
      Parameters:
      wordSet - the value for the word-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWrapMode

      public B setWrapMode(WrapMode wrapMode)
      Whether to wrap lines never, at word boundaries, or at character boundaries.
      Parameters:
      wrapMode - the value for the wrap-mode property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setWrapModeSet

      public B setWrapModeSet(boolean wrapModeSet)
      Whether the wrap-mode property is set.
      Parameters:
      wrapModeSet - the value for the wrap-mode-set property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setShowSpaces

      public B setShowSpaces(ShowFlags... showSpaces)
      How to render invisible characters.
      Parameters:
      showSpaces - the value for the show-spaces property
      Returns:
      the Builder instance is returned, to allow method chaining