ui.accessibility
Class HelpAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ui.accessibility.HelpAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class HelpAction
extends javax.swing.AbstractAction

Help Action

Author:
gregoire
See Also:
Serialized Form

Field Summary
private static java.lang.String anchor
          anchor
private  java.lang.String cName
          component name
private static java.lang.String file
          name
private static java.lang.String id
          id
private static long serialVersionUID
          Pour la sérialisation (non utilisé)
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
HelpAction(java.lang.String newid, java.lang.String name, java.lang.Boolean isContextual)
          Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
private  java.lang.String closeUselessTags(java.lang.String s, int i)
          close tags
private  boolean createAccessibleHelp(java.lang.Boolean b)
          creates a new html file
private  java.lang.String findExtract(java.lang.String e)
          finds extract surrounded by
private static java.lang.String[] getID()
           
 void resetTOC(java.lang.Boolean isContextualHelp)
          tidies the table of content
 java.lang.String toHTML(java.lang.String s)
          replaces special characters (except <, >, ", &)
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Pour la sérialisation (non utilisé)

See Also:
Constant Field Values

id

private static java.lang.String id
id


file

private static java.lang.String file
name


anchor

private static java.lang.String anchor
anchor


cName

private java.lang.String cName
component name

Constructor Detail

HelpAction

public HelpAction(java.lang.String newid,
                  java.lang.String name,
                  java.lang.Boolean isContextual)
Constructor

Parameters:
newid - : ID of the help page
name - : name of the help page (if context)
isContextual - : false if from main window, true otherwise
Method Detail

getID

private static java.lang.String[] getID()
Returns:
helpfilename and anchor

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Parameters:
e - : action event

resetTOC

public void resetTOC(java.lang.Boolean isContextualHelp)
tidies the table of content

Parameters:
isContextualHelp - : true if contextual (creates html file)

createAccessibleHelp

private boolean createAccessibleHelp(java.lang.Boolean b)
creates a new html file

Parameters:
b - : false if opened from main window
Returns:
true if the new help sheet is successfully created

closeUselessTags

private java.lang.String closeUselessTags(java.lang.String s,
                                          int i)
close tags

Parameters:
s - : string to clean
i - : iterator
Returns:
s cleared

toHTML

public java.lang.String toHTML(java.lang.String s)
replaces special characters (except <, >, ", &)

Parameters:
s - string with special characters
Returns:
string with html characters

findExtract

private java.lang.String findExtract(java.lang.String e)
finds extract surrounded by and [...]

Parameters:
e - TODO
Returns:
true if extract found