Class BrowserHelpFile.ConfigSupport
java.lang.Object
VASSAL.build.module.documentation.BrowserHelpFile.ConfigSupport
- All Implemented Interfaces:
AutoConfigurable,Buildable,Configurable,Translatable
- Enclosing class:
BrowserHelpFile
The attributes we want to expose in the editor are not the same as the ones we want to save to the buildFile, so we
use this object to specify the properties in the editor. Also packs up the contents directory and saves it to the
ArchiveWriter
-
Nested Class Summary
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
FieldsFields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a child component.voidAdd a PropertyChangeListener.voidAdds this component to its parent.voidBuild the object from the XML representation of the BuildableClass<?>[]String[]Return an array of Strings describing the attributes of this object.String[]Class<?>[]Return the Class for the attributes of this object.Called by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML elementgetAttributeVisibility(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.getBuildElement(Document doc) The name of this Configurable Objectvoidprotected voidpackFile(File packed, String prefix, ZipOutputStream out) voidRemove a child componentvoidremoveFrom(Buildable parent) Remove this component from its parentvoidsetAttribute(String key, Object value) Called by theBuildable.build(org.w3c.dom.Element)method, wherevalueis the String value read by the XML attribute.
-
Field Details
-
DIR
- See Also:
-
dir
-
-
Constructor Details
-
ConfigSupport
protected ConfigSupport()
-
-
Method Details
-
getAttributeDescriptions
Description copied from interface:AutoConfigurableReturn an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object.- Specified by:
getAttributeDescriptionsin interfaceAutoConfigurable
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceAutoConfigurable- Returns:
- an array of Strings giving all attributes of this Buildable component that will be written to/read from an XML element
-
getAttributeTypes
Description copied from interface:AutoConfigurableReturn the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke- Specified by:
getAttributeTypesin interfaceAutoConfigurable
-
getAttributeValueString
Description copied from interface:AutoConfigurableCalled by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML element- Specified by:
getAttributeValueStringin interfaceAutoConfigurable- Specified by:
getAttributeValueStringin interfaceTranslatable- Parameters:
key- the name of the attribute. If the implementing class extendsAbstractConfigurable, will be one of those listed inAbstractBuildable.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(java.lang.String, java.lang.Object).
-
getAttributeVisibility
Description copied from interface:AutoConfigurableBecause 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.- Specified by:
getAttributeVisibilityin interfaceAutoConfigurable- Parameters:
name-- Returns:
- null if the attribute controls should always be visible;
-
setAttribute
Description copied from interface:AutoConfigurableCalled by theBuildable.build(org.w3c.dom.Element)method, wherevalueis the String value read by the XML attribute. Can also be called with Object value to set the attribute.- Specified by:
setAttributein interfaceAutoConfigurable- Specified by:
setAttributein interfaceTranslatable- Parameters:
key- the name of the attribute. If the implementing class extendsAbstractConfigurable, will be one of those listed inAbstractBuildable.getAttributeNames().value- If thevalueparameter is a String, it will be the value returned byTranslatable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
packContents
public void packContents() -
packFile
- Throws:
IOException
-
addPropertyChangeListener
Description copied from interface:ConfigurableAdd a PropertyChangeListener. A PropertyChangeEvent should be fired with property nameConfigurable.NAME_PROPERTYwhen the value returned fromConfigurable.getConfigureName()has changed- Specified by:
addPropertyChangeListenerin interfaceConfigurable
-
getAllowableConfigureComponents
- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable- Returns:
- a list of valid sub-component Classes. If a Class
appears in this list, then instances of that class may be added
to this component from the Editor's
ConfigureTreewindow by right-clicking on the component and selecting the appropriate "Add" option.
-
getConfigureComponents
- Specified by:
getConfigureComponentsin interfaceConfigurable- Returns:
- an array of Configurer objects representing the Configurable children of this Configurable object
-
getConfigureName
Description copied from interface:ConfigurableThe name of this Configurable Object- Specified by:
getConfigureNamein interfaceConfigurable
-
getConfigurer
- Specified by:
getConfigurerin interfaceConfigurable- Returns:
- a
Configurerobject which can be used to set the attributes of this object
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Returns:
- a HelpFile describing how to use and configure * this component
-
remove
Description copied from interface:ConfigurableRemove a child component- Specified by:
removein interfaceConfigurable
-
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable
-
add
Description copied from interface:BuildableAdds a child component. Both this method andBuildable.addTo(VASSAL.build.Buildable)are invoked when adding a child to a parent -
addTo
Description copied from interface:BuildableAdds this component to its parent. In order to make Buildable objects extensible, the child is responsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
build
Description copied from interface:BuildableBuild the object from the XML representation of the Buildable -
getBuildElement
- Specified by:
getBuildElementin interfaceBuildable- Parameters:
doc- XML file- Returns:
- an XML element from which this component can be built
-
getI18nData
- Specified by:
getI18nDatain interfaceTranslatable
-