|
// CogentHelp customization example: Add a new exemplar
// to handle custom widget state information...
package com.cogentex.cogenthelp.exemplars;
import java.util.Vector;
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
import com.cogentex.trees.*;
import com.cogentex.sgml.*;
import com.cogentex.textplanner.*;
import com.cogentex.cogenthelp.*;
base SGMLExemplar;
//------------------------------------------------------
// Overrides the standard AddEnablementInfo exemplar to add
// a more detailed enablement message to a help topic
exemplar AddPictureWorkshopEnablementInfo( inherited Widget widget ) extends AddEnablementInfo
{
void apply()
{
// Retrieve a color name from the widget's state string - this has the
// form "Y" [widget is enabled] or "N:", where may be "null".
// We only add a message if the widget is disabled...
if (widget.State.startsWith("N:")) {
String colorName = widget.State.substring(2);
<<+
<p> :: Paragraph
<b><i>Note:</i></b>
This item is currently disabled, because
</p>
+>>
if (colorName.equals("null")) {
Paragraph <<+
no color is selected in the color list.
+>>
}
else {
Paragraph <<+
the color
<font color={ colorName }>{ colorName }</font>
is selected in the color list.
+>>
}
// call other exemplars to add enablement snippets,
// with appropriate text wrapping them...
Paragraph <<+
{{ AddWhenEnabled(widget) }}
{{ AddToEnable(widget) }}
+>>
}
}
}
(c) 2006 CoGenTex, Inc. All Rights Reserved.
|