List of usage examples for org.eclipse.jface.databinding.viewers ObservableListContentProvider ObservableListContentProvider
public ObservableListContentProvider()
From source file:org.eclipse.jface.snippets.viewers.Snippet065TableViewerReplacingElements.java
License:Open Source License
public Snippet065TableViewerReplacingElements(Shell shell) { Random random = new Random(); final Composite c = new Composite(shell, SWT.NONE); c.setLayout(new FillLayout(SWT.VERTICAL)); Label l = new Label(c, SWT.NONE); l.setText(/*from w ww. j a v a 2 s .c o m*/ "The elements are ordered lexicografically, i.e. 11 comes before 2,\nPress q, to rename one element."); final TableViewer v = new TableViewer(c); String[] rootElements = new String[] { "root 1", "root 2", "root 3" }; final IObservableList<String> input = new WritableList<>(DisplayRealm.getRealm(shell.getDisplay())); input.addAll(Arrays.asList(rootElements)); IContentProvider contentProvider = new ObservableListContentProvider(); v.setContentProvider(contentProvider); v.setComparator(new ViewerComparator()); v.setInput(input); v.getControl().addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { // don't use 'r' and 'c', because they would iterate through the // root... / child... elements if (e.character == 'q') { input.set(0, "root " + random.nextInt()); } } }); }
From source file:org.eclipse.jubula.client.ui.rcp.widgets.AutIdListComposite.java
License:Open Source License
/** * Creates the necessary components and sets their initial values. * /* ww w . j ava 2s .co m*/ * @param autIdValidator The validator for the AUT ID text field. */ @SuppressWarnings("unchecked") private void init(final IValidator autIdValidator) { GridLayout compositeLayout = new GridLayout(); compositeLayout.numColumns = 2; compositeLayout.marginHeight = 0; compositeLayout.marginWidth = 0; setLayout(compositeLayout); Label idLabel = new Label(this, SWT.NONE); idLabel.setText(Messages.AUTPropertiesDialogAutId); ControlDecorator.createInfo(idLabel, I18n.getString("AUTPropertiesDialog.AutId.helpText"), false); //$NON-NLS-1$ GridData data = new GridData(SWT.BEGINNING, SWT.FILL, false, false); data.horizontalSpan = 1; idLabel.setLayoutData(data); // Created to keep layout consistent new Label(this, SWT.NONE).setVisible(false); final WritableList idListModel = new WritableList(m_aut.getAutIds(), String.class); final ListViewer idListViewer = new ListViewer(this, LayoutUtil.MULTI_TEXT_STYLE); idListViewer.setContentProvider(new ObservableListContentProvider()); idListViewer.setComparator(new ViewerComparator()); idListViewer.setInput(idListModel); final List idList = idListViewer.getList(); data = new GridData(SWT.FILL, SWT.FILL, true, false); data.verticalSpan = 3; data.widthHint = Dialog.convertHeightInCharsToPixels(LayoutUtil.getFontMetrics(idList), 4); idList.setLayoutData(data); createButtons(this, autIdValidator, idList, idListModel); }
From source file:org.eclipse.linuxtools.internal.docker.ui.launch.RunImageEnvironmentTab.java
License:Open Source License
private TableViewer createEnvironmentVariablesTable(Composite container) { final Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL); final TableViewer tableViewer = new TableViewer(table); table.setHeaderVisible(true);/*from ww w .j a v a 2 s .c o m*/ table.setLinesVisible(true); addTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunResourceVolVarPage.nameColumn"), //$NON-NLS-1$ 200); addTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunResourceVolVarPage.valueColumn"), //$NON-NLS-1$ 200); tableViewer.setContentProvider(new ObservableListContentProvider()); return tableViewer; }
From source file:org.eclipse.linuxtools.internal.docker.ui.launch.RunImageLabelsTab.java
License:Open Source License
private TableViewer createLabelVariablesTable(Composite container) { final Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL); final TableViewer tableViewer = new TableViewer(table); table.setHeaderVisible(true);/*from w w w .j av a 2 s .c om*/ table.setLinesVisible(true); addTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunResourceVolVarPage.nameColumn"), //$NON-NLS-1$ 200); addTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunResourceVolVarPage.valueColumn"), //$NON-NLS-1$ 200); tableViewer.setContentProvider(new ObservableListContentProvider()); return tableViewer; }
From source file:org.eclipse.linuxtools.internal.docker.ui.launch.RunImageLinksTab.java
License:Open Source License
private TableViewer createLinksTable(final Composite container) { final Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL); final TableViewer tableViewer = new TableViewer(table); table.setHeaderVisible(true);/* w w w . j a va 2s .co m*/ table.setLinesVisible(true); createTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunSelectionPage.containerNameColumn"), //$NON-NLS-1$ 200); createTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunSelectionPage.aliasColumn"), //$NON-NLS-1$ 150); tableViewer.setContentProvider(new ObservableListContentProvider()); return tableViewer; }
From source file:org.eclipse.linuxtools.internal.docker.ui.launch.RunImageMainTab.java
License:Open Source License
/** * Creates the {@link Composite} container that will display widgets to * select an {@link IDockerImage}, name it and specify the command to run. * * @param container/* www . j a va 2s . com*/ * the parent {@link Composite} */ private void createImageSettingsSection(final Composite container) { GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(3, 1) .applyTo(new Label(container, SWT.NONE)); final Label connectionSelectionLabel = new Label(container, SWT.NONE); connectionSelectionLabel.setText(WizardMessages.getString("Connection.label")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false) .applyTo(connectionSelectionLabel); final Combo connectionSelectionCombo = new Combo(container, SWT.BORDER); connectionSelectionCombo.setToolTipText(LaunchMessages.getString("RunMainTabSelectConnection.tooltip")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(connectionSelectionCombo); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(new Label(container, SWT.NONE)); new ControlDecoration(connectionSelectionCombo, SWT.TOP | SWT.LEFT); final ComboViewer connectionSelectionComboViewer = new ComboViewer(connectionSelectionCombo); connectionSelectionComboViewer.setContentProvider(new ArrayContentProvider()); connectionSelectionComboViewer.setInput(getConnectionNames()); dbc.bindValue(WidgetProperties.selection().observe(connectionSelectionCombo), BeanProperties.value(ImageRunSelectionModel.class, ImageRunSelectionModel.SELECTED_CONNECTION_NAME) .observe(model)); // Image selection name final Label imageSelectionLabel = new Label(container, SWT.NONE); imageSelectionLabel.setText(WizardMessages.getString("Image.label")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); final Combo imageSelectionCombo = new Combo(container, SWT.BORDER); final ComboViewer imageSelectionComboViewer = new ComboViewer(imageSelectionCombo); imageSelectionCombo.setToolTipText(WizardMessages.getString("ImageRunSelectionPage.selectTooltip")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(imageSelectionCombo); new ControlDecoration(imageSelectionCombo, SWT.TOP | SWT.LEFT); new ContentProposalAdapter(imageSelectionCombo, new ComboContentAdapter() { @Override public void insertControlContents(Control control, String text, int cursorPosition) { final Combo combo = (Combo) control; final Point selection = combo.getSelection(); combo.setText(text); selection.x = text.length(); selection.y = selection.x; combo.setSelection(selection); } }, getImageNameContentProposalProvider(imageSelectionCombo), null, null); // image search final Button searchImageButton = new Button(container, SWT.NONE); searchImageButton.setText(WizardMessages.getString("ImageRunSelectionPage.search")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .hint(LaunchConfigurationUtils.getButtonWidthHint(searchImageButton), SWT.DEFAULT) .applyTo(searchImageButton); searchImageButton.addSelectionListener(onSearchImage()); imageSelectionComboViewer.setContentProvider(new ObservableListContentProvider()); dbc.bindList(WidgetProperties.items().observe(imageSelectionCombo), BeanProperties .list(ImageRunSelectionModel.class, ImageRunSelectionModel.IMAGE_NAMES).observe(model)); dbc.bindValue(WidgetProperties.selection().observe(imageSelectionCombo), BeanProperties .value(ImageRunSelectionModel.class, ImageRunSelectionModel.SELECTED_IMAGE_NAME).observe(model)); // Container name (optional) final Label containerNameLabel = new Label(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); containerNameLabel.setText("Name:"); //$NON-NLS-1$ final Text containerNameText = new Text(container, SWT.BORDER); containerNameText.setToolTipText(WizardMessages.getString("ImageRunSelectionPage.containerTooltip")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(containerNameText); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(new Label(container, SWT.NONE)); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(containerNameText), BeanProperties .value(ImageRunSelectionModel.class, ImageRunSelectionModel.CONTAINER_NAME).observe(model)); // EntryPoint (optional) final Label entrypointLabel = new Label(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); entrypointLabel.setText(WizardMessages.getString("ImageRunSelectionPage.entrypoint")); //$NON-NLS-1$ // TODO: include SWT.SEARCH | SWT.ICON_SEARCH to support value reset final Text entrypointText = new Text(container, SWT.BORDER); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(entrypointText); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(new Label(container, SWT.NONE)); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(entrypointText), BeanProperties .value(ImageRunSelectionModel.class, ImageRunSelectionModel.ENTRYPOINT).observe(model)); // Command (optional) final Label commandLabel = new Label(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); commandLabel.setText(WizardMessages.getString("ImageRunSelectionPage.command")); //$NON-NLS-1$ final Text commandText = new Text(container, SWT.BORDER); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(commandText); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(new Label(container, SWT.NONE)); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(commandText), BeanProperties.value(ImageRunSelectionModel.class, ImageRunSelectionModel.COMMAND).observe(model)); }
From source file:org.eclipse.linuxtools.internal.docker.ui.launch.RunImagePortsTab.java
License:Open Source License
private CheckboxTableViewer createPortSettingsTable(final Composite container) { final Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK); final CheckboxTableViewer tableViewer = new CheckboxTableViewer(table); table.setHeaderVisible(true);// ww w .j a va 2 s.c o m table.setLinesVisible(true); createTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunSelectionPage.containerPortColumn"), //$NON-NLS-1$ 100); createTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunSelectionPage.typeColumn"), //$NON-NLS-1$ 50); createTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunSelectionPage.hostAddressColumn"), //$NON-NLS-1$ 100); createTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunSelectionPage.hostPortColumn"), //$NON-NLS-1$ 100); tableViewer.setContentProvider(new ObservableListContentProvider()); return tableViewer; }
From source file:org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionPage.java
License:Open Source License
/** * Creates the {@link Composite} container that will display widgets to * select an {@link IDockerImage}, name it and specify the command to run. * // w w w . j ava 2s. com * @param container * the parent {@link Composite} */ private void createImageSettingsSection(final Composite container) { // Image selection name final Label imageSelectionLabel = new Label(container, SWT.NONE); imageSelectionLabel.setText(WizardMessages.getString("ImageRunSelectionPage.imageName")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); final Combo imageSelectionCombo = new Combo(container, SWT.BORDER); final ComboViewer imageSelectionComboViewer = new ComboViewer(imageSelectionCombo); imageSelectionCombo.setToolTipText(WizardMessages.getString("ImageRunSelectionPage.selectTooltip")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(imageSelectionCombo); new ControlDecoration(imageSelectionCombo, SWT.TOP | SWT.LEFT); new ContentProposalAdapter(imageSelectionCombo, new ComboContentAdapter() { @Override public void insertControlContents(Control control, String text, int cursorPosition) { final Combo combo = (Combo) control; final Point selection = combo.getSelection(); combo.setText(text); selection.x = text.length(); selection.y = selection.x; combo.setSelection(selection); } }, getImageNameContentProposalProvider(imageSelectionCombo), null, null); // image search final Button searchImageButton = new Button(container, SWT.NONE); searchImageButton.setText(WizardMessages.getString("ImageRunSelectionPage.search")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(searchImageButton); searchImageButton.addSelectionListener(onSearchImage()); // link to pull image final Label fillerLabel = new Label(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(fillerLabel); final Link pullImageLink = new Link(container, SWT.NONE); pullImageLink.setText(WizardMessages.getString("ImageRunSelectionPage.pullImage")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(COLUMNS - 1, 1) .applyTo(pullImageLink); pullImageLink.addSelectionListener(onPullImage()); dbc.bindValue(WidgetProperties.enabled().observe(pullImageLink), BeanProperties .value(ImageRunSelectionModel.class, ImageRunSelectionModel.SELECTED_IMAGE_NEEDS_PULLING) .observe(model)); // bind combo with model (for values and selection) imageSelectionComboViewer.setContentProvider(new ObservableListContentProvider()); dbc.bindList(WidgetProperties.items().observe(imageSelectionCombo), BeanProperties .list(ImageRunSelectionModel.class, ImageRunSelectionModel.IMAGE_NAMES).observe(model)); dbc.bindValue(WidgetProperties.selection().observe(imageSelectionCombo), BeanProperties .value(ImageRunSelectionModel.class, ImageRunSelectionModel.SELECTED_IMAGE_NAME).observe(model)); // Container name (optional) final Label containerNameLabel = new Label(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); containerNameLabel.setText(WizardMessages.getString("ImageRunSelectionPage.containerName")); //$NON-NLS-1$ final Text containerNameText = new Text(container, SWT.BORDER); containerNameText.setToolTipText(WizardMessages.getString("ImageRunSelectionPage.containerTooltip")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(containerNameText); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(new Label(container, SWT.NONE)); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(containerNameText), BeanProperties .value(ImageRunSelectionModel.class, ImageRunSelectionModel.CONTAINER_NAME).observe(model)); // EntryPoint (optional) final Label entrypointLabel = new Label(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); entrypointLabel.setText(WizardMessages.getString("ImageRunSelectionPage.entrypoint")); //$NON-NLS-1$ // TODO: include SWT.SEARCH | SWT.ICON_SEARCH to support value reset final Text entrypointText = new Text(container, SWT.BORDER); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(entrypointText); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(new Label(container, SWT.NONE)); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(entrypointText), BeanProperties .value(ImageRunSelectionModel.class, ImageRunSelectionModel.ENTRYPOINT).observe(model)); // Command (optional) final Label commandLabel = new Label(container, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(imageSelectionLabel); commandLabel.setText(WizardMessages.getString("ImageRunSelectionPage.command")); //$NON-NLS-1$ final Text commandText = new Text(container, SWT.BORDER); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1) .applyTo(commandText); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).span(1, 1) .applyTo(new Label(container, SWT.NONE)); dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(commandText), BeanProperties.value(ImageRunSelectionModel.class, ImageRunSelectionModel.COMMAND).observe(model)); }
From source file:org.eclipse.linuxtools.internal.docker.ui.wizards.ImageRunSelectionPage.java
License:Open Source License
private CheckboxTableViewer createPortSettingsTable(final Composite container) { final Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK); final CheckboxTableViewer tableViewer = new CheckboxTableViewer(table); table.setHeaderVisible(true);//w ww . j av a 2s . c om table.setLinesVisible(true); createTableViewerColum(tableViewer, WizardMessages.getString("ImageRunSelectionPage.containerPortColumn"), //$NON-NLS-1$ 100); createTableViewerColum(tableViewer, WizardMessages.getString("ImageRunSelectionPage.typeColumn"), //$NON-NLS-1$ 50); createTableViewerColum(tableViewer, WizardMessages.getString("ImageRunSelectionPage.hostAddressColumn"), //$NON-NLS-1$ 100); createTableViewerColum(tableViewer, WizardMessages.getString("ImageRunSelectionPage.hostPortColumn"), //$NON-NLS-1$ 100); tableViewer.setContentProvider(new ObservableListContentProvider()); return tableViewer; }
From source file:org.eclipse.linuxtools.internal.docker.ui.wizards.ImageSearchPage.java
License:Open Source License
@Override public void createControl(final Composite parent) { final int COLUMNS = 3; final Composite container = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(1, 1).grab(true, false).applyTo(container); GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(6, 6).spacing(10, 2).applyTo(container); // search text final Label searchImageLabel = new Label(container, SWT.NONE); searchImageLabel.setText(WizardMessages.getString("ImageSearchPage.imageLabel")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(searchImageLabel); final Text searchImageText = new Text(container, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(searchImageText); searchImageText.addKeyListener(onKeyPressed()); searchImageText.addTraverseListener(onSearchImageTextTraverse()); final Button searchImageButton = new Button(container, SWT.NONE); searchImageButton.setText(WizardMessages.getString("ImageSearchPage.search")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(searchImageButton); searchImageButton.addSelectionListener(onSearchImageButtonSelected()); // result table final Label searchResultLabel = new Label(container, SWT.NONE); searchResultLabel.setText(WizardMessages.getString("ImageSearchPage.searchResultLabel")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(COLUMNS, 1) .applyTo(searchResultLabel); final Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL); final TableViewer searchResultTableViewer = new TableViewer(table); table.setHeaderVisible(true);//from w w w .ja v a 2s . co m table.setLinesVisible(true); addTableViewerColum(searchResultTableViewer, WizardMessages.getString("ImageSearchPage.nameColumn"), //$NON-NLS-1$ SWT.NONE, SWT.RIGHT, 290, new ImageNameColumnLabelProvider()); addTableViewerColum(searchResultTableViewer, WizardMessages.getString("ImageSearchPage.starsColumn"), //$NON-NLS-1$ SWT.NONE, SWT.RIGHT, 70, new ImageStarsColumnLabelProvider()); addTableViewerColum(searchResultTableViewer, WizardMessages.getString("ImageSearchPage.officialColumn"), //$NON-NLS-1$ SWT.NONE, SWT.CENTER, 70, new ImageOfficialColumnLabelProvider()); addTableViewerColum(searchResultTableViewer, WizardMessages.getString("ImageSearchPage.automatedColumn"), //$NON-NLS-1$ SWT.NONE, SWT.CENTER, 70, new ImageAutomatedColumnLabelProvider()); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(COLUMNS, 1).hint(200, 100) .applyTo(table); // description text area final Group selectedImageDescriptionGroup = new Group(container, SWT.BORDER); selectedImageDescriptionGroup.setText(WizardMessages.getString("ImageSearchPage.descriptionGroup")); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).span(COLUMNS, 1) .applyTo(selectedImageDescriptionGroup); GridLayoutFactory.fillDefaults().margins(6, 6).spacing(10, 2).applyTo(selectedImageDescriptionGroup); final Label selectedImageDescription = new Label(selectedImageDescriptionGroup, SWT.WRAP); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true).hint(200, 100) .applyTo(selectedImageDescription); // bind the search term final IObservableValue observableTermModel = BeanProperties .value(ImageSearchModel.class, ImageSearchModel.TERM).observe(model); final ISWTObservableValue imageSearchTextObservable = WidgetProperties.text(SWT.Modify) .observe(searchImageText); ctx.bindValue(imageSearchTextObservable, observableTermModel, new UpdateValueStrategy().setBeforeSetValidator(new SearchTermValidator(searchImageButton)), null); // observe the viewer content searchResultTableViewer.setContentProvider(new ObservableListContentProvider()); // observe the viewer content final IObservableList observableSearchResultModel = BeanProperties .list(ImageSearchModel.class, ImageSearchModel.IMAGE_SEARCH_RESULT).observe(model); searchResultTableViewer.setInput(observableSearchResultModel); // observe the viewer selection ctx.bindValue(ViewerProperties.singleSelection().observe(searchResultTableViewer), BeanProperties.value(ImageSearchModel.SELECTED_IMAGE).observe(model)); // observe the viewer selection to update the description label final IObservableValue observableSelectedImageDescription = PojoProperties .value("description", String.class) // $NON-NLS-1$ .observeDetail(ViewerProperties.singleSelection().observe(searchResultTableViewer)); ctx.bindValue(WidgetProperties.text().observe(selectedImageDescription), observableSelectedImageDescription); searchImageText.setFocus(); // attach the Databinding context status to this wizard page. WizardPageSupport.create(this, this.ctx); setControl(container); // trigger a search if an image name was provided if (model.getTerm() != null && !model.getTerm().isEmpty()) { searchImages(); } }