Interface AutoConfigurable

All Superinterfaces:
Buildable, Configurable, Translatable
All Known Implementing Classes:
AboutScreen, AbstractConfigurable, AbstractDeckKeyCommand, AbstractFolder, AbstractScenarioProperty, AbstractScript, AbstractToolbarItem, ActionScript, BasicModule, BasicPreference, Board, BooleanPreference, BooleanScenarioProperty, BoxWidget, BrowserHelpFile.ConfigSupport, BrowserPDFFile, BshPlugin, CardSlot, ChangePropertyButton, Chart, ChartWindow, ChessClock, ChessClockControl, ColorManager, ColorSwatch, CounterDetailViewer, CounterTurnLevel, DeckGlobalKeyCommand, DeckSendKeyCommand, DeckSortKeyCommand, DeckSubFolder, DiceButton, DieManager, DoActionButton, Documentation, DoublePreference, DrawPile, EnumPreference, Flare, FontManager, FontStyle, GameModule, GamePieceImage, GamePieceImageDefinitions, GamePieceLayout, GamePieceLayoutsContainer, GeneralScript, GlobalKeyCommand, GlobalMap, GlobalMap.CounterViewer, GlobalOptions, GlobalProperties, GlobalProperty, GlobalPropertyFolder, GlobalTranslatableMessage, GlobalTranslatableMessages, HandMetrics, HelpFile, HexGrid, HexGridNumbering, HidePiecesButton, HighlightLastMoved, HtmlChart, IconFamily, ImageItem, ImageItemInstance, ImageSaver, IntegerPreference, InternetDiceButton, Inventory, Item, ItemInstance, Language, LayerControl, LayeredPieceCollection, ListScenarioProperty, ListTurnLevel, ListWidget, Localization, LOS_Thread, Map, MapShader, MapSubFolder, MapWidget, MassKeyCommand, ModuleSubFolder, MoveCameraButton, MultiActionButton, NotesWindow, NumberScenarioProperty, PanelWidget, PieceRecenterer, PieceSlot, PieceWindow, PlayerHand, PlayerRoster, Plugin, PredefinedSetup, PrivateMap, PrototypeDefinition, PrototypeFolder, PrototypesContainer, RandomTextButton, Region, RegionGrid, RegularGridNumbering, ScenarioPropertiesOptionTab, ScriptContainer, SelectionHighlighter, SelectionHighlighters, SetupStack, ShapeItem, ShapeItemInstance, SpecialDiceButton, SpecialDie, SpecialDieFace, SquareGrid, SquareGridNumbering, StackMetrics, StartupGlobalKeyCommand, StringPreference, StringScenarioProperty, SymbolItem, SymbolItemInstance, TabWidget, TextBoxItem, TextBoxItemInstance, TextItem, TextItemInstance, TextPreference, TextSaver, ToolbarMenu, TranslatableMarker, Translation, TurnComponent, TurnGlobalHotkey, TurnLevel, TurnTracker, Tutorial, VassalTranslation, Widget, WidgetMap, Zone, ZonedGrid, ZonedGridHighlighter, ZoneHighlight, ZoneProperty, Zoomer

public interface AutoConfigurable extends Configurable
A class that implements AutoConfigurable can use the AutoConfigurer class to automatically build a property editor.
  • Method Details

    • getAttributeNames

      String[] getAttributeNames()
      Returns:
      an array of Strings giving all attributes of this Buildable component that will be written to/read from an XML element
    • setAttribute

      void setAttribute(String key, Object value)
      Called by the Buildable.build(Element) method, where value is the String value read by the XML attribute. Can also be called with Object value to set the attribute.
      Specified by:
      setAttribute in interface Translatable
      Parameters:
      key - the name of the attribute. If the implementing class extends AbstractConfigurable, will be one of those listed in AbstractBuildable.getAttributeNames().
      value - If the value parameter is a String, it will be the value returned by Translatable.getAttributeValueString(String) for the same key. If the implementing class extends AbstractConfigurable, then value can also be an instance of the corresponding Class listed in AbstractConfigurable.getAttributeTypes()
    • getAttributeValueString

      String getAttributeValueString(String key)
      Called by the Buildable.getBuildElement(Document) method to write the attributes into an XML element
      Specified by:
      getAttributeValueString in interface Translatable
      Parameters:
      key - the name of the attribute. If the implementing class extends AbstractConfigurable, will be one of those listed in AbstractBuildable.getAttributeNames().
      Returns:
      a String representation of the attribute with the given name. When initializing a module, this String value will be passed to Translatable.setAttribute(String, Object).
    • getAttributeDescriptions

      String[] getAttributeDescriptions()
      Return an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object.
    • getAttributeTypes

      Class<?>[] getAttributeTypes()
      Return the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke
    • getAttributeVisibility

      VisibilityCondition getAttributeVisibility(String name)
      Because attributes are not always applicable in all cases, this method returns an interface to determine when the controls for specifying the named attribute should be visible.
      Parameters:
      name -
      Returns:
      null if the attribute controls should always be visible;