use of de.janrufmonitor.ui.jface.application.dialer.TapiDialerDialog in project janrufmonitor by tbrandt77.
the class TapiClickDialAction method run.
public void run() {
Viewer v = this.m_app.getApplication().getViewer();
if (v != null) {
IStructuredSelection selection = (IStructuredSelection) v.getSelection();
if (!selection.isEmpty()) {
Object o = selection.getFirstElement();
if (o instanceof ICall) {
o = ((ICall) o).getCaller();
}
if (o instanceof ICaller) {
o = ((ICaller) o).getPhoneNumber();
}
if (o instanceof ITreeItemCallerData) {
o = ((ITreeItemCallerData) o).getPhone();
}
if (o instanceof IPhonenumber) {
if (((IPhonenumber) o).isClired())
return;
String dial = ((IPhonenumber) o).getTelephoneNumber();
if (PhonenumberAnalyzer.getInstance(this.getRuntime()).isInternal(dial)) {
dial = ((IPhonenumber) o).getCallNumber();
} else {
if (!((IPhonenumber) o).getIntAreaCode().equalsIgnoreCase(this.getRuntime().getConfigManagerFactory().getConfigManager().getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_INTAREA))) {
dial = "00" + ((IPhonenumber) o).getIntAreaCode() + dial;
}
if (!dial.startsWith("0"))
dial = "0" + dial;
// added 2010/03/06: check for dial prefix for outgoing calls
// removed 2010/06/25: double addition of prefix. Is already added in Dialogue
// if (this.getRuntime().getConfigManagerFactory().getConfigManager().getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_DIAL_PREFIX).length()>0) {
// if (this.m_logger.isLoggable(Level.INFO))
// this.m_logger.info("Using dial prefix: "+this.getRuntime().getConfigManagerFactory().getConfigManager().getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_DIAL_PREFIX));
// dial = this.getRuntime().getConfigManagerFactory().getConfigManager().getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_DIAL_PREFIX).trim() + dial;
// }
}
TapiDialerDialog id = new TapiDialerDialog(new Shell(DisplayManager.getDefaultDisplay()), dial);
id.open();
this.m_app.updateViews(false);
}
}
}
}
Aggregations