use of de.janrufmonitor.service.comment.CommentCallerHandler in project janrufmonitor by tbrandt77.
the class PDFHistoryAction method run.
public void run() {
FileDialog dialog = new FileDialog(new Shell(DisplayManager.getDefaultDisplay()), SWT.SAVE);
dialog.setFilterExtensions(new String[] { "*.pdf" });
dialog.setFilterNames(new String[] { getI18nManager().getString(getNamespace(), "pdffilter", "label", getLanguage()) });
dialog.setText(getI18nManager().getString(getNamespace(), "pdf", "label", getLanguage()));
String filename = dialog.open();
if (filename != null && filename.length() > 0) {
if (this.m_app.getApplication() instanceof Comment) {
ICaller c = ((Comment) this.m_app.getApplication()).getCurrentCaller();
IService srv = getRuntime().getServiceFactory().getService("CommentService");
if (srv != null && srv instanceof CommentService) {
CommentCallerHandler cch = ((CommentService) srv).getHandler();
if (cch.hasCommentCaller(c)) {
ICommentCaller cc = cch.getCommentCaller(c);
try {
Class pdfclass = Thread.currentThread().getContextClassLoader().loadClass("de.janrufmonitor.ui.jface.application.comment.action.PDFCreator");
Constructor con = pdfclass.getConstructor(new Class[] { ICommentCaller.class, String.class });
Object pdfcreator = con.newInstance(new Object[] { cc, filename });
Method m = pdfclass.getMethod("createPdf", (Class) null);
m.invoke(pdfcreator, (Object) null);
} catch (ClassNotFoundException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
} catch (SecurityException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
} catch (NoSuchMethodException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
} catch (IllegalArgumentException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
} catch (InstantiationException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
} catch (IllegalAccessException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
} catch (InvocationTargetException e) {
this.m_logger.log(Level.SEVERE, e.getMessage(), e);
}
}
}
}
}
}
use of de.janrufmonitor.service.comment.CommentCallerHandler in project janrufmonitor by tbrandt77.
the class CommentDialog method getHandler.
private CommentCallerHandler getHandler() {
IService service = PIMRuntime.getInstance().getServiceFactory().getService("CommentService");
if (service != null) {
if (service instanceof CommentService) {
CommentService commentService = (CommentService) service;
CommentCallerHandler cch = commentService.getHandler();
return cch;
}
}
return null;
}
use of de.janrufmonitor.service.comment.CommentCallerHandler in project janrufmonitor by tbrandt77.
the class OldImportAction method getHandler.
private CommentCallerHandler getHandler() {
IService service = PIMRuntime.getInstance().getServiceFactory().getService("CommentService");
if (service != null) {
if (service instanceof CommentService) {
CommentService commentService = (CommentService) service;
CommentCallerHandler cch = commentService.getHandler();
return cch;
}
}
return null;
}
Aggregations