Class BrowserHelpFile
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.module.documentation.BrowserHelpFile
- All Implemented Interfaces:
Buildable,Configurable,PropertyNameSource,ValidityChecker,Translatable
public class BrowserHelpFile extends AbstractBuildable implements Configurable
Unpacks a zipped directory stored in the module and displays it in an
external browser window.
- Author:
- rkinney
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBrowserHelpFile.ConfigSupportThe 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.static classBrowserHelpFile.ContentsConfigprotected static classBrowserHelpFile.MyConfigurerHandles the packaging of the target directory into the module file after the user saves the properties in the editor -
Field Summary
Fields Modifier and Type Field Description static StringCONTENTSprotected Actionlaunchprotected MenuItemProxylaunchItemprotected ComponentI18nDatamyI18nDataprotected Stringnameprotected PropertyChangeSupportpropSupportstatic StringSTARTING_PAGEprotected StringstartingPagestatic StringTITLEprotected URLurlFields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validatorFields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY -
Constructor Summary
Constructors Constructor Description BrowserHelpFile() -
Method Summary
Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener l)Add a PropertyChangeListener.voidaddTo(Buildable parent)Adds this component to its parent.protected voidextractContents()Class<?>[]getAllowableConfigureComponents()Return a list of valid sub-component Classes.String[]getAttributeNames()Lists all the buildFile (XML) attribute names for this component.StringgetAttributeValueString(String key)Configurable[]getConfigureComponents()StringgetConfigureName()The name of this Configurable ObjectConfigurergetConfigurer()Return aConfigurerobject which can be used to set the attributes of this objectstatic StringgetConfigureTypeName()protected StringgetContentsResource()HelpFilegetHelpFile()ComponentI18nDatagetI18nData()voidlaunch()protected voidrecursiveDelete(File output)Deprecated, for removal: This API element is subject to removal in a future version.voidremove(Buildable child)Remove a child componentvoidremoveFrom(Buildable parent)Remove this component from its parentvoidsetAttribute(String key, Object value)Sets a buildFile (XML) attribute value for this component.Methods inherited from class VASSAL.build.AbstractBuildable
add, build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.build.Buildable
add, build, getBuildElement
-
Field Details
-
TITLE
- See Also:
- Constant Field Values
-
CONTENTS
- See Also:
- Constant Field Values
-
STARTING_PAGE
- See Also:
- Constant Field Values
-
name
-
startingPage
-
launch
-
url
-
propSupport
-
myI18nData
-
launchItem
-
-
Constructor Details
-
BrowserHelpFile
public BrowserHelpFile()
-
-
Method Details
-
launch
public void launch() -
getContentsResource
- Returns:
- The entry in the module Zip file containing the HTML directory
-
extractContents
protected void extractContents() -
recursiveDelete
Deprecated, for removal: This API element is subject to removal in a future version.Useorg.apache.commons.io.FileUtils.deleteDirectoryinstead. -
getAttributeNames
Description copied from class:AbstractBuildableLists all the buildFile (XML) attribute names for this component. If this component is ALSO anAbstractConfigurable, then this list of attributes determines the appropriate attribute order forAbstractConfigurable.getAttributeDescriptions()andAbstractConfigurable.getAttributeTypes().- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all buildFile (XML) attribute names for this component
-
getAttributeValueString
- Specified by:
getAttributeValueStringin interfaceTranslatable- Specified by:
getAttributeValueStringin classAbstractBuildable- Parameters:
key- the name of the attribute. 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
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object).
-
setAttribute
Description copied from class:AbstractBuildableSets a buildFile (XML) attribute value for this component. Thekeyparameter will be one of those listed inAbstractBuildable.getAttributeNames(). If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluewill be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()- Specified by:
setAttributein interfaceTranslatable- Specified by:
setAttributein classAbstractBuildable- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()value- If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
addTo
Description copied from interface:BuildableAdds this component to its parent. In order to make Buildable objects extensible, the child is reponsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable
-
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
Description copied from interface:ConfigurableReturn 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 Configuration Window.- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable
-
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
Description copied from interface:ConfigurableReturn aConfigurerobject which can be used to set the attributes of this object- Specified by:
getConfigurerin interfaceConfigurable
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Returns:
- a HelpFilte describing how to use and configure this component
-
remove
Description copied from interface:ConfigurableRemove a child component- Specified by:
removein interfaceConfigurable
-
getConfigureTypeName
-
getI18nData
- Specified by:
getI18nDatain interfaceTranslatable
-
org.apache.commons.io.FileUtils.deleteDirectoryinstead.