Prompt prompt = (Prompt)component;
prompt.getPromptListeners().add(this);
// Load the prompt content
WTKXSerializer wtkxSerializer = new WTKXSerializer();
Component content = null;
try {
content = (Component)wtkxSerializer.readObject(this, "terra_prompt_skin.wtkx");
} catch(Exception exception) {
throw new RuntimeException(exception);
}
prompt.setContent(content);
// Set the type image
TerraTheme theme = (TerraTheme)Theme.getTheme();
ImageView typeImageView = (ImageView)wtkxSerializer.get("typeImageView");
typeImageView.setImage(theme.getMessageIcon(prompt.getMessageType()));
// Set the message
Label messageLabel = (Label)wtkxSerializer.get("messageLabel");
String message = prompt.getMessage();
messageLabel.setText(message);
// Set the body
BoxPane messageBoxPane = (BoxPane)wtkxSerializer.get("messageBoxPane");
Component body = prompt.getBody();
if (body != null) {
messageBoxPane.add(body);
}
// Add the option buttons
BoxPane buttonBoxPane = (BoxPane)wtkxSerializer.get("buttonBoxPane");
for (int i = 0, n = prompt.getOptionCount(); i < n; i++) {
Object option = prompt.getOption(i);
PushButton optionButton = new PushButton(option);