Search in sources :

Example 1 with IConfigManager

use of de.janrufmonitor.framework.configuration.IConfigManager in project janrufmonitor by tbrandt77.

the class MacAddressBookProxy method ensureEditorConfigurationCatergories.

@SuppressWarnings("unchecked")
public void ensureEditorConfigurationCatergories(List subfolders) {
    List ol = new ArrayList();
    IConfigManager mgr = this.getRuntime().getConfigManagerFactory().getConfigManager();
    String value = mgr.getProperty("ui.jface.application.editor.Editor", "categories");
    if (value.trim().length() > 0) {
        String[] values = value.split(",");
        for (int i = 0; i < values.length; i++) {
            ol.add(values[i]);
        }
    }
    for (int i = 0; i < subfolders.size(); i++) {
        if (!ol.contains(subfolders.get(i))) {
            ol.add(subfolders.get(i));
        // mgr.setProperty("ui.jface.application.editor.Editor", "filter_cat_ol"+i, "(5,category="+subfolders.get(i)+")");
        }
    }
    value = "";
    for (int i = 0; i < ol.size(); i++) {
        value += ol.get(i) + ",";
    }
    mgr.setProperty("ui.jface.application.editor.Editor", "categories", value);
    mgr.saveConfiguration();
    getRuntime().getConfigurableNotifier().notifyByNamespace("ui.jface.application.editor.Editor");
}
Also used : IConfigManager(de.janrufmonitor.framework.configuration.IConfigManager) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) ICallerList(de.janrufmonitor.framework.ICallerList) List(java.util.List)

Example 2 with IConfigManager

use of de.janrufmonitor.framework.configuration.IConfigManager in project janrufmonitor by tbrandt77.

the class Formatter method getParsedPhonenumber.

/**
 * Parses phonenumber object in the specified text representation.
 * The wildcard definitions are taken for parsing.
 *
 * @param text text to parse
 * @param phonenumber object to get the information from
 * @return parsed text
 * @deprecated
 */
public String getParsedPhonenumber(String text, IPhonenumber pn) {
    if (pn == null)
        return text;
    IConfigManager cfg = this.m_runtime.getConfigManagerFactory().getConfigManager();
    String callernumberExpression = cfg.getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_VARIABLE_CALLERNUMBER);
    if (pn.isClired()) {
        text = StringUtils.replaceString(text, IJAMConst.GLOBAL_VARIABLE_CALLERNUMBER, this.m_runtime.getConfigManagerFactory().getConfigManager().getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_CLIR));
    } else if (pn.getIntAreaCode().equalsIgnoreCase(IJAMConst.INTERNAL_CALL)) {
        // added: 2009/01/21: handling for internal calls
        text = StringUtils.replaceString(text, IJAMConst.GLOBAL_VARIABLE_CALLERNUMBER, pn.getCallNumber());
    } else {
        text = StringUtils.replaceString(text, IJAMConst.GLOBAL_VARIABLE_CALLERNUMBER, callernumberExpression);
        text = this.getParsedIntAreaCode(text, pn);
        text = this.getParsedAreaCode(text, pn);
        text = this.getParsedCallnumber(text, pn);
        // added: 2003/10/29: remove internal string on internal calls
        text = StringUtils.replaceString(text, IJAMConst.INTERNAL_CALL, "");
    }
    text = this.cleanString(text.trim());
    return text.trim();
}
Also used : IConfigManager(de.janrufmonitor.framework.configuration.IConfigManager)

Example 3 with IConfigManager

use of de.janrufmonitor.framework.configuration.IConfigManager in project janrufmonitor by tbrandt77.

the class Formatter method getParsedName.

/**
 * Parses Name object in the specified text representation.
 * The wildcard definitions are taken for parsing.
 *
 * @param text text to parse
 * @param Name object to get the information from
 * @return parsed text
 * @deprecated
 */
public String getParsedName(String text, IName name) {
    if (name == null)
        return text;
    IConfigManager cfg = this.m_runtime.getConfigManagerFactory().getConfigManager();
    // komplex types
    String callernameExpression = cfg.getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_VARIABLE_CALLERNAME);
    text = StringUtils.replaceString(text, IJAMConst.GLOBAL_VARIABLE_CALLERNAME, callernameExpression);
    // parse caller attributes
    IAttributeMap m = this.m_runtime.getCallerFactory().createAttributeMap();
    m.add(this.m_runtime.getCallerFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_FIRSTNAME, name.getFirstname()));
    m.add(this.m_runtime.getCallerFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_LASTNAME, name.getLastname()));
    m.add(this.m_runtime.getCallerFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_ADDITIONAL, name.getAdditional()));
    text = this.getParsedAttributes(text, m, true);
    text = StringUtils.replaceString(text, ",  ", " ");
    text = this.cleanString(text.trim());
    return text.trim();
}
Also used : IConfigManager(de.janrufmonitor.framework.configuration.IConfigManager) IAttributeMap(de.janrufmonitor.framework.IAttributeMap)

Example 4 with IConfigManager

use of de.janrufmonitor.framework.configuration.IConfigManager in project janrufmonitor by tbrandt77.

the class Formatter method getParsedMSNFormat.

private String getParsedMSNFormat(String text, IMsn msn) {
    if (msn == null)
        return text;
    IConfigManager cfg = this.m_runtime.getConfigManagerFactory().getConfigManager();
    String msnformatExpression = cfg.getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_VARIABLE_MSNFORMAT);
    text = StringUtils.replaceString(text, IJAMConst.GLOBAL_VARIABLE_MSNFORMAT, msnformatExpression);
    text = this.getParsedMSN(text, msn);
    text = this.cleanString(text);
    return text;
}
Also used : IConfigManager(de.janrufmonitor.framework.configuration.IConfigManager)

Example 5 with IConfigManager

use of de.janrufmonitor.framework.configuration.IConfigManager in project janrufmonitor by tbrandt77.

the class Formatter method getParsedCalltime.

/**
 * Parses date object in the specified text representation.
 * The wildcard definitions are taken for parsing.
 *
 * @param text text to parse
 * @param date object to get the information from
 * @return parsed text
 * @deprecated
 */
public String getParsedCalltime(String text, Date date) {
    if (date == null)
        return text;
    IConfigManager cfg = this.m_runtime.getConfigManagerFactory().getConfigManager();
    String calltimeExpression = cfg.getProperty(IJAMConst.GLOBAL_NAMESPACE, IJAMConst.GLOBAL_VARIABLE_CALLTIME);
    text = StringUtils.replaceString(text, IJAMConst.GLOBAL_VARIABLE_CALLTIME, calltimeExpression);
    text = this.getParsedDate(text, date);
    text = this.cleanString(text);
    return text;
}
Also used : IConfigManager(de.janrufmonitor.framework.configuration.IConfigManager)

Aggregations

IConfigManager (de.janrufmonitor.framework.configuration.IConfigManager)13 Iterator (java.util.Iterator)4 ICallerList (de.janrufmonitor.framework.ICallerList)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 SimpleDateFormat (java.text.SimpleDateFormat)2 NoSuchElementException (java.util.NoSuchElementException)2 StringTokenizer (java.util.StringTokenizer)2 IAttributeMap (de.janrufmonitor.framework.IAttributeMap)1 II18nManager (de.janrufmonitor.framework.i18n.II18nManager)1 ZipArchive (de.janrufmonitor.repository.zip.ZipArchive)1 ZipArchiveException (de.janrufmonitor.repository.zip.ZipArchiveException)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 IOException (java.io.IOException)1 Date (java.util.Date)1 Properties (java.util.Properties)1 FieldEditor (org.eclipse.jface.preference.FieldEditor)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1