Skip to main content

MathFlow end-user help options

The MathFlow SDK editors recognize two types of help: HTML and JavaHelp. If you are using applets, the download time of large jar files may cause the applet initialization to appear stalled. If this is the case, we recommend you use HTML pages for your online help to minimize the size of the jar files. Alternatively, JavaHelp is a full help system that includes an index and search. If users have a fast connection (such as a company intranet), downloading a large jar file might not be an issue and you should use JavaHelp. The JavaHelp is included in MFStyleEditor.jar and MFStructureEditor.jar. If you decide not to use JavaHelp and would like a smaller jar file to use for an applet, remove the help directory from the jar and resign it.

HTML Pages

The SDK contains HTML pages for the Simple, Style, and Structure Editors. The Simple Editor and Simple Editor Applet can only use HTML pages as help, since JavaHelp isn't included in their jar files. The HTML help pages for the Style and Structure Editors are context-sensitive; thus, changing the names of the HTML files will cause this feature to malfunction. Alternatively, you can customize any editor's content pages. For example, you can replace the editor screenshots with those from your own custom editor.

Applets

To set your applet to use HTML pages, use the setHelp() javascript method. You need to pass in 2 (non-context sensitive) for the Simple Editor helpType and 1 (context sensitive) for the Style Editor. The resulting javascript for the Style or Structure Editor is similar to that shown below.

<script type="text/javascript">
    function setHelp() {
      SampleStyleEditorApplet.setHelp(1, 
        "../../../docs/help/html/style/index.htm");
    }
  </script>
</head>
<body onLoad="setHelp()">

Applications

Applications use the SimpleConfigurationInfo, StyleConfigurationInfo, and StructureConfigurationInfo objects to set various options on the editor. The following code sets the HTML Help via this object:

StyleConfigurationInfo config = new StyleConfigurationInfo(); 
// To use context sensitive HTML Help page  
config.setHelp(HelpInfo.HTML_HELP, 
    "../../../docs/help/html/style/index.htm"); 

JavaHelp

JavaHelp for the Style and Structure Editors is included in the MFStyleEditor.jar and MFStructureEditor.jar. JavaHelp is context-sensitive and provides a complete help system, including a table of contents, index and search.

Applets

Pass in 0 for the helpType and ensure that the correct jar file is on your classpath. Pass the name of the jar containing the JavaHelp as the second parameter to setHelp. Applets require the name of the jar that contains the JavaHelp.

<script type="text/javascript">
    function setHelp() {
      SampleStyleEditorApplet.setHelp(0, 
        "MFStyleEditor.jar");
    }
  </script>
</head>
<body onLoad="setHelp()">

Applications

Analogous to setting the HTML Help, you must use the SimpleConfigurationInfo, StyleConfigurationInfo, and StructureConfigurationInfo objects to set the help type to JavaHelp. Applications do not require the name of the jar containing the JavaHelp to be passed in; however, it must be on the classpath.

StyleConfigurationInfo config = new StyleConfigurationInfo();
// To use context sensitive JavaHelp 
config.setHelp(HelpInfo.JAVA_HELP);