protected void createInstances() { labelTitle = new GenericLabel("Controls"); buttonDone = new GenericButton("Done"); buttonAdd = new GenericButton("Add Shortcut"); buttonEdit = new GenericButton("Edit"); buttonEdit.setTooltip("Edit Shortcut"); buttonRemove = new DeleteControlButton(this); buttonRemove.setTooltip("Remove Shortcut"); labelDescription = new GenericLabel(); labelDescription.setText("Double-click an item, then press the key (combination)."); labelDescription.setWrapLines(true); filter = new GenericScrollArea(); view = new GenericListView(model); model.setCurrentGui(this); checkVanilla = new ControlsCheckBox(this, VANILLA_COLOR + "Minecraft Bindings"); checkSpoutcraft = new ControlsCheckBox(this, SPOUTCRAFT_COLOR + "Spoutcraft Bindings"); checkCustom = new ControlsCheckBox(this, CUSTOM_COLOR + "Custom Bindings"); checkShortcuts = new ControlsCheckBox(this, SHORTCUTS_COLOR + "Shortcuts"); search = new ControlsSearch(this); filter.attachWidget("Spoutcraft", checkVanilla); filter.attachWidget("Spoutcraft", checkSpoutcraft); filter.attachWidget("Spoutcraft", checkCustom); filter.attachWidget("Spoutcraft", checkShortcuts); getScreen().attachWidget("Spoutcraft", search); getScreen().attachWidget("Spoutcraft", labelTitle); getScreen().attachWidget("Spoutcraft", filter); getScreen().attachWidget("Spoutcraft", view); getScreen().attachWidget("Spoutcraft", buttonAdd); getScreen().attachWidget("Spoutcraft", buttonEdit); getScreen().attachWidget("Spoutcraft", buttonRemove); getScreen().attachWidget("Spoutcraft", buttonDone); getScreen().attachWidget("Spoutcraft", labelDescription); updateButtons(); model.refresh(); }
public void setTitle(String title) { this.title = title; if (labelTitle != null) { labelTitle.setText(title); } }