本文整理汇总了Java中org.radeox.macro.parameter.MacroParameter.get方法的典型用法代码示例。如果您正苦于以下问题:Java MacroParameter.get方法的具体用法?Java MacroParameter.get怎么用?Java MacroParameter.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.radeox.macro.parameter.MacroParameter
的用法示例。
在下文中一共展示了MacroParameter.get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.radeox.macro.parameter.MacroParameter; //导入方法依赖的package包/类
/**
* @see org.radeox.macro.Macro#execute(java.io.Writer, org.radeox.macro.parameter.MacroParameter)
*/
@Override
public void execute(Writer writer, MacroParameter params) throws IllegalArgumentException, IOException {
String name = params.get(NAME);
String address = params.get(ADDRESS);
String height = params.get(HEIGHT);
String width = params.get(WIDTH);
String displayduration = params.get(DISPLAYDURATION);
String displayname = params.getContent();
if (address == null) {
writer.write("<p>movieViewer: illegal format: missing attribute " + ADDRESS + "</p>");
return;
}
// default values for unset optional parameter
if (name == null) name = "remotelyControlled";
if (width == null) width = Integer.toString(DEFAULT_WIDTH);
if (height == null) height = Integer.toString(DEFAULT_HEIGHT);
try {
int iHeigt = Integer.parseInt(height);
height = Integer.toString(iHeigt + CONTROLLER_HEIGHT);
} catch (NumberFormatException e) {
// using default values
width = Integer.toString(DEFAULT_WIDTH);
height = Integer.toString(DEFAULT_HEIGHT + CONTROLLER_HEIGHT);
}
writer.write("<span class=\"b_wiki_timemarker_viewer\">");
// show popup link
writer.write("<a href=\"javascript:void(");
// open window a bit bitter than the movie size itself
String args = "width=" + (Integer.parseInt(width) + WIDTH_OFFSET) + ",height=" + (Integer.parseInt(height) + HEIGHT_OFFSET) + ",resizable=yes,scrollbars=yes";
writer.write("window.open(o_info.o_baseURI + '/movie/popup.html?maddress=' + encodeURIComponent('" + address + "') + '&mname=' + encodeURIComponent('" + name
+ "') + '&displayname=' + encodeURIComponent('" + displayname + "') + '&displayduration=' + encodeURIComponent('" + displayduration + "') + '&width="
+ width + "&height=" + height + "', '" + name + "', '" + args + "')");
writer.write(")\">Open movie player");
if (displayname != null) {
writer.write(": ");
writer.write(displayname);
if (displayduration != null) {
writer.write(": ");
}
}
if (displayduration != null) {
writer.write(displayduration);
}
writer.write("</a>");
writer.write("</span>");
}