Search in sources :

Example 1 with ObservableListContentProvider

use of org.eclipse.jface.databinding.viewers.ObservableListContentProvider in project linuxtools by eclipse.

the class RunImageEnvironmentTab method createEnvironmentVariablesTable.

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);
    table.setLinesVisible(true);
    addTableViewerColumn(tableViewer, WizardMessages.getString(// $NON-NLS-1$
    "ImageRunResourceVolVarPage.nameColumn"), 200);
    addTableViewerColumn(tableViewer, WizardMessages.getString(// $NON-NLS-1$
    "ImageRunResourceVolVarPage.valueColumn"), 200);
    tableViewer.setContentProvider(new ObservableListContentProvider());
    return tableViewer;
}
Also used : ObservableListContentProvider(org.eclipse.jface.databinding.viewers.ObservableListContentProvider) Table(org.eclipse.swt.widgets.Table) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 2 with ObservableListContentProvider

use of org.eclipse.jface.databinding.viewers.ObservableListContentProvider in project linuxtools by eclipse.

the class RunImageLinksTab method createLinksTable.

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);
    table.setLinesVisible(true);
    createTableViewerColumn(tableViewer, WizardMessages.getString(// $NON-NLS-1$
    "ImageRunSelectionPage.containerNameColumn"), 200);
    createTableViewerColumn(tableViewer, // $NON-NLS-1$
    WizardMessages.getString("ImageRunSelectionPage.aliasColumn"), 150);
    tableViewer.setContentProvider(new ObservableListContentProvider());
    return tableViewer;
}
Also used : ObservableListContentProvider(org.eclipse.jface.databinding.viewers.ObservableListContentProvider) Table(org.eclipse.swt.widgets.Table) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 3 with ObservableListContentProvider

use of org.eclipse.jface.databinding.viewers.ObservableListContentProvider in project linuxtools by eclipse.

the class RunImagePortsTab method createPortSettingsTable.

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);
    table.setLinesVisible(true);
    createTableViewerColumn(tableViewer, WizardMessages.getString(// $NON-NLS-1$
    "ImageRunSelectionPage.containerPortColumn"), 100);
    createTableViewerColumn(tableViewer, // $NON-NLS-1$
    WizardMessages.getString("ImageRunSelectionPage.typeColumn"), 50);
    createTableViewerColumn(tableViewer, WizardMessages.getString(// $NON-NLS-1$
    "ImageRunSelectionPage.hostAddressColumn"), 100);
    createTableViewerColumn(tableViewer, WizardMessages.getString(// $NON-NLS-1$
    "ImageRunSelectionPage.hostPortColumn"), 100);
    tableViewer.setContentProvider(new ObservableListContentProvider());
    return tableViewer;
}
Also used : ObservableListContentProvider(org.eclipse.jface.databinding.viewers.ObservableListContentProvider) Table(org.eclipse.swt.widgets.Table) CheckboxTableViewer(org.eclipse.jface.viewers.CheckboxTableViewer)

Example 4 with ObservableListContentProvider

use of org.eclipse.jface.databinding.viewers.ObservableListContentProvider in project linuxtools by eclipse.

the class RunImageVolumesTab method bind.

/**
 * Same as
 * {@link org.eclipse.jface.databinding.viewers.ViewerSupport#bind(StructuredViewer, IObservableList, org.eclipse.core.databinding.property.value.IValueProperty[])
 * but with a custom LabelProvider, DataVolumesLabelProvider
 *
 * @param viewer
 * @param input
 * @param labelProperties
 */
private void bind(final StructuredViewer viewer, final IObservableList input, final IBeanValueProperty[] labelProperties) {
    final ObservableListContentProvider contentProvider = new ObservableListContentProvider();
    if (viewer.getInput() != null) {
        viewer.setInput(null);
    }
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(new DataVolumesLabelProvider(Properties.observeEach(contentProvider.getKnownElements(), labelProperties)));
    if (input != null) {
        viewer.setInput(input);
    }
}
Also used : ObservableListContentProvider(org.eclipse.jface.databinding.viewers.ObservableListContentProvider)

Example 5 with ObservableListContentProvider

use of org.eclipse.jface.databinding.viewers.ObservableListContentProvider in project linuxtools by eclipse.

the class ImageRunResourceVolumesVariablesPage method bind.

/**
 * Same as
 * {@link ViewerSupport#bind(StructuredViewer, IObservableList, org.eclipse.core.databinding.property.value.IValueProperty[])
 * but with a custom LabelProvider, DataVolumesLabelProvider
 *
 * @param viewer
 * @param input
 * @param labelProperties
 */
private void bind(final StructuredViewer viewer, final IObservableList input, final IBeanValueProperty[] labelProperties) {
    final ObservableListContentProvider contentProvider = new ObservableListContentProvider();
    if (viewer.getInput() != null) {
        viewer.setInput(null);
    }
    viewer.setContentProvider(contentProvider);
    viewer.setLabelProvider(new DataVolumesLabelProvider(Properties.observeEach(contentProvider.getKnownElements(), labelProperties)));
    if (input != null) {
        viewer.setInput(input);
    }
}
Also used : ObservableListContentProvider(org.eclipse.jface.databinding.viewers.ObservableListContentProvider)

Aggregations

ObservableListContentProvider (org.eclipse.jface.databinding.viewers.ObservableListContentProvider)14 Table (org.eclipse.swt.widgets.Table)8 TableViewer (org.eclipse.jface.viewers.TableViewer)6 IObservableList (org.eclipse.core.databinding.observable.list.IObservableList)3 IObservableValue (org.eclipse.core.databinding.observable.value.IObservableValue)3 Button (org.eclipse.swt.widgets.Button)3 Label (org.eclipse.swt.widgets.Label)3 Text (org.eclipse.swt.widgets.Text)3 DataBindingContext (org.eclipse.core.databinding.DataBindingContext)2 ComboContentAdapter (org.eclipse.jface.fieldassist.ComboContentAdapter)2 ContentProposalAdapter (org.eclipse.jface.fieldassist.ContentProposalAdapter)2 ControlDecoration (org.eclipse.jface.fieldassist.ControlDecoration)2 CheckboxTableViewer (org.eclipse.jface.viewers.CheckboxTableViewer)2 ComboViewer (org.eclipse.jface.viewers.ComboViewer)2 Point (org.eclipse.swt.graphics.Point)2 Combo (org.eclipse.swt.widgets.Combo)2 Composite (org.eclipse.swt.widgets.Composite)2 Control (org.eclipse.swt.widgets.Control)2 UpdateValueStrategy (org.eclipse.core.databinding.UpdateValueStrategy)1 IObservableMap (org.eclipse.core.databinding.observable.map.IObservableMap)1