Class CopyChip

java.lang.Object
com.inductiveautomation.ignition.designer.gui.CopyChip

public final class CopyChip extends Object
Builds the small icon-only Copy affordance used wherever a renderer wants to expose "copy this chunk to the clipboard" — the assistant reply bubble, fenced code blocks, table grids, etc. Centralized so every Copy chip across the AI / Markdown rendering surfaces lands with the same glyph, the same click affordance, and the same FEEDBACK_MSms post-click feedback (icon swap to a check glyph and tooltip swap to "Copied" before reverting).

The glyphs (copy + check) and pixel size are locked inside the chip; callers supply only the clipboard-text Supplier and an optional tint. The helper is intentionally opacity-neutral — it does not call setOpaque or setBackground on the returned button. Callers mount the chip into chrome that varies widely in tint and set that themselves before adding the button.

  • Method Details

    • create

      public static JideToolbarButton create(Supplier<String> textSupplier)
      Parameters:
      textSupplier - lazy source of the text written to the clipboard on click. A null or empty value short-circuits the click — neither the clipboard nor the feedback state change.
    • create

      public static JideToolbarButton create(Supplier<String> textSupplier, @Nullable Color iconColor)
      Variant that tints the copy/check glyphs.
      Parameters:
      textSupplier - lazy source of the text written to the clipboard on click.
      iconColor - tint applied to both glyphs. null leaves the icons at their default platform color.