Class GUIQueryText

All Implemented Interfaces:
GUIElement, KeyPressedHandler, ImageObserver, MenuContainer, Serializable

public class GUIQueryText extends GUIText
Input field for "query" dialogs.
See Also:
  • Constructor Details

    • GUIQueryText

      public GUIQueryText(@NotNull @NotNull CrossfireServerConnection server, @Nullable @Nullable CommandHistory commandHistory, @NotNull @NotNull CommandCallback commandCallback, @NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, @NotNull @NotNull NewCharModel newCharModel, @NotNull @NotNull Image activeImage, @NotNull @NotNull Image inactiveImage, @NotNull @NotNull Font font, @NotNull @NotNull Color inactiveColor, @NotNull @NotNull Color activeColor, int margin, @NotNull @NotNull String text, @NotNull @NotNull GuiFactory guiFactory)
      Creates a new instance.
      Parameters:
      server - the crossfire server connection for sending reply commands
      commandHistory - the command history to use or null to disable command history access
      commandCallback - the command callback to use
      tooltipManager - the tooltip manager to update
      elementListener - the element listener to notify
      name - the name of this element
      newCharModel - the new char model to show
      activeImage - the element's background image when it is active
      inactiveImage - the element's background image when it is inactive
      font - the font for rendering displayed text
      inactiveColor - the color for rendering displayed text when the element is active; also cursor color
      activeColor - the color for rendering displayed text when the element is active
      margin - the left margin in pixels
      text - the initially entered text
      guiFactory - the global GUI factory instance
  • Method Details

    • execute

      protected void execute(@NotNull @NotNull String command)
      Description copied from class: GUIText
      Will be called to execute the entered command.
      Specified by:
      execute in class GUIText
      Parameters:
      command - the entered command
    • notifyOpen

      public void notifyOpen()
      Description copied from interface: GUIElement
      Called each time the enclosing dialog is opened (or raised).
    • getTooltip

      @Nullable public @Nullable TooltipText getTooltip()
      Description copied from class: AbstractGUIElement
      Returns the current tooltip text.
      Specified by:
      getTooltip in class AbstractGUIElement
      Returns:
      the tooltip text or null to not show a tooltip
    • execute

      public void execute()
      Description copied from class: ActivatableGUIElement
      Executes the actions associated with this GUI element. Does nothing if this element has no associated actions.
      Specified by:
      execute in class ActivatableGUIElement