Search in sources :

Example 6 with BooleanFieldEditor

use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.

the class FritzBoxSynchronizer method createFieldEditors.

protected void createFieldEditors() {
    // super.createFieldEditors();
    new Label(this.getFieldEditorParent(), SWT.NULL);
    String label = this.m_i18n.getString(this.getNamespace(), "enabled", "label", this.m_language);
    if (label.length() < 150)
        for (int i = 150; i > label.length(); i--) {
            label += " ";
        }
    BooleanFieldEditor bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "enabled", label, this.getFieldEditorParent());
    bfe.setEnabled(this.isFritzBoxPasswordSet(), this.getFieldEditorParent());
    addField(bfe);
    new Label(this.getFieldEditorParent(), SWT.NULL);
    new Label(this.getFieldEditorParent(), SWT.NULL);
    Label l = new Label(this.getFieldEditorParent(), SWT.NULL);
    l.setText(this.m_i18n.getString(this.getNamespace(), "times", "label", this.m_language));
    FontData df = new FontData();
    df.setStyle(SWT.BOLD);
    df.setHeight(l.getFont().getFontData()[0].getHeight());
    Font f = new Font(DisplayManager.getDefaultDisplay(), df);
    l.setFont(f);
    new Label(this.getFieldEditorParent(), SWT.NULL);
    BooleanFieldEditor sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "syncstartup", this.m_i18n.getString(this.getNamespace(), "syncstartup", "label", this.m_language), this.getFieldEditorParent());
    addField(sfe);
    IntegerFieldEditor ife = new IntegerFieldEditor(this.getConfigNamespace() + SEPARATOR + "startupdelay", this.m_i18n.getString(this.getNamespace(), "startupdelay", "label", this.m_language), this.getFieldEditorParent(), 3);
    addField(ife);
    sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "race", this.m_i18n.getString(this.getNamespace(), "race", "label", this.m_language), this.getFieldEditorParent());
    addField(sfe);
    ife = new IntegerFieldEditor(this.getConfigNamespace() + SEPARATOR + "synctimer", this.m_i18n.getString(this.getNamespace(), "synctimer", "label", this.m_language), this.getFieldEditorParent(), 3);
    addField(ife);
    new Label(this.getFieldEditorParent(), SWT.NULL);
    new Label(this.getFieldEditorParent(), SWT.NULL);
    l = new Label(this.getFieldEditorParent(), SWT.NULL);
    l.setText(this.m_i18n.getString(this.getNamespace(), "options", "label", this.m_language));
    l.setFont(f);
    new Label(this.getFieldEditorParent(), SWT.NULL);
    sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "syncall", this.m_i18n.getString(this.getNamespace(), "syncall", "label", this.m_language), this.getFieldEditorParent());
    addField(sfe);
    sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "syncclean", this.m_i18n.getString(this.getNamespace(), "syncclean", "label", this.m_language), this.getFieldEditorParent());
    addField(sfe);
    sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "synctam", this.m_i18n.getString(this.getNamespace(), "synctam", "label", this.m_language), this.getFieldEditorParent());
    addField(sfe);
    sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "syncdelete", this.m_i18n.getString(this.getNamespace(), "syncdelete", "label", this.m_language), this.getFieldEditorParent());
    addField(sfe);
    sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "syncdialog", this.m_i18n.getString(this.getNamespace(), "syncdialog", "label", this.m_language), this.getFieldEditorParent());
    addField(sfe);
    if (getRuntime().getServiceFactory().isServiceAvailable("MailNotification") && getRuntime().getServiceFactory().isServiceEnabled("MailNotification")) {
        sfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "syncnotification", this.m_i18n.getString(this.getNamespace(), "syncnotification", "label", this.m_language), this.getFieldEditorParent());
        addField(sfe);
    }
}
Also used : FontData(org.eclipse.swt.graphics.FontData) Label(org.eclipse.swt.widgets.Label) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor) Font(org.eclipse.swt.graphics.Font)

Example 7 with BooleanFieldEditor

use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.

the class InitFritzBoxVariantPage method createControl.

public void createControl(Composite parent) {
    setTitle(this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "title", "label", this.m_language));
    setDescription(this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "description", "label", this.m_language));
    final Composite c = new Composite(parent, SWT.NONE);
    c.setLayout(new GridLayout(1, false));
    c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    BooleanFieldEditor bfe = new BooleanFieldEditor("activemonitor", this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "activemonitor2", "label", this.m_language), c);
    bfe.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            if (e != null && e.getNewValue() != null && e.getNewValue() instanceof Boolean)
                m_active = ((Boolean) e.getNewValue()).booleanValue();
            setPageComplete(isComplete());
        }
    });
    new Label(c, SWT.LEFT);
    StringFieldEditor sfe = new StringFieldEditor("boxip", this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "boxip", "label", this.m_language), c);
    sfe.setStringValue("fritz.box");
    this.m_boxip = "fritz.box";
    sfe.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            if (e != null && e.getNewValue() != null && e.getNewValue() instanceof String)
                m_boxip = (String) e.getNewValue();
            setPageComplete(isComplete());
        }
    });
    ComboFieldEditor mode = new ComboFieldEditor("boxloginmode", this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "boxloginmode", "label", this.m_language), new String[][] { { this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "userpassword", "label", this.m_language), "0" }, { this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "password_only", "label", this.m_language), "1" } }, c);
    final StringFieldEditor sfe1 = new StringFieldEditor("boxuser", this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "boxuser", "label", this.m_language), c);
    sfe1.setStringValue("");
    this.m_boxuser = "";
    mode.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            if (e != null && e.getNewValue() != null && e.getNewValue() instanceof String) {
                String state = (String) e.getNewValue();
                if (state.equalsIgnoreCase("1")) {
                    sfe1.setEnabled(false, c);
                    sfe1.setStringValue("");
                    sfe1.getTextControl(c).setBackground(new Color(DisplayManager.getDefaultDisplay(), 190, 190, 190));
                    m_boxuser = "";
                } else {
                    sfe1.setEnabled(true, c);
                    sfe1.getTextControl(c).setBackground(new Color(DisplayManager.getDefaultDisplay(), 255, 255, 255));
                }
            }
        }
    });
    sfe1.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            if (e != null && e.getNewValue() != null && e.getNewValue() instanceof String)
                m_boxuser = (String) e.getNewValue();
            setPageComplete(isComplete());
        }
    });
    sfe = new StringFieldEditor("boxpassword", this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "boxpassword", "label", this.m_language), c);
    sfe.getTextControl(c).setEchoChar('*');
    sfe.setStringValue("");
    this.m_boxpassword = "";
    sfe.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            if (e != null && e.getNewValue() != null && e.getNewValue() instanceof String)
                m_boxpassword = (String) e.getNewValue();
            setPageComplete(isComplete());
        }
    });
    new Label(c, SWT.LEFT);
    bfe = new BooleanFieldEditor("usemsns", this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "usemsns", "label", this.m_language), c);
    bfe.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            if (e != null && e.getNewValue() != null && e.getNewValue() instanceof Boolean)
                m_usemsns = ((Boolean) e.getNewValue()).booleanValue();
            setPageComplete(isComplete());
        }
    });
    new Label(c, SWT.LEFT);
    Text l = new Text(c, SWT.LEFT | SWT.WRAP);
    l.setText(this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "openfb", "label", this.m_language));
    l.setEditable(false);
    l.setBackground(parent.getBackground());
    new Label(c, SWT.LEFT);
    HyperLink hl = new HyperLink(c, SWT.LEFT | SWT.WRAP);
    hl.setText(this.m_i18n.getString("ui.jface.configuration.pages.FritzBoxVoip", "openfb2", "label", this.m_language));
    hl.addMouseListener(new MouseAdapter() {

        public void mouseDown(MouseEvent e) {
            if (e.button == 1)
                Program.launch("http://www.janrufmonitor.de/fritzbox-freischalten");
        }
    });
    setPageComplete(isComplete());
    setControl(c);
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) Color(org.eclipse.swt.graphics.Color) Label(org.eclipse.swt.widgets.Label) MouseAdapter(org.eclipse.swt.events.MouseAdapter) BooleanFieldEditor(de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor) Text(org.eclipse.swt.widgets.Text) ComboFieldEditor(org.eclipse.jface.preference.ComboFieldEditor) HyperLink(de.janrufmonitor.ui.jface.application.controls.HyperLink) StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData)

Example 8 with BooleanFieldEditor

use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.

the class NcidVoip method createFieldEditors.

protected void createFieldEditors() {
    StringFieldEditor sfe = null;
    BooleanFieldEditor bfe = new BooleanFieldEditor(getConfigNamespace() + SEPARATOR + "activemonitor", this.m_i18n.getString(this.getNamespace(), "activemonitor", "label", this.m_language), this.getFieldEditorParent());
    addField(bfe);
    if (isExpertMode()) {
        bfe = new BooleanFieldEditor(getConfigNamespace() + SEPARATOR + "outgoing", this.m_i18n.getString(this.getNamespace(), "outgoing", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
    }
    sfe = new StringFieldEditor(getConfigNamespace() + SEPARATOR + "boxip", this.m_i18n.getString(this.getNamespace(), "boxip", "label", this.m_language), this.getFieldEditorParent());
    sfe.setEmptyStringAllowed(false);
    addField(sfe);
    if (isExpertMode()) {
        sfe = new StringFieldEditor(getConfigNamespace() + SEPARATOR + "boxmport", this.m_i18n.getString(this.getNamespace(), "boxmport", "label", this.m_language), this.getFieldEditorParent());
        sfe.setEmptyStringAllowed(false);
        addField(sfe);
        sfe = new StringFieldEditor(getConfigNamespace() + SEPARATOR + "festnetzalias", this.m_i18n.getString(this.getNamespace(), "festnetzalias", "label", this.m_language), this.getFieldEditorParent());
        sfe.setEmptyStringAllowed(true);
        addField(sfe);
        IntegerFieldEditor ife = new IntegerFieldEditor(getConfigNamespace() + SEPARATOR + "retrymax", this.m_i18n.getString(this.getNamespace(), "retrymax", "label", this.m_language), this.getFieldEditorParent());
        ife.setTextLimit(2);
        addField(ife);
        bfe = new BooleanFieldEditor(getConfigNamespace() + SEPARATOR + "sync_cidlog", this.m_i18n.getString(this.getNamespace(), "sync_cidlog", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
    }
    IMonitor fbMonitor = this.getRuntime().getMonitorListener().getMonitor("NcidMonitor");
    if (fbMonitor != null) {
        String[] fbInfos = fbMonitor.getDescription();
        Label capi_label = new Label(this.getFieldEditorParent(), 0);
        capi_label.setText(this.m_i18n.getString(this.getNamespace(), "fbinfo", "label", this.m_language));
        for (int i = 0; i < fbInfos.length; i++) {
            if (fbInfos[i].trim().length() > 0) {
                Label capi = new Label(this.getFieldEditorParent(), SWT.NULL);
                capi.setText(fbInfos[i]);
                new Label(this.getFieldEditorParent(), SWT.NULL);
            }
        }
    }
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) Label(org.eclipse.swt.widgets.Label) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor) IMonitor(de.janrufmonitor.framework.monitor.IMonitor)

Example 9 with BooleanFieldEditor

use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.

the class MacAddressBookManager method createFieldEditors.

protected void createFieldEditors() {
    super.createFieldEditors();
    if (isExpertMode()) {
        BooleanFieldEditor bfe = new BooleanFieldEditor(getConfigNamespace() + SEPARATOR + "keepextension", this.m_i18n.getString(this.getNamespace(), "keepextension", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
        StringFieldEditor sfe = new StringFieldEditor(getConfigNamespace() + SEPARATOR + "addnumbers", this.m_i18n.getString(this.getNamespace(), "addnumbers", "label", this.m_language), this.getFieldEditorParent());
        sfe.setEmptyStringAllowed(false);
        addField(sfe);
    }
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) BooleanFieldEditor(de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor)

Example 10 with BooleanFieldEditor

use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.

the class OutlookCallerManager method createFieldEditors.

protected void createFieldEditors() {
    super.createFieldEditors();
    if (isExpertMode()) {
        BooleanFieldEditor bfe = new BooleanFieldEditor(getConfigNamespace() + SEPARATOR + "split", this.m_i18n.getString(this.getNamespace(), "split", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
        bfe = new BooleanFieldEditor(getConfigNamespace() + SEPARATOR + "keepextension", this.m_i18n.getString(this.getNamespace(), "keepextension", "label", this.m_language), this.getFieldEditorParent());
        addField(bfe);
        ComboFieldEditor cfe = new ComboFieldEditor(getConfigNamespace() + SEPARATOR + "mode", this.m_i18n.getString(this.getNamespace(), "mode", "label", this.m_language), new String[][] { { this.m_i18n.getString(this.getNamespace(), "mode1", "label", this.m_language), "1" }, { this.m_i18n.getString(this.getNamespace(), "mode2", "label", this.m_language), "2" }, { this.m_i18n.getString(this.getNamespace(), "mode3", "label", this.m_language), "3" } }, this.getFieldEditorParent());
        addField(cfe);
        cfe = new ComboFieldEditor(getConfigNamespace() + SEPARATOR + "index", this.m_i18n.getString(this.getNamespace(), "index", "label", this.m_language), new String[][] { { "1 min", "1" }, { "5 min", "5" }, { "30 min", "30" }, { "60 min", "60" }, { "120 min", "120" } }, this.getFieldEditorParent());
        addField(cfe);
    // OutlookTransformer ot = new OutlookTransformer();
    // 
    // List folders = ot.getAllContactFolders();
    // if (folders.size()>0) {
    // Label header = new Label(this.getFieldEditorParent(), SWT.NONE);
    // header.setText(this.m_i18n.getString(this.getNamespace(), "import", "label", this.m_language));
    // 
    // 
    // int itemCount = 0;
    // String folder = null;
    // String label = null;
    // for (int i=0,j=folders.size();i<j;i++) {
    // folder = (String)folders.get(i);
    // itemCount = ot.getContactCount(folder);
    // if (itemCount>0) {
    // label = this.m_i18n.getString(this.getNamespace(), "sf", "label", this.m_language);
    // label = StringUtils.replaceString(label, "{%1}", folder);
    // label = StringUtils.replaceString(label, "{%2}", Integer.toString(itemCount));
    // bfe = new BooleanFieldEditor(
    // getConfigNamespace()+SEPARATOR+"subfolder_"+folder,
    // label,
    // this.getFieldEditorParent()
    // );
    // addField(bfe);
    // }
    // }
    // }
    }
}
Also used : BooleanFieldEditor(de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor) ComboFieldEditor(org.eclipse.jface.preference.ComboFieldEditor)

Aggregations

BooleanFieldEditor (de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor)13 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)8 Label (org.eclipse.swt.widgets.Label)7 GridData (org.eclipse.swt.layout.GridData)5 Composite (org.eclipse.swt.widgets.Composite)5 ComboFieldEditor (org.eclipse.jface.preference.ComboFieldEditor)4 SelectionEvent (org.eclipse.swt.events.SelectionEvent)4 GridLayout (org.eclipse.swt.layout.GridLayout)4 IMonitor (de.janrufmonitor.framework.monitor.IMonitor)3 IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 Button (org.eclipse.swt.widgets.Button)3 TableViewer (org.eclipse.jface.viewers.TableViewer)2 Color (org.eclipse.swt.graphics.Color)2 Table (org.eclipse.swt.widgets.Table)2 TableColumn (org.eclipse.swt.widgets.TableColumn)2 Text (org.eclipse.swt.widgets.Text)2 ICaller (de.janrufmonitor.framework.ICaller)1 ICommand (de.janrufmonitor.framework.command.ICommand)1 II18nManager (de.janrufmonitor.framework.i18n.II18nManager)1