- 0 : no rotation
- 90 : text is rotated to the left with 90 degrees
- -90 : text is rotated to the right with 90 degrees
And for -90 degrees value:
public static Report loadReport(String xml) throws LoadReportException { ... }
public static Report loadReport(InputStream is) throws LoadReportException { ... }
public interface ReportListener {Our ReportService will manage report listeners for current logged user:
public void onFinishRun(ReportResultEvent result);
}
public void addReportListener(ReportListener reportListener) {When the process is finished we will create the event and we will notify all listeners:
reportListeners.put(SecurityUtil.getLoggedUsername(), reportListener);
}
public void removeReportListener() {
reportListeners.remove(SecurityUtil.getLoggedUsername());
}
public void notifyReportListener(ReportResultEvent event) {
ReportListener reportListener = reportListeners.get(event.getCreator());
if (reportListener != null) {
reportListener.onFinishRun(event);
}
}
ReportResultEvent event = new ReportResultEvent(...);To use jGrowl in Wicket it's easy with an AjaxBehavior. Messages will be kept in Session FeedbakMessages list.
reportService.notifyReportListener(event);
public class MessageAjaxBehavior extends AbstractDefaultAjaxBehavior {Rendered feedback message contains the jgrowl javascript text. Message can be sticky to live until user close it, or it can have a time-elapsed life using life with a millisecond value.
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.renderJavascriptReference(
new JavascriptResourceReference(MessageAjaxBehavior.class, "jquery.jgrowl.js"));
response.renderCSSReference(
new CompressedResourceReference(JGrowlAjaxBehavior.class, "jquery.jgrowl.css"));
response.renderCSSReference(
new CompressedResourceReference(JGrowlAjaxBehavior.class, "jgrowl.css"));
String feedback = renderFeedback();
if (!StringUtils.isEmpty(feedback)) {
response.renderOnDomReadyJavascript(feedback);
}
}
protected void respond(AjaxRequestTarget target) {
String feedback = renderFeedback();
if (!StringUtils.isEmpty(feedback)) {
target.appendJavascript(feedback);
}
}
.......
}
$.jGrowl("message",All options of jGrowl can be found here.
{
theme: 'css-class',
sticky: true // life: 5000
}
)
Label messageLabel = new Label("message", "");And we will initialize push service:
messageLabel .setOutputMarkupId(true);
messageLabel .add(new MessageAjaxBehavior());
protected void onInitialize() {
super.onInitialize();
initPush();
reportService.addReportListener(new ReportListener() {
public void onFinishRun(ReportResultEvent result) {
if (pushService.isConnected(pushNode)) {
// forward the Message event via the push service
// to the push event handler
Message message = createMessage(result);
pushService.publish(pushNode, message);
}
}
});
}
private void initPush() {
// instantiate push event handler
IPushEventHandler handler = new AbstractPushEventHandler() {
public void onEvent(AjaxRequestTarget target, Message event,
IPushNode node, IPushEventContext context) {
getSession().getFeedbackMessages().add(
new FeedbackMessage(null, event.getText(), messageType));
target.addComponent(messageLabel);
}
};
// obtain a reference to a Push service implementation
pushService = TimerPushService.get();
// install push node into this panel
pushNode = pushService.installNode(this, handler);
}