Search in sources :

Example 1 with PreferenceChangeEvent

use of org.jkiss.dbeaver.model.preferences.DBPPreferenceListener.PreferenceChangeEvent in project dbeaver by dbeaver.

the class BinaryPanelEditor method createControl.

@Override
public HexEditControl createControl(IValueController valueController) {
    HexEditControl hControl = new HexEditControl(valueController.getEditPlaceholder(), SWT.BORDER);
    DBPPreferenceListener preferencesChangeListener = new DBPPreferenceListener() {

        @Override
        public void preferenceChange(PreferenceChangeEvent event) {
            if (HexPreferencesPage.PROP_DEF_WIDTH.equals(event.getProperty())) {
                String defValue = (String) event.getNewValue();
                hControl.setDefWidth(Integer.valueOf(defValue));
            }
        }
    };
    DBPPreferenceStore store = DBeaverCore.getGlobalPreferenceStore();
    store.addPropertyChangeListener(preferencesChangeListener);
    return hControl;
}
Also used : PreferenceChangeEvent(org.jkiss.dbeaver.model.preferences.DBPPreferenceListener.PreferenceChangeEvent) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore) HexEditControl(org.jkiss.dbeaver.ui.editors.binary.HexEditControl) DBPPreferenceListener(org.jkiss.dbeaver.model.preferences.DBPPreferenceListener)

Aggregations

DBPPreferenceListener (org.jkiss.dbeaver.model.preferences.DBPPreferenceListener)1 PreferenceChangeEvent (org.jkiss.dbeaver.model.preferences.DBPPreferenceListener.PreferenceChangeEvent)1 DBPPreferenceStore (org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)1 HexEditControl (org.jkiss.dbeaver.ui.editors.binary.HexEditControl)1