Databases Reference
In-Depth Information
Your new Java class will be generated, and you might notice we have to implement
three methods.
Implementing the getBodyType and getOutputType
methods
These two methods specify whether the macro has a body (and the type of body if it
does have one) and the output type, be it block or inline. The macro we implement
will have a body and will have the block output type.
@Override
publicBodyTypegetBodyType() {
returnBodyType.RICH_TEXT;
}
@Override
publicOutputTypegetOutputType() {
returnOutputType.BLOCK;
}
Implementing the execute method
The execute method will determine what the output of our macro will be. I have
included an easy template with some HTML to style our button. We will be using
the body of our macro and use that as input for our button.
@Override
public String execute(Map<String, String> parameters,
String body, ConversionContext context) throws
MacroExecutionException {
String template = "<div class=\"aui-button aui-button-primary
link-button\">%s</div>";
returnString.format(template, body);
}
 
Search WWH ::




Custom Search