protected void init() { prefs = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus"); IEclipsePreferences defaultpref = DefaultScope.INSTANCE.getNode("org.bbaw.bts.ui.corpus"); default_visibility = prefs.get(BTSCorpusConstants.PREF_LEMMA_DEFAULT_VISIBILITY, null); default_reviewState = prefs.get(BTSCorpusConstants.PREF_LEMMA_DEFAULT_REVIEWSTATE, null); object = BtsCorpusModelFactory.eINSTANCE.createBTSTCObject(); object.setVisibility(default_visibility); object.setRevisionState(default_reviewState); DataBindingContext bindingContext = new DataBindingContext(); // visibility EMFUpdateValueStrategy targetToModel_vis = new EMFUpdateValueStrategy(); targetToModel_vis.setConverter(new BTSConfigItemToStringConverter()); EMFUpdateValueStrategy modelToTarget_vis = new EMFUpdateValueStrategy(); modelToTarget_vis.setConverter(new BTSStringToConfigItemConverter(visibility_viewer)); IObservableValue target_vis_viewer = ViewersObservables.observeSingleSelection(visibility_viewer); Binding binding_vis = bindingContext.bindValue( target_vis_viewer, EMFProperties.value(BtsmodelPackage.Literals.ADMINISTRATIV_DATA_OBJECT__VISIBILITY) .observe(object), targetToModel_vis, modelToTarget_vis); // review status EMFUpdateValueStrategy targetToModel_rev = new EMFUpdateValueStrategy(); targetToModel_rev.setConverter(new BTSConfigItemToStringConverter()); EMFUpdateValueStrategy modelToTarget_rev = new EMFUpdateValueStrategy(); modelToTarget_rev.setConverter(new BTSStringToConfigItemConverter(reviewState_viewer)); IObservableValue target_rev_viewer = ViewersObservables.observeSingleSelection(reviewState_viewer); Binding binding_rev = bindingContext.bindValue( target_rev_viewer, EMFProperties.value(BtsmodelPackage.Literals.ADMINISTRATIV_DATA_OBJECT__REVISION_STATE) .observe(object), targetToModel_rev, modelToTarget_rev); super.initialize(); }
@Override protected void initialize() { super.initialize(); // When the chooser's selection changes, update the dateFormat & // enablement formatChooser.setPropertyChangeListener( new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (FieldEditor.VALUE.equals(event.getProperty())) { GitDateFormatter.Format format = fromString((String) event.getOldValue()); if (format == null) { lastCustomValue = dateFormat.getStringValue(); } updateFields((String) event.getNewValue()); } } }); }
/* (non-Javadoc) * Method declared on PreferencePage. */ @Override protected Control createContents(Composite parent) { fieldEditorParent = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginHeight = 0; layout.marginWidth = 0; fieldEditorParent.setLayout(layout); fieldEditorParent.setFont(parent.getFont()); createFieldEditors(); if (style == GRID) { adjustGridLayout(); } initialize(); checkState(); return fieldEditorParent; }
/** @see org.eclipse.jface.preference.FieldEditorPreferencePage#initialize() */ protected void initialize() { super.initialize(); }
@Override public void init(IWorkbench workbench) { super.initialize(); }