Class WidgetTextFieldDropdown<T>
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.EditBox
org.cyclops.cyclopscore.client.gui.component.input.WidgetTextFieldExtended
org.cyclops.integrateddynamics.core.client.gui.WidgetTextFieldDropdown<T>
- Type Parameters:
T
- The dropdown entry type.
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.GuiEventListener
,net.minecraft.client.gui.components.Renderable
,net.minecraft.client.gui.components.TabOrderedElement
,net.minecraft.client.gui.layouts.LayoutElement
,net.minecraft.client.gui.narration.NarratableEntry
,net.minecraft.client.gui.narration.NarrationSupplier
public class WidgetTextFieldDropdown<T>
extends org.cyclops.cyclopscore.client.gui.component.input.WidgetTextFieldExtended
A text field that can show a dropdown for autocomplete.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
-
Field Summary
Fields inherited from class net.minecraft.client.gui.components.EditBox
BACKWARDS, DEFAULT_TEXT_COLOR, FORWARDS
Fields inherited from class net.minecraft.client.gui.components.AbstractWidget
ACCESSIBILITY_TEXTURE, active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorDescriptionWidgetTextFieldDropdown
(net.minecraft.client.gui.Font fontrenderer, int x, int y, int width, int height, net.minecraft.network.chat.Component narrationMessage, boolean background) WidgetTextFieldDropdown
(net.minecraft.client.gui.Font fontrenderer, int x, int y, int width, int height, net.minecraft.network.chat.Component narrationMessage, boolean background, Set<IDropdownEntry<T>> possibilities) -
Method Summary
Modifier and TypeMethodDescriptionboolean
charTyped
(char typedChar, int keyCode) int
getHoveredVisiblePossibility
(double mouseX, double mouseY) int
getVisiblePossibility
(int index) boolean
keyPressed
(int typedChar, int keyCode, int modifiers) boolean
mouseClicked
(double mouseX, double mouseY, int mouseButton) protected void
void
renderWidget
(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) void
selectPossibility
(IDropdownEntry<T> entry) protected void
selectVisiblePossibility
(int index) void
setFocused
(boolean isFocusedIn) void
setPossibilities
(Set<IDropdownEntry<T>> possibilities) Methods inherited from class org.cyclops.cyclopscore.client.gui.component.input.WidgetTextFieldExtended
drawBackground, getInnerWidth, setListener, setValue
Methods inherited from class net.minecraft.client.gui.components.EditBox
canConsumeInput, createNarrationMessage, deleteChars, deleteWords, getCursorPosition, getHighlighted, getScreenX, getValue, getWordPosition, insertText, isMouseOver, isVisible, moveCursor, moveCursorTo, moveCursorToEnd, moveCursorToStart, nextFocusPath, onClick, playDownSound, setBordered, setCanLoseFocus, setCursorPosition, setEditable, setFilter, setFormatter, setHighlightPos, setHint, setMaxLength, setResponder, setSuggestion, setTextColor, setTextColorUneditable, setVisible, tick, updateWidgetNarration
Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, createTooltipPositioner, defaultButtonNarrationText, getFGColor, getHeight, getMessage, getRectangle, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isValidClickButton, mouseDragged, mouseReleased, narrationPriority, onDrag, onRelease, render, renderScrollingString, renderScrollingString, renderTexture, setAlpha, setFGColor, setHeight, setMessage, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getCurrentFocusPath, keyReleased, mouseMoved, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
Methods inherited from interface net.minecraft.client.gui.components.Renderable
render
-
Constructor Details
-
WidgetTextFieldDropdown
public WidgetTextFieldDropdown(net.minecraft.client.gui.Font fontrenderer, int x, int y, int width, int height, net.minecraft.network.chat.Component narrationMessage, boolean background, Set<IDropdownEntry<T>> possibilities) -
WidgetTextFieldDropdown
public WidgetTextFieldDropdown(net.minecraft.client.gui.Font fontrenderer, int x, int y, int width, int height, net.minecraft.network.chat.Component narrationMessage, boolean background)
-
-
Method Details
-
setPossibilities
-
getPossibilitiesCount
public int getPossibilitiesCount() -
getVisiblePossibility
-
refreshDropdownList
protected void refreshDropdownList() -
setFocused
public void setFocused(boolean isFocusedIn) - Specified by:
setFocused
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
setFocused
in classnet.minecraft.client.gui.components.EditBox
-
charTyped
public boolean charTyped(char typedChar, int keyCode) - Specified by:
charTyped
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
charTyped
in classnet.minecraft.client.gui.components.EditBox
-
keyPressed
public boolean keyPressed(int typedChar, int keyCode, int modifiers) - Specified by:
keyPressed
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
keyPressed
in classnet.minecraft.client.gui.components.EditBox
-
selectVisiblePossibility
protected void selectVisiblePossibility(int index) -
selectPossibility
-
renderWidget
public void renderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) - Overrides:
renderWidget
in classorg.cyclops.cyclopscore.client.gui.component.input.WidgetTextFieldExtended
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseClicked
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
mouseClicked
in classorg.cyclops.cyclopscore.client.gui.component.input.WidgetTextFieldExtended
-
getHoveredVisiblePossibility
public int getHoveredVisiblePossibility(double mouseX, double mouseY)
-