use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.
the class TwitterService method createFieldEditors.
protected void createFieldEditors() {
super.createFieldEditors();
BooleanFieldEditor bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "incoming", this.m_i18n.getString(this.getNamespace(), "incoming", "label", this.m_language), this.getFieldEditorParent());
addField(bfe);
StringFieldEditor sfe = new StringFieldEditor(getConfigNamespace() + SEPARATOR + "inmessage", this.m_i18n.getString(this.getNamespace(), "inmessage", "label", this.m_language), this.getFieldEditorParent());
sfe.setEmptyStringAllowed(false);
sfe.setTextLimit(160);
addField(sfe);
bfe = new BooleanFieldEditor(this.getConfigNamespace() + SEPARATOR + "outgoing", this.m_i18n.getString(this.getNamespace(), "outgoing", "label", this.m_language), this.getFieldEditorParent());
addField(bfe);
sfe = new StringFieldEditor(getConfigNamespace() + SEPARATOR + "outmessage", this.m_i18n.getString(this.getNamespace(), "outmessage", "label", this.m_language), this.getFieldEditorParent());
sfe.setEmptyStringAllowed(false);
sfe.setTextLimit(160);
addField(sfe);
if (getRuntime().getConfigManagerFactory().getConfigManager().getProperty("service.TwitterService", "auth1").length() == 0 || getRuntime().getConfigManagerFactory().getConfigManager().getProperty("service.TwitterService", "auth2").length() == 0) {
Button authenticate = new Button(this.getFieldEditorParent(), SWT.PUSH);
authenticate.setText(this.m_i18n.getString(this.getNamespace(), "auth", "label", this.m_language));
authenticate.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
}
public void widgetSelected(SelectionEvent arg0) {
ICommand c = getRuntime().getCommandFactory().getCommand("TwitterPINCommand");
if (c != null && c.isExecutable()) {
try {
c.execute();
} catch (Exception ex) {
m_logger.log(Level.SEVERE, ex.getMessage(), ex);
}
}
}
});
} else {
final Label l = new Label(this.getFieldEditorParent(), SWT.NORMAL);
l.setText(this.m_i18n.getString(this.getNamespace(), "isauth", "label", this.m_language));
GridData gd = new GridData();
gd.horizontalSpan = 2;
gd.widthHint = 500;
l.setLayoutData(gd);
Button unauthenticate = new Button(this.getFieldEditorParent(), SWT.PUSH);
unauthenticate.setLayoutData(gd);
unauthenticate.setText(this.m_i18n.getString(this.getNamespace(), "unauth", "label", this.m_language));
unauthenticate.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
}
public void widgetSelected(SelectionEvent arg0) {
getRuntime().getConfigManagerFactory().getConfigManager().setProperty("service.TwitterService", "auth1", "");
getRuntime().getConfigManagerFactory().getConfigManager().setProperty("service.TwitterService", "auth2", "");
getRuntime().getConfigManagerFactory().getConfigManager().saveConfiguration();
l.setText(m_i18n.getString(getNamespace(), "isnotauth", "label", m_language));
}
});
}
}
use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.
the class XTapi 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);
bfe = new BooleanFieldEditor(getConfigNamespace() + SEPARATOR + "deviceid", this.m_i18n.getString(this.getNamespace(), "deviceid", "label", this.m_language), this.getFieldEditorParent());
addField(bfe);
sfe = new StringFieldEditor(getConfigNamespace() + SEPARATOR + "festnetzalias", this.m_i18n.getString(this.getNamespace(), "festnetzalias", "label", this.m_language), this.getFieldEditorParent());
sfe.setEmptyStringAllowed(false);
addField(sfe);
}
IMonitor fbMonitor = this.getRuntime().getMonitorListener().getMonitor("XTapiMonitor");
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);
}
}
}
}
use of de.janrufmonitor.ui.jface.configuration.controls.BooleanFieldEditor in project janrufmonitor by tbrandt77.
the class BasicSettings method createContents.
protected Control createContents(Composite parent) {
this.setTitle(this.m_i18n.getString(this.getNamespace(), "title", "label", this.m_language));
final Composite c = new Composite(parent, SWT.NONE);
c.setLayout(new GridLayout(2, false));
clir = new StringFieldEditor(this.CONFIG_NAMESPACE + SEPARATOR + IJAMConst.GLOBAL_CLIR, this.m_i18n.getString(this.getNamespace(), IJAMConst.GLOBAL_CLIR, "label", this.m_language), 20, c);
clir.setStringValue(this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + "clir"));
intarea = new StringFieldEditor(this.CONFIG_NAMESPACE + SEPARATOR + IJAMConst.GLOBAL_INTAREA, this.m_i18n.getString(this.getNamespace(), IJAMConst.GLOBAL_INTAREA, "label", this.m_language), 5, c);
intarea.setStringValue(this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + IJAMConst.GLOBAL_INTAREA));
area = new StringFieldEditor(this.CONFIG_NAMESPACE + SEPARATOR + IJAMConst.GLOBAL_AREACODE, this.m_i18n.getString(this.getNamespace(), IJAMConst.GLOBAL_AREACODE, "label", this.m_language), 10, c);
area.setStringValue(this.getPreferenceStore().getString(this.CONFIG_NAMESPACE + SEPARATOR + IJAMConst.GLOBAL_AREACODE));
if (isExpertMode()) {
delay = new StringFieldEditor("monitor.MonitorListener" + SEPARATOR + "delay", this.m_i18n.getString(this.getNamespace(), "delay", "label", this.m_language), 3, c);
delay.setStringValue(this.getPreferenceStore().getString("monitor.MonitorListener" + SEPARATOR + "delay"));
hina = new BooleanFieldEditor("service.HibernateDetect" + SEPARATOR + "enabled", this.m_i18n.getString(this.getNamespace(), "hina_enabled", "label", this.m_language), 1, c);
hina.setPreferenceStore(this.getPreferenceStore());
hina.doLoad();
}
return c;
}
Aggregations