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 class
BrowserHelpFile.ConfigSupport
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.static class
BrowserHelpFile.ContentsConfig
protected static class
BrowserHelpFile.MyConfigurer
Handles 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 String
CONTENTS
protected Action
launch
protected MenuItemProxy
launchItem
protected ComponentI18nData
myI18nData
protected String
name
protected PropertyChangeSupport
propSupport
static String
STARTING_PAGE
protected String
startingPage
static String
TITLE
protected URL
url
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Constructor Summary
Constructors Constructor Description BrowserHelpFile()
-
Method Summary
Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeListener.void
addTo(Buildable parent)
Adds this component to its parent.protected void
extractContents()
Class<?>[]
getAllowableConfigureComponents()
Return a list of valid sub-component Classes.String[]
getAttributeNames()
Lists all the buildFile (XML) attribute names for this component.String
getAttributeValueString(String key)
Configurable[]
getConfigureComponents()
String
getConfigureName()
The name of this Configurable ObjectConfigurer
getConfigurer()
Return aConfigurer
object which can be used to set the attributes of this objectstatic String
getConfigureTypeName()
protected String
getContentsResource()
HelpFile
getHelpFile()
ComponentI18nData
getI18nData()
void
launch()
protected void
recursiveDelete(File output)
Deprecated, for removal: This API element is subject to removal in a future version.void
remove(Buildable child)
Remove a child componentvoid
removeFrom(Buildable parent)
Remove this component from its parentvoid
setAttribute(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, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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.deleteDirectory
instead. -
getAttributeNames
Description copied from class:AbstractBuildable
Lists 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:
getAttributeNames
in classAbstractBuildable
- Returns:
- a list of all buildFile (XML) attribute names for this component
-
getAttributeValueString
- Specified by:
getAttributeValueString
in interfaceTranslatable
- Specified by:
getAttributeValueString
in 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:AbstractBuildable
Sets a buildFile (XML) attribute value for this component. Thekey
parameter will be one of those listed inAbstractBuildable.getAttributeNames()
. If thevalue
parameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)
for the samekey
. If the implementing class extendsAbstractConfigurable
, thenvalue
will be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
- Specified by:
setAttribute
in interfaceTranslatable
- Specified by:
setAttribute
in classAbstractBuildable
- Parameters:
key
- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()
value
- If thevalue
parameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)
for the samekey
. If the implementing class extendsAbstractConfigurable
, thenvalue
can also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
addTo
Description copied from interface:Buildable
Adds 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:Configurable
Remove this component from its parent- Specified by:
removeFrom
in interfaceConfigurable
-
addPropertyChangeListener
Description copied from interface:Configurable
Add a PropertyChangeListener. A PropertyChangeEvent should be fired with property nameConfigurable.NAME_PROPERTY
when the value returned fromConfigurable.getConfigureName()
has changed- Specified by:
addPropertyChangeListener
in interfaceConfigurable
-
getAllowableConfigureComponents
Description copied from interface:Configurable
Return 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:
getAllowableConfigureComponents
in interfaceConfigurable
-
getConfigureComponents
- Specified by:
getConfigureComponents
in interfaceConfigurable
- Returns:
- an array of Configurer objects representing the Configurable children of this Configurable object
-
getConfigureName
Description copied from interface:Configurable
The name of this Configurable Object- Specified by:
getConfigureName
in interfaceConfigurable
-
getConfigurer
Description copied from interface:Configurable
Return aConfigurer
object which can be used to set the attributes of this object- Specified by:
getConfigurer
in interfaceConfigurable
-
getHelpFile
- Specified by:
getHelpFile
in interfaceConfigurable
- Returns:
- a HelpFilte describing how to use and configure this component
-
remove
Description copied from interface:Configurable
Remove a child component- Specified by:
remove
in interfaceConfigurable
-
getConfigureTypeName
-
getI18nData
- Specified by:
getI18nData
in interfaceTranslatable
-
org.apache.commons.io.FileUtils.deleteDirectory
instead.