caveatsPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
caveatsPanel.setLayout(new BoxLayout(caveatsPanel, BoxLayout.X_AXIS));
// We handle the applicationName specially so that we create
// only the docs for the app we are running.
Configuration configuration = getConfiguration();
try {
StringAttribute applicationNameAttribute = (StringAttribute) configuration
.getAttribute("_applicationName", StringAttribute.class);
if (applicationNameAttribute != null) {
_applicationName = applicationNameAttribute.getExpression();
}
} catch (Throwable throwable) {
// Ignore and use the default applicationName
}
JTextArea messageArea = new JTextArea(
"NOTE: Use this tool to build the Java"
+ " and Actor Documentation"
+ (_applicationName != null ? "for " + _applicationName
: "") + ".");
messageArea.setEditable(false);
messageArea.setBorder(BorderFactory.createEtchedBorder());
messageArea.setLineWrap(true);
messageArea.setWrapStyleWord(true);
caveatsPanel.add(messageArea);
JButton moreInfoButton = new JButton("More Info");
moreInfoButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
String infoFile = "ptolemy/vergil/actor/docViewerHelp.htm";
try {
Configuration configuration = getConfiguration();
// FIXME: Help should bring this up as well.
URL infoURL = Thread.currentThread()
.getContextClassLoader().getResource(infoFile);
configuration.openModel(null, infoURL, infoURL
.toExternalForm());
} catch (Exception ex) {
throw new InternalErrorException(docBuilder, ex,
"Failed to open " + infoFile);
}