use of de.janrufmonitor.framework.ICall in project janrufmonitor by tbrandt77.
the class ReIdentifyAction method run.
public void run() {
Viewer v = this.m_app.getApplication().getViewer();
if (v != null && v instanceof TableViewer) {
IStructuredSelection selection = (IStructuredSelection) v.getSelection();
if (!selection.isEmpty()) {
final ICall call = (ICall) selection.getFirstElement();
ICaller caller = call.getCaller();
if (caller.getPhoneNumber().isClired()) {
new SWTExecuter() {
protected void execute() {
int style = SWT.APPLICATION_MODAL | SWT.OK;
MessageBox messageBox = new MessageBox(new Shell(DisplayManager.getDefaultDisplay()), style);
messageBox.setMessage(getI18nManager().getString(getNamespace(), "clir", "label", getLanguage()));
messageBox.open();
}
}.start();
return;
}
List cms = getAllActiveCallerManagers(getRuntime());
if (cms.size() == 0) {
new SWTExecuter() {
protected void execute() {
int style = SWT.APPLICATION_MODAL | SWT.OK;
MessageBox messageBox = new MessageBox(new Shell(DisplayManager.getDefaultDisplay()), style);
messageBox.setMessage(getI18nManager().getString(getNamespace(), "nocms", "label", getLanguage()));
messageBox.open();
}
}.start();
return;
}
caller = Identifier.identify(getRuntime(), caller.getPhoneNumber(), cms);
if (caller == null) {
new SWTExecuter() {
protected void execute() {
int style = SWT.APPLICATION_MODAL | SWT.OK;
MessageBox messageBox = new MessageBox(new Shell(DisplayManager.getDefaultDisplay()), style);
messageBox.setMessage(getI18nManager().getString(getNamespace(), "notidentified", "label", getLanguage()));
messageBox.open();
}
}.start();
return;
}
final ICaller newCaller = openCallerWizard(caller);
if (newCaller != null) {
int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO;
MessageBox messageBox = new MessageBox(DisplayManager.getDefaultDisplay().getActiveShell(), style);
messageBox.setMessage(getI18nManager().getString(getNamespace(), "setall", "label", getLanguage()));
final int status = messageBox.open();
ProgressMonitorDialog pmd = new ProgressMonitorDialog(DisplayManager.getDefaultDisplay().getActiveShell());
try {
IRunnableWithProgress r = new IRunnableWithProgress() {
public void run(IProgressMonitor progressMonitor) {
progressMonitor.beginTask(getI18nManager().getString(getNamespace(), "assignprogress", "label", getLanguage()), IProgressMonitor.UNKNOWN);
progressMonitor.worked(1);
call.setCaller(newCaller);
processModifierServices(call);
if (status == SWT.NO && m_app.getController() instanceof IExtendedApplicationController) {
// added 2009/12/31: only update single entry
progressMonitor.setTaskName(getI18nManager().getString(getNamespace(), "assignprogress", "label", getLanguage()));
((IExtendedApplicationController) m_app.getController()).updateElement(call, false);
} else {
progressMonitor.setTaskName(getI18nManager().getString(getNamespace(), "assignall", "label", getLanguage()));
m_app.getController().updateElement(call);
}
progressMonitor.done();
}
};
pmd.setBlockOnOpen(false);
pmd.run(true, false, r);
// ModalContext.run(r, true, pmd.getProgressMonitor(),
// DisplayManager.getDefaultDisplay());
} catch (InterruptedException e) {
m_logger.log(Level.SEVERE, e.getMessage(), e);
} catch (InvocationTargetException e) {
m_logger.log(Level.SEVERE, e.getMessage(), e);
}
this.m_app.updateViews(true);
}
}
}
}
use of de.janrufmonitor.framework.ICall in project janrufmonitor by tbrandt77.
the class Status method renderAsImage.
public Image renderAsImage() {
if (this.m_o != null) {
if (this.m_o instanceof ICall) {
ICall call = (ICall) this.m_o;
IAttribute att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_REJECTED)) {
return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_REJECTED_GIF);
}
// att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_ACCEPTED)) {
return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_ACCEPTED_GIF);
}
// att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_OUTGOING)) {
return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_OUTGOING_GIF);
}
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_MISSED)) {
return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_AWAY_GIF);
}
/**
* // 2008/11/08: work-a-round for showing old status fields
* att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_REJECTED);
* if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_YES)) {
* return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_REJECTED_GIF);
* }
* att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_ACCEPTED);
* if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_YES)) {
* return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_ACCEPTED_GIF);
* }
* att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_OUTGOING);
* if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_YES)) {
* return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_OUTGOING_GIF);
* }
*/
return SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_AWAY_GIF);
}
}
return null;
}
use of de.janrufmonitor.framework.ICall in project janrufmonitor by tbrandt77.
the class CallActive method renderAsImageID.
public String renderAsImageID() {
if (this.m_o != null) {
if (this.m_o instanceof ICall) {
ICall call = (ICall) this.m_o;
IAttribute att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_REJECTED)) {
return IJAMConst.IMAGE_KEY_REJECTED_GIF;
}
// att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_ACCEPTED)) {
return IJAMConst.IMAGE_KEY_ACCEPTED_GIF;
}
// att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_OUTGOING)) {
return IJAMConst.IMAGE_KEY_OUTGOING_GIF;
}
if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_MISSED)) {
return IJAMConst.IMAGE_KEY_AWAY_GIF;
}
}
}
return "";
}
use of de.janrufmonitor.framework.ICall in project janrufmonitor by tbrandt77.
the class BChannel method renderAsImageID.
public String renderAsImageID() {
if (this.m_o != null) {
if (this.m_o instanceof ICall) {
ICall call = (ICall) this.m_o;
IAttribute att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_BCHANNEL);
if (att != null) {
if (att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_B1))
return IJAMConst.IMAGE_KEY_B1_JPG;
if (att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_B2))
return IJAMConst.IMAGE_KEY_B2_JPG;
}
}
}
return "";
}
Aggregations