List of usage examples for org.eclipse.jface.databinding.swt SWTObservables observeText
@Deprecated public static ISWTObservableValue observeText(Control control, int event)
control
. From source file:de.walware.statet.r.internal.sweave.processing.TexTab.java
License:Open Source License
@Override protected void addBindings(final DataBindingContext dbc, final Realm realm) { fOpenTexEnabledValue = new WritableValue(realm, false, Boolean.class); fOpenTexOnErrorsEnabledValue = new WritableValue(realm, false, Boolean.class); fOutputDirValue = new WritableValue(realm, null, String.class); fBuildTexTypeValue = new WritableValue(realm, 0, Integer.class); fBuildTexBuilderIdValue = new WritableValue(realm, 0, Integer.class); fBuildTexRCommandsValue = new WritableValue(realm, "", String.class); //$NON-NLS-1$ fOutputFormatValue = new WritableValue(realm, "", String.class); //$NON-NLS-1$ final ISWTObservableValue openObs = SWTObservables.observeSelection(fOpenTexFileControl); dbc.bindValue(openObs, fOpenTexEnabledValue, null, null); dbc.bindValue(SWTObservables.observeSelection(fOpenTexFileOnErrorsControl), fOpenTexOnErrorsEnabledValue, null, null);// www.j a v a2 s . co m dbc.bindValue(new RadioGroupObservable(realm, new Button[] { fBuildTexFileDisabledControl, fBuildTexFileEclipseControl, fBuildTexFileRControl }), fBuildTexTypeValue, null, null); dbc.bindValue(new BuildChooserObservable(fBuildTexTypeChooser), fBuildTexBuilderIdValue, null, null); dbc.bindValue(SWTObservables.observeText(fConsoleCommandEditor.getTextControl(), SWT.Modify), fBuildTexRCommandsValue, null, null); dbc.bindValue(SWTObservables.observeText(fOutputFormatControl), fOutputFormatValue); fBuildTexBuilderIdValue.addValueChangeListener(new IValueChangeListener() { @Override public void handleValueChange(final ValueChangeEvent event) { updateFormat(); } }); fBuildTexTypeValue.addValueChangeListener(new IValueChangeListener() { @Override public void handleValueChange(final ValueChangeEvent event) { final Object newValue = event.diff.getNewValue(); final int typeId = (newValue instanceof Integer) ? ((Integer) newValue).intValue() : -1; switch (typeId) { case BUILDTEX_TYPE_ECLIPSE: updateFormat(); break; case BUILDTEX_TYPE_RCONSOLE: if (RweaveTexLaunchDelegate.DEFAULT_BUILDTEX_R_COMMANDS .equals(fBuildTexRCommandsValue.getValue())) { fOutputFormatValue.setValue(RweaveTexLaunchDelegate.DEFAULT_BUILDTEX_FORMAT); } break; } } }); // Enablement dbc.bindValue(SWTObservables.observeEnabled(fOpenTexFileOnErrorsControl), openObs, null, null); final Composite group = fBuildTexTypeChooser.getControl(); dbc.bindValue(new SWTMultiEnabledObservable(realm, group.getChildren(), null), new ComputedValue(realm, Boolean.class) { @Override protected Object calculate() { return (((Integer) fBuildTexTypeValue .getValue()) == RweaveTexLaunchDelegate.BUILDTEX_TYPE_ECLIPSE); } }, null, null); dbc.bindValue( new SWTMultiEnabledObservable(realm, new Control[] { fConsoleCommandEditor.getControl() }, null), new ComputedValue(realm, Boolean.class) { @Override protected Object calculate() { return (((Integer) fBuildTexTypeValue .getValue()) == RweaveTexLaunchDelegate.BUILDTEX_TYPE_RCONSOLE); } }, null, null); dbc.bindValue(new SWTMultiEnabledObservable(realm, new Control[] { fOutputFormatControl }, null), new ComputedValue(realm, Boolean.class) { @Override protected Object calculate() { return (((Integer) fBuildTexTypeValue .getValue()) != RweaveTexLaunchDelegate.BUILDTEX_TYPE_ECLIPSE); } }, null, null); dbc.bindValue(fOutputDirControl.getObservable(), fOutputDirValue, new UpdateValueStrategy().setAfterGetValidator(fOutputDirControl.getValidator()), null); }
From source file:de.walware.statet.r.internal.ui.dataeditor.GotoCellDialog.java
License:Open Source License
@Override protected void addBindings(final DataBindingSupport db) { for (final Orientation orientation : Orientation.values()) { final Range range = this.indexRanges[orientation.ordinal()]; db.getContext()//from w ww . j a v a 2s.c om .bindValue(SWTObservables.observeText(this.indexControls[orientation.ordinal()], SWT.Modify), this.indexValues[orientation.ordinal()], new UpdateValueStrategy() .setAfterGetValidator( new LongValidator((range.start + 1), range.end, "Invalid " + getLabel(orientation) + " index (" + (range.start + 1) + "\u2013" + range.end + ").")), null); this.indexControls[orientation.ordinal()].selectAll(); } }
From source file:de.walware.statet.r.internal.ui.pkgmanager.RRepoPreferencePage.java
License:Open Source License
@Override protected void addBindings(final DataBindingSupport databinding) { final DataBindingContext dbc = databinding.getContext(); dbc.bindValue(SWTObservables.observeText(fNameControl, SWT.Modify), PojoObservables.observeValue(fRepo, "name"), //$NON-NLS-1$ null, null);//from w ww .j av a 2 s . c om dbc.bindValue(SWTObservables.observeText(fURLControl, SWT.Modify), PojoObservables.observeValue(fRepo, "URL"), //$NON-NLS-1$ new UpdateValueStrategy() .setAfterGetValidator(new NotEmptyValidator("URL", new URLValidator("URL"))), null); dbc.bindValue(ViewersObservables.observeSingleSelection(fTypeControl), PojoObservables.observeValue(fRepo, "pkgType"), //$NON-NLS-1$ new UpdateValueStrategy().setConverter(new Converter(RPkgType.class, RPkgType.class) { @Override public Object convert(final Object fromObject) { return (fromObject != DEFAULT_TYPE) ? fromObject : null; } }), new UpdateValueStrategy().setConverter(new Converter(RPkgType.class, RPkgType.class) { @Override public Object convert(final Object fromObject) { return (fromObject != null) ? fromObject : DEFAULT_TYPE; } })); }
From source file:de.walware.statet.r.internal.ui.preferences.RCodeStylePreferenceBlock.java
License:Open Source License
@Override protected void addBindings(final DataBindingSupport db) { fStdIndentSettings.addBindings(db, fModel); db.getContext().bindValue(SWTObservables.observeText(fIndentBlockDepth, SWT.Modify), BeansObservables.observeValue(db.getRealm(), fModel, RCodeStyleSettings.INDENT_BLOCK_DEPTH_PROP), new UpdateValueStrategy().setAfterGetValidator( new IntegerValidator(1, 10, Messages.RCodeStyle_Indent_IndentInBlocks_error_message)), null);//from w w w .j av a2s . c o m db.getContext().bindValue(SWTObservables.observeText(fIndentGroupDepth, SWT.Modify), BeansObservables.observeValue(db.getRealm(), fModel, RCodeStyleSettings.INDENT_GROUP_DEPTH_PROP), new UpdateValueStrategy().setAfterGetValidator( new IntegerValidator(1, 10, Messages.RCodeStyle_Indent_IndentInGroups_error_message)), null); db.getContext().bindValue(SWTObservables.observeText(fIndentWrappedCommandDepth, SWT.Modify), BeansObservables.observeValue(db.getRealm(), fModel, RCodeStyleSettings.INDENT_WRAPPED_COMMAND_DEPTH_PROP), new UpdateValueStrategy().setAfterGetValidator(new IntegerValidator(1, 10, Messages.RCodeStyle_Indent_IndentOfWrappedCommands_error_message)), null); db.getContext().bindValue(SWTObservables.observeSelection(fWSArgAssignBefore), BeansObservables.observeValue(db.getRealm(), fModel, RCodeStyleSettings.WS_ARGASSIGN_BEFORE_PROP)); db.getContext().bindValue(SWTObservables.observeSelection(fWSArgAssignBehind), BeansObservables.observeValue(db.getRealm(), fModel, RCodeStyleSettings.WS_ARGASSIGN_BEHIND_PROP)); db.getContext().bindValue(SWTObservables.observeSelection(fNLFDefBodyBlockBefore), BeansObservables .observeValue(db.getRealm(), fModel, RCodeStyleSettings.NL_FDEF_BODYBLOCK_BEFOREP_PROP)); }
From source file:de.walware.statet.r.internal.ui.preferences.REditorPreferencePage.java
License:Open Source License
@Override protected void addBindings(final DataBindingSupport db) { db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertControl), createObservable(REditorOptions.SMARTINSERT_BYDEFAULT_ENABLED_PREF)); db.getContext().bindValue(ViewersObservables.observeSingleSelection(fSmartInsertTabActionControl), createObservable(REditorOptions.SMARTINSERT_TAB_ACTION_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertOnPasteControl[0]), createObservable(REditorOptions.SMARTINSERT_ONPASTE_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertOnPasteControl[0]), createObservable(REditorOptions.SMARTINSERT_ONPASTE_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseCurlyBracketsControl[0]), createObservable(REditorOptions.SMARTINSERT_CLOSECURLY_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseRoundBracketsControl[0]), createObservable(REditorOptions.SMARTINSERT_CLOSEROUND_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseSquareBracketsControl[0]), createObservable(REditorOptions.SMARTINSERT_CLOSESQUARE_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseSpecialControl[0]), createObservable(REditorOptions.SMARTINSERT_CLOSESPECIAL_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseStringsControl[0]), createObservable(REditorOptions.SMARTINSERT_CLOSESTRINGS_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseCurlyBracketsControl[1]), createObservable(RUIPreferenceInitializer.CONSOLE_SMARTINSERT_CLOSECURLY_ENABLED)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseRoundBracketsControl[1]), createObservable(RUIPreferenceInitializer.CONSOLE_SMARTINSERT_CLOSEROUND_ENABLED)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseSquareBracketsControl[1]), createObservable(RUIPreferenceInitializer.CONSOLE_SMARTINSERT_CLOSESQUARE_ENABLED)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseSpecialControl[1]), createObservable(RUIPreferenceInitializer.CONSOLE_SMARTINSERT_CLOSESPECIAL_ENABLED)); db.getContext().bindValue(SWTObservables.observeSelection(fSmartInsertCloseStringsControl[1]), createObservable(RUIPreferenceInitializer.CONSOLE_SMARTINSERT_CLOSESTRINGS_ENABLED)); db.getContext().bindValue(SWTObservables.observeSelection(fFoldingEnableControl), createObservable(REditorOptions.FOLDING_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fFoldingRestoreStateControl), createObservable(REditorOptions.FOLDING_RESTORE_STATE_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fFoldingDefaultAllBlocksControl), createObservable(DefaultRFoldingPreferences.PREF_OTHERBLOCKS_ENABLED)); db.getContext().bindValue(SWTObservables.observeText(fFoldingDefaultMinLines, SWT.Modify), createObservable(DefaultRFoldingPreferences.PREF_MINLINES_NUM), new UpdateValueStrategy().setAfterGetValidator( new IntegerValidator(2, 1000, Messages.REditorOptions_Folding_MinNumOfLines_error_message)), null);//from w w w . j a v a2s. co m db.getContext().bindValue(SWTObservables.observeSelection(fFoldingDefaultRoxygenControl), createObservable(DefaultRFoldingPreferences.PREF_ROXYGEN_ENABLED)); db.getContext().bindValue(SWTObservables.observeSelection(fFoldingDefaultRoxygenInitiallyControl), createObservable(DefaultRFoldingPreferences.PREF_ROXYGEN_COLLAPSE_INITIALLY_ENABLED)); db.getContext().bindValue(SWTObservables.observeText(fFoldingDefaultRoxygenMinLines, SWT.Modify), createObservable(DefaultRFoldingPreferences.PREF_ROXYGEN_MINLINES_NUM), new UpdateValueStrategy().setAfterGetValidator( new IntegerValidator(2, 1000, Messages.REditorOptions_Folding_MinNumOfLines_error_message)), null); db.getContext().bindValue(SWTObservables.observeSelection(fMarkOccurrencesControl), createObservable(REditorOptions.PREF_MARKOCCURRENCES_ENABLED)); db.getContext().bindValue(SWTObservables.observeSelection(fProblemsEnableControl), createObservable(REditorBuild.PROBLEMCHECKING_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSpellEnableControl), createObservable(REditorOptions.PREF_SPELLCHECKING_ENABLED)); }
From source file:de.walware.statet.r.internal.ui.rhelp.RHelpPreferencePage.java
License:Open Source License
@Override protected void addBindings(final DataBindingSupport db) { db.getContext().bindValue(new HomeObservable(db.getRealm()), createObservable(RHelpPreferences.HOMEPAGE_URL_PREF)); db.getContext().bindValue(SWTObservables.observeSelection(fSearchReusePageControl), createObservable(RHelpPreferences.SEARCH_REUSE_PAGE_ENABLED_PREF)); db.getContext().bindValue(SWTObservables.observeText(fSearchMaxFragmentsControl, SWT.Modify), createObservable(RHelpPreferences.SEARCH_PREVIEW_FRAGMENTS_MAX_PREF), new UpdateValueStrategy().setAfterGetValidator( new IntegerValidator(1, 1000, "Invalid maximum for preview fragments specified (1-1000).")), null);// w w w .jav a 2s .c om }
From source file:de.walware.statet.r.internal.ui.wizards.RPkgProjectWizardPage.java
License:Open Source License
protected void addBindings(final DataBindingContext dbc, final Realm realm) { fPkgNameValue = new WritableValue(realm, "", String.class); fPkgUserChanged = new DirtyTracker(); final Binding binding = dbc.bindValue(SWTObservables.observeText(fPkgNameControl, SWT.Modify), fPkgNameValue, new UpdateValueStrategy().setAfterGetValidator(new RPkgNameValidator()), null); fPkgUserChanged.add(binding);/*from w w w .ja v a 2s. c om*/ }
From source file:de.walware.statet.redocs.internal.tex.r.ui.processing.TexTab.java
License:Open Source License
@Override protected void addBindings(final DataBindingContext dbc, final Realm realm) { final ISWTObservableValue openObs = SWTObservables.observeSelection(this.fOpenTexFileControl); dbc.bindValue(openObs, this.fOpenTexEnabledValue, null, null); dbc.bindValue(SWTObservables.observeSelection(this.fOpenTexFileOnErrorsControl), this.fOpenTexOnErrorsEnabledValue, null, null); dbc.bindValue(/*from w ww . java 2s . c o m*/ new RadioGroupObservable(realm, new Button[] { this.fBuildTexFileDisabledControl, this.fBuildTexFileEclipseControl, this.fBuildTexFileRControl }), this.fBuildTexTypeValue, null, null); dbc.bindValue(new BuildChooserObservable(this.fBuildTexTypeChooser), this.fBuildTexBuilderIdValue, null, null); dbc.bindValue(SWTObservables.observeText(this.fConsoleCommandEditor.getTextControl(), SWT.Modify), this.fBuildTexRCommandsValue, null, null); dbc.bindValue(SWTObservables.observeText(this.fOutputFormatControl), this.fOutputFormatValue); this.fBuildTexBuilderIdValue.addValueChangeListener(new IValueChangeListener() { @Override public void handleValueChange(final ValueChangeEvent event) { updateFormat(); } }); this.fBuildTexTypeValue.addValueChangeListener(new IValueChangeListener() { @Override public void handleValueChange(final ValueChangeEvent event) { final Object newValue = event.diff.getNewValue(); final int typeId = (newValue instanceof Integer) ? ((Integer) newValue).intValue() : -1; switch (typeId) { case BUILDTEX_TYPE_ECLIPSE: updateFormat(); break; case BUILDTEX_TYPE_RCONSOLE: if (TexRweaveLaunchDelegate.DEFAULT_BUILDTEX_R_COMMANDS .equals(TexTab.this.fBuildTexRCommandsValue.getValue())) { TexTab.this.fOutputFormatValue.setValue(TexRweaveLaunchDelegate.DEFAULT_BUILDTEX_FORMAT); } break; } } }); // Enablement dbc.bindValue(SWTObservables.observeEnabled(this.fOpenTexFileOnErrorsControl), openObs, null, null); final Composite group = this.fBuildTexTypeChooser.getControl(); dbc.bindValue(new SWTMultiEnabledObservable(realm, group.getChildren(), null), new ComputedValue(realm, Boolean.class) { @Override protected Object calculate() { return (((Integer) TexTab.this.fBuildTexTypeValue .getValue()) == TexRweaveLaunchDelegate.BUILDTEX_TYPE_ECLIPSE); } }, null, null); dbc.bindValue(new SWTMultiEnabledObservable(realm, new Control[] { this.fConsoleCommandEditor.getControl() }, null), new ComputedValue(realm, Boolean.class) { @Override protected Object calculate() { return (((Integer) TexTab.this.fBuildTexTypeValue .getValue()) == TexRweaveLaunchDelegate.BUILDTEX_TYPE_RCONSOLE); } }, null, null); dbc.bindValue(new SWTMultiEnabledObservable(realm, new Control[] { this.fOutputFormatControl }, null), new ComputedValue(realm, Boolean.class) { @Override protected Object calculate() { return (((Integer) TexTab.this.fBuildTexTypeValue .getValue()) != TexRweaveLaunchDelegate.BUILDTEX_TYPE_ECLIPSE); } }, null, null); dbc.bindValue(this.fOutputDirControl.getObservable(), this.fOutputDirValue, new UpdateValueStrategy().setAfterGetValidator(this.fOutputDirControl.getValidator()), null); }
From source file:dynamicrefactoring.interfaz.wizard.RefactoringWizardPage1.java
License:Open Source License
/** * Crea el contenido de la pgina del wizard. * /* ww w .jav a 2s . c o m*/ * @param parent * el elemento padre de esta pgina. */ public void createControl(Composite parent) { parent.getShell().setSize(WINDOW_WIDTH, WINDOW_HEIGHT); centerShell(parent.getShell()); Composite composite = new Composite(parent, SWT.NULL); final GridLayout compositeLayout = new GridLayout(2, false); compositeLayout.verticalSpacing = PAGE_VERTICAL_SPACING; composite.setLayout(compositeLayout); setControl(composite); //Name createLabel(composite, Messages.RefactoringWizardPage1_Name, SWT.CENTER); nameText = new Text(composite, SWT.BORDER); nameText.setLayoutData(getUniLineTextGridData()); this.nameText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); //Description createLabel(composite, Messages.RefactoringWizardPage1_Description); descriptionText = createMultiLineText(composite, Messages.RefactoringWizardPage1_GiveDescription); this.descriptionText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); //Image createLabel(composite, Messages.RefactoringWizardPage1_Image, SWT.CENTER); createSelectImageComposite(composite); //Motivation createLabel(composite, Messages.RefactoringWizardPage1_Motivation); motivationText = createMultiLineText(composite, Messages.RefactoringWizardPage1_GiveMotivation); this.motivationText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); //Keywords createLabel(composite, Messages.RefactoringWizardPage1_Keywords); keywordsText = createMultiLineText(composite, Messages.RefactoringWizardPage1_Give_Keywords); //Categories createLabel(composite, Messages.RefactoringWizardPage1_Categories); categoryTree = createCategoryTree(composite); DataBindingContext dbc = new DataBindingContext(); IObservableValue modelObservable = BeansObservables.observeValue(this, "refactoringImage"); //$NON-NLS-1$ dbc.bindValue(SWTObservables.observeText(imageText, SWT.Modify), modelObservable, null, null); if (refactoring != null) { fillInRefactoringData(); refactoringImage = refactoring.getImageAbsolutePath(); } }
From source file:dynamicrefactoring.interfaz.wizard.RefactoringWizardPage6.java
License:Open Source License
/** * Crea el contenido de la pgina del asistente. * // ww w . j a v a 2s . co m * @param parent * el elemento padre de esta pgina del asistente. */ public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new FormLayout()); setControl(container); final Composite composite = new Composite(container, SWT.NONE); final FormData fd_composite = new FormData(); fd_composite.left = new FormAttachment(0, 5); fd_composite.top = new FormAttachment(0, 5); fd_composite.bottom = new FormAttachment(100, -5); fd_composite.right = new FormAttachment(100, -5); composite.setLayoutData(fd_composite); final Label itsPossibleToLabel = new Label(composite, SWT.NONE); itsPossibleToLabel.setText(Messages.RefactoringWizardPage6_AddExamples); itsPossibleToLabel.setBounds(106, 26, 431, 13); final Group example1Group = new Group(composite, SWT.NONE); example1Group.setText(Messages.RefactoringWizardPage6_Example1); example1Group.setBounds(23, 55, 602, 117); final Label beforeRefactoringLabel = new Label(example1Group, SWT.NONE); beforeRefactoringLabel.setText(Messages.RefactoringWizardPage6_BeforeRefactoring); beforeRefactoringLabel.setBounds(10, 29, 116, 13); final Label afterRefactoringLabel = new Label(example1Group, SWT.NONE); afterRefactoringLabel.setText(Messages.RefactoringWizardPage6_AfterRefactoring); afterRefactoringLabel.setBounds(10, 75, 116, 13); textBefore1 = new Text(example1Group, SWT.BORDER); textBefore1.setBounds(132, 26, 420, 25); textBefore1.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); final Button bt_examineBefore1 = new Button(example1Group, SWT.NONE); bt_examineBefore1.setText("..."); //$NON-NLS-1$ bt_examineBefore1.setBounds(558, 29, 30, 18); bt_examineBefore1.addSelectionListener(new ExampleChooserAction(textBefore1)); textAfter1 = new Text(example1Group, SWT.BORDER); textAfter1.setBounds(132, 72, 420, 25); textAfter1.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); final Button btExamineAfter1 = new Button(example1Group, SWT.NONE); btExamineAfter1.setText("..."); //$NON-NLS-1$ btExamineAfter1.setBounds(558, 75, 30, 18); btExamineAfter1.addSelectionListener(new ExampleChooserAction(textAfter1)); final Group example1Group_1 = new Group(composite, SWT.NONE); example1Group_1.setBounds(23, 195, 602, 117); example1Group_1.setText(Messages.RefactoringWizardPage6_Example2); final Label beforeRefactoringLabel_1 = new Label(example1Group_1, SWT.NONE); beforeRefactoringLabel_1.setBounds(10, 29, 118, 13); beforeRefactoringLabel_1.setText(Messages.RefactoringWizardPage6_BeforeRefactoring); final Label afterRefactoringLabel_1 = new Label(example1Group_1, SWT.NONE); afterRefactoringLabel_1.setBounds(10, 75, 118, 13); afterRefactoringLabel_1.setText(Messages.RefactoringWizardPage6_AfterRefactoring); textBefore2 = new Text(example1Group_1, SWT.BORDER); textBefore2.setBounds(134, 26, 418, 25); textBefore2.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); final Button bt_examineBefore2 = new Button(example1Group_1, SWT.NONE); bt_examineBefore2.setBounds(558, 29, 30, 18); bt_examineBefore2.setText("..."); //$NON-NLS-1$ bt_examineBefore2.addSelectionListener(new ExampleChooserAction(textBefore2)); textAfter2 = new Text(example1Group_1, SWT.BORDER); textAfter2.setBounds(134, 72, 418, 25); textAfter2.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { dialogChanged(); } }); final Button bt_examineAfter2 = new Button(example1Group_1, SWT.NONE); bt_examineAfter2.setBounds(558, 75, 30, 18); bt_examineAfter2.setText("..."); //$NON-NLS-1$ bt_examineAfter2.addSelectionListener(new ExampleChooserAction(textAfter2)); model = new RefactoringExampleModel(); DataBindingContext dbc = new DataBindingContext(); dbc.bindValue(SWTObservables.observeText(textBefore1, SWT.Modify), BeansObservables.observeValue(model, "beforeExample1"), null, null); dbc.bindValue(SWTObservables.observeText(textBefore2, SWT.Modify), BeansObservables.observeValue(model, "beforeExample2"), null, null); dbc.bindValue(SWTObservables.observeText(textAfter1, SWT.Modify), BeansObservables.observeValue(model, "afterExample1"), null, null); dbc.bindValue(SWTObservables.observeText(textAfter2, SWT.Modify), BeansObservables.observeValue(model, "afterExample2"), null, null); if (refactoring != null) { fillInRefactoringData(); if (refactoring.getExamplesAbsolutePath().size() > 0) { model.setBeforeExample1(refactoring.getExamplesAbsolutePath().get(0).getBefore()); model.setAfterExample1(refactoring.getExamplesAbsolutePath().get(0).getAfter()); } if (refactoring.getExamplesAbsolutePath().size() > 1) { model.setBeforeExample2(refactoring.getExamplesAbsolutePath().get(1).getBefore()); model.setAfterExample2(refactoring.getExamplesAbsolutePath().get(1).getAfter()); } } }