Search in sources :

Example 81 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project janrufmonitor by tbrandt77.

the class InitDataPathPage method createControl.

public void createControl(Composite parent) {
    setTitle(this.m_i18n.getString(getNamespace(), "title", "label", this.m_language));
    setDescription(this.m_i18n.getString(getNamespace(), "description", "label", this.m_language));
    Composite c = new Composite(parent, SWT.NONE);
    c.setLayout(new GridLayout(1, false));
    c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    DirectoryFieldEditor dfe = new DirectoryFieldEditor(this.m_i18n.getString(getNamespace(), "name", "label", this.m_language), this.m_i18n.getString(getNamespace(), "label", "label", this.m_language), this.m_i18n.getString(getNamespace(), "message", "label", this.m_language), c);
    dfe.setStringValue(m_oldDatapath);
    dfe.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            m_newDatapath = (String) e.data;
        }
    });
    dfe.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            m_newDatapath = (String) e.getNewValue();
        }
    });
    setPageComplete(isComplete());
    setControl(c);
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) DirectoryFieldEditor(de.janrufmonitor.ui.jface.configuration.controls.DirectoryFieldEditor)

Example 82 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project janrufmonitor by tbrandt77.

the class TwitterPINPage method createControl.

public void createControl(Composite parent) {
    setTitle(this.m_i18n.getString(getNamespace(), "title", "label", this.m_language));
    setDescription(this.m_i18n.getString(getNamespace(), "description", "label", this.m_language));
    Composite c = new Composite(parent, SWT.NONE);
    c.setLayout(new GridLayout(1, false));
    c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    StringFieldEditor sfe = new StringFieldEditor("pin", this.m_i18n.getString(getNamespace(), "pin", "label", this.m_language), 10, c);
    sfe.setStringValue("");
    this.m_PIN = "";
    sfe.setPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent e) {
            if (e != null && e.getNewValue() != null && e.getNewValue() instanceof String)
                m_PIN = (String) e.getNewValue();
            setPageComplete(isComplete());
        }
    });
    Button rPIN = new Button(c, SWT.PUSH);
    rPIN.setText(this.m_i18n.getString(getNamespace(), "rpin", "label", this.m_language));
    rPIN.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent arg0) {
        }

        public void widgetSelected(SelectionEvent arg0) {
            try {
                Program.launch(m_client.authorizeUrl().toURL().toExternalForm());
            } catch (MalformedURLException e) {
                m_logger.severe(e.toString());
            }
        }
    });
    setPageComplete(isComplete());
    setControl(c);
}
Also used : StringFieldEditor(org.eclipse.jface.preference.StringFieldEditor) IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) GridLayout(org.eclipse.swt.layout.GridLayout) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) MalformedURLException(java.net.MalformedURLException) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 83 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project janrufmonitor by tbrandt77.

the class PreferenceConfigManagerStore method firePropertyChangeEvent.

public void firePropertyChangeEvent(String property, Object oldValue, Object newValue) {
    IPropertyChangeListener pcl = null;
    for (int i = 0; i < this.m_pcl.size(); i++) {
        pcl = (IPropertyChangeListener) this.m_pcl.get(i);
        pcl.propertyChange(new PropertyChangeEvent(this, property, oldValue, newValue));
    }
// 2004/12/28: removed due to performance reasons
// String[] p = this.tokenizeProperty(property);
// this.getRuntime().getConfigurableNotifier().notifyByNamespace(p[0]);
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent)

Example 84 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project tdq-studio-se by Talend.

the class AbstractMemoryChangeNotifier method initializeThresholdsFromPreferences.

private void initializeThresholdsFromPreferences() {
    isThresholdControl = PlatformUI.getPreferenceStore().getBoolean(ANALYSIS_AUTOMATIC_MEMORY_CONTROL);
    userDefineThreshold = PlatformUI.getPreferenceStore().getInt(ANALYSIS_MEMORY_THRESHOLD);
    reloadPerference();
    PlatformUI.getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent event) {
            // MOD scorreia 2013-09-10 update also isThresholdControl
            if (event.getProperty() == ANALYSIS_AUTOMATIC_MEMORY_CONTROL) {
                isThresholdControl = Boolean.valueOf(event.getNewValue().toString());
                reloadPerference();
            } else if (event.getProperty() == ANALYSIS_MEMORY_THRESHOLD) {
                userDefineThreshold = Integer.valueOf(event.getNewValue().toString());
                isThresholdControl = true;
                reloadPerference();
            }
        }
    });
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent)

Example 85 with IPropertyChangeListener

use of org.eclipse.jface.util.IPropertyChangeListener in project whole by wholeplatform.

the class ModelMergeViewer method fireDirtyState.

protected void fireDirtyState(boolean state) {
    final PropertyChangeEvent event = new PropertyChangeEvent(this, CompareEditorInput.DIRTY_STATE, false, state);
    if (listenerList == null || listenerList.isEmpty())
        return;
    Runnable runnable = new Runnable() {

        public void run() {
            for (IPropertyChangeListener listener : listenerList) {
                final IPropertyChangeListener propertyChangeListener = listener;
                SafeRunner.run(new ISafeRunnable() {

                    public void run() throws Exception {
                        propertyChangeListener.propertyChange(event);
                    }

                    public void handleException(Throwable exception) {
                    }
                });
            }
        }
    };
    UISynchronize uiSynchronize = getContext().get(UISynchronize.class);
    if (uiSynchronize != null)
        uiSynchronize.syncExec(runnable);
    else
        runnable.run();
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) ISafeRunnable(org.eclipse.core.runtime.ISafeRunnable) ISafeRunnable(org.eclipse.core.runtime.ISafeRunnable) UISynchronize(org.eclipse.e4.ui.di.UISynchronize)

Aggregations

IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)126 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)120 Composite (org.eclipse.swt.widgets.Composite)55 GridData (org.eclipse.swt.layout.GridData)44 Label (org.eclipse.swt.widgets.Label)39 GridLayout (org.eclipse.swt.layout.GridLayout)37 SelectionEvent (org.eclipse.swt.events.SelectionEvent)31 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)25 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)22 Button (org.eclipse.swt.widgets.Button)22 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)21 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)20 ColorSelector (org.eclipse.jface.preference.ColorSelector)14 ComboViewer (org.eclipse.jface.viewers.ComboViewer)12 Text (org.eclipse.swt.widgets.Text)11 Iterator (java.util.Iterator)10 ISelection (org.eclipse.jface.viewers.ISelection)10 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)10 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)9 SashForm (org.eclipse.swt.custom.SashForm)9