Search in sources :

Example 1 with IViewerObservableValue

use of org.eclipse.jface.databinding.viewers.IViewerObservableValue in project statecharts by Yakindu.

the class StatechartPropertySection method bindDomainCombo.

protected void bindDomainCombo(EMFDataBindingContext context) {
    IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.DOMAIN_ELEMENT__DOMAIN_ID);
    IViewerObservableValue observeSingleSelection = ViewersObservables.observeSingleSelection(domainCombo);
    UpdateValueStrategy modelToTarget = new UpdateValueStrategy() {

        @Override
        public Object convert(Object value) {
            return ((IDomain) value).getDomainID();
        }
    };
    UpdateValueStrategy targetToModel = new UpdateValueStrategy() {

        @Override
        public Object convert(Object value) {
            return DomainRegistry.getDomain((String) value);
        }
    };
    context.bindValue(observeSingleSelection, property.observe(eObject), modelToTarget, targetToModel);
}
Also used : UpdateValueStrategy(org.eclipse.core.databinding.UpdateValueStrategy) IDomain(org.yakindu.sct.domain.extension.IDomain) EObject(org.eclipse.emf.ecore.EObject) IEMFValueProperty(org.eclipse.emf.databinding.IEMFValueProperty) IViewerObservableValue(org.eclipse.jface.databinding.viewers.IViewerObservableValue)

Example 2 with IViewerObservableValue

use of org.eclipse.jface.databinding.viewers.IViewerObservableValue in project jbosstools-openshift by jbosstools.

the class ConnectionWizardPage method doCreateControls.

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void doCreateControls(final Composite parent, DataBindingContext dbc) {
    GridLayoutFactory.fillDefaults().numColumns(3).margins(10, 10).applyTo(parent);
    // userdoc link (JBIDE-20401)
    // text set in #showHideUserdocLink
    this.userdocLink = new StyledText(parent, SWT.WRAP);
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(3, 1).applyTo(userdocLink);
    showHideUserdocLink();
    IObservableValue userdocUrlObservable = BeanProperties.value(ConnectionWizardPageModel.PROPERTY_USERDOCURL).observe(pageModel);
    StyledTextUtils.emulateLinkAction(userdocLink, r -> onUserdocLinkClicked(userdocUrlObservable));
    userdocUrlObservable.addValueChangeListener(new IValueChangeListener() {

        @Override
        public void handleValueChange(ValueChangeEvent event) {
            showHideUserdocLink();
        }
    });
    IObservableValue connectionFactoryObservable = BeanProperties.value(ConnectionWizardPageModel.PROPERTY_CONNECTION_FACTORY).observe(pageModel);
    // filler
    Label fillerLabel = new Label(parent, SWT.NONE);
    GridDataFactory.fillDefaults().span(3, 3).hint(SWT.DEFAULT, 6).applyTo(fillerLabel);
    // existing connections combo
    Label connectionLabel = new Label(parent, SWT.NONE);
    connectionLabel.setText("Connection:");
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).applyTo(connectionLabel);
    Combo connectionCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
    // disable the connection combo if we're editing a connection or creating a new one from scratch
    connectionCombo.setEnabled(pageModel.isAllowConnectionChange());
    GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(connectionCombo);
    ComboViewer connectionComboViewer = new ComboViewer(connectionCombo);
    connectionComboViewer.setContentProvider(ArrayContentProvider.getInstance());
    connectionComboViewer.setLabelProvider(new ConnectionColumLabelProvider());
    connectionComboViewer.setInput(pageModel.getAllConnections());
    Binding selectedConnectionBinding = ValueBindingBuilder.bind(ViewerProperties.singleSelection().observe(connectionComboViewer)).validatingAfterGet(new IsNotNullValidator(ValidationStatus.cancel("You have to select or create a new connection."))).to(BeanProperties.value(ConnectionWizardPageModel.PROPERTY_SELECTED_CONNECTION, IConnection.class).observe(pageModel)).in(dbc);
    ControlDecorationSupport.create(selectedConnectionBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
    // server type
    Label connectionFactoryLabel = new Label(parent, SWT.NONE);
    connectionFactoryLabel.setText("Server type:");
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).applyTo(connectionFactoryLabel);
    Combo connectionFactoryCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
    GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(connectionFactoryCombo);
    ComboViewer connectionFactoriesViewer = new ComboViewer(connectionFactoryCombo);
    connectionFactoriesViewer.setContentProvider(ArrayContentProvider.getInstance());
    connectionFactoriesViewer.setLabelProvider(new ColumnLabelProvider() {

        @Override
        public String getText(Object element) {
            if (!(element instanceof IConnectionFactory)) {
                return element.toString();
            } else {
                return ((IConnectionFactory) element).getName();
            }
        }
    });
    connectionFactoriesViewer.setInput(pageModel.getAllConnectionFactories());
    // Disable the server type when editing a connection
    if (!pageModel.isAllowConnectionChange() && pageModel.getSelectedConnection() != null) {
        IConnection c = pageModel.getSelectedConnection();
        if (!(c instanceof NewConnectionMarker)) {
            connectionFactoryCombo.setEnabled(false);
        }
    }
    final IViewerObservableValue selectedServerType = ViewerProperties.singleSelection().observe(connectionFactoriesViewer);
    ValueBindingBuilder.bind(selectedServerType).to(connectionFactoryObservable).in(dbc);
    // server
    Button useDefaultServerCheckbox = new Button(parent, SWT.CHECK);
    useDefaultServerCheckbox.setText("Use default server");
    GridDataFactory.fillDefaults().span(3, 1).align(SWT.FILL, SWT.FILL).applyTo(useDefaultServerCheckbox);
    ValueBindingBuilder.bind(WidgetProperties.selection().observe(useDefaultServerCheckbox)).to(BeanProperties.value(ConnectionWizardPageModel.PROPERTY_USE_DEFAULT_HOST, IConnection.class).observe(pageModel)).in(dbc);
    IObservableValue hasDefaultHostObservable = BeanProperties.value(ConnectionWizardPageModel.PROPERTY_HAS_DEFAULT_HOST).observe(pageModel);
    ValueBindingBuilder.bind(WidgetProperties.enabled().observe(useDefaultServerCheckbox)).notUpdating(hasDefaultHostObservable).in(dbc);
    Label serverLabel = new Label(parent, SWT.NONE);
    serverLabel.setText("Server:");
    GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).applyTo(serverLabel);
    Combo serversCombo = new Combo(parent, SWT.BORDER);
    ComboViewer serversViewer = new ComboViewer(serversCombo);
    serversViewer.setContentProvider(new ObservableListContentProvider());
    serversViewer.setInput(BeanProperties.list(ConnectionWizardPageModel.PROPERTY_ALL_HOSTS).observe(pageModel));
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(serversCombo);
    final IObservableValue serverUrlObservable = WidgetProperties.text().observe(serversCombo);
    serversCombo.addFocusListener(onServerFocusLost(serverUrlObservable));
    ValueBindingBuilder.bind(serverUrlObservable).converting(new TrimTrailingSlashConverter()).to(BeanProperties.value(ConnectionWizardPageModel.PROPERTY_HOST).observe(pageModel)).in(dbc);
    MultiValidator serverUrlValidator = new MultiValidator() {

        @Override
        protected IStatus validate() {
            Object value = serverUrlObservable.getValue();
            if (!(value instanceof String) || StringUtils.isEmpty((String) value)) {
                return ValidationStatus.cancel("Please provide an OpenShift server url.");
            } else if (!UrlUtils.isValid((String) value)) {
                return ValidationStatus.error("Please provide a valid OpenShift server url.");
            }
            return ValidationStatus.ok();
        }
    };
    ControlDecorationSupport.create(serverUrlValidator, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
    dbc.addValidationStatusProvider(serverUrlValidator);
    ValueBindingBuilder.bind(WidgetProperties.enabled().observe(serversCombo)).notUpdatingParticipant().to(BeanProperties.value(ConnectionWizardPageModel.PROPERTY_USE_DEFAULT_HOST).observe(pageModel)).converting(new InvertingBooleanConverter()).in(dbc);
    // connect error
    dbc.addValidationStatusProvider(new MultiValidator() {

        IObservableValue observable = BeanProperties.value(ConnectionWizardPageModel.PROPERTY_CONNECTED_STATUS, IStatus.class).observe(pageModel);

        @Override
        protected IStatus validate() {
            return (IStatus) observable.getValue();
        }
    });
    // connection editors
    Group authenticationDetailsGroup = new Group(parent, SWT.NONE);
    authenticationDetailsGroup.setText("Authentication");
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(3, 1).applyTo(authenticationDetailsGroup);
    GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(authenticationDetailsGroup);
    // additional nesting required because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=478618
    Composite authenticationDetailsContainer = new Composite(authenticationDetailsGroup, SWT.None);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(authenticationDetailsContainer);
    this.connectionEditors = new ConnectionEditorsStackedView(connectionFactoryObservable, this, authenticationDetailsContainer, dbc);
    connectionEditors.createControls();
    // adv editors
    Composite advEditorContainer = new Composite(parent, SWT.NONE);
    GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(authenticationDetailsGroup);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(3, 1).grab(true, true).applyTo(advEditorContainer);
    this.advConnectionEditors = new AdvancedConnectionEditorsStackedView(connectionFactoryObservable, pageModel, advEditorContainer, dbc);
    advConnectionEditors.createControls();
}
Also used : IValueChangeListener(org.eclipse.core.databinding.observable.value.IValueChangeListener) Group(org.eclipse.swt.widgets.Group) ObservableListContentProvider(org.eclipse.jface.databinding.viewers.ObservableListContentProvider) IStatus(org.eclipse.core.runtime.IStatus) Label(org.eclipse.swt.widgets.Label) Combo(org.eclipse.swt.widgets.Combo) IConnection(org.jboss.tools.openshift.common.core.connection.IConnection) RequiredControlDecorationUpdater(org.jboss.tools.openshift.internal.common.ui.databinding.RequiredControlDecorationUpdater) ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) Button(org.eclipse.swt.widgets.Button) IConnectionFactory(org.jboss.tools.openshift.common.core.connection.IConnectionFactory) TrimTrailingSlashConverter(org.jboss.tools.openshift.internal.common.ui.databinding.TrimTrailingSlashConverter) IViewerObservableValue(org.eclipse.jface.databinding.viewers.IViewerObservableValue) Binding(org.eclipse.core.databinding.Binding) NewConnectionMarker(org.jboss.tools.openshift.common.core.connection.NewConnectionMarker) StyledText(org.eclipse.swt.custom.StyledText) Composite(org.eclipse.swt.widgets.Composite) InvertingBooleanConverter(org.jboss.tools.common.ui.databinding.InvertingBooleanConverter) MultiValidator(org.eclipse.core.databinding.validation.MultiValidator) ValueChangeEvent(org.eclipse.core.databinding.observable.value.ValueChangeEvent) ComboViewer(org.eclipse.jface.viewers.ComboViewer) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue) IsNotNullValidator(org.jboss.tools.openshift.internal.common.ui.databinding.IsNotNullValidator)

Example 3 with IViewerObservableValue

use of org.eclipse.jface.databinding.viewers.IViewerObservableValue in project translationstudio8 by heartsome.

the class ConverterUtil method bindValue.

/**
	 * 对下拉列表和转换器列表进行绑定
	 * @param context
	 * @param comboViewer
	 * @param model
	 *            ;
	 */
public static void bindValue(DataBindingContext context, ComboViewer comboViewer, ConverterViewModel model) {
    // ViewerSupport.bind(comboViewer, BeansObservables.observeList(
    // model, "supportTypes", String.class),
    // Properties.selfValue(String.class));
    //		
    //
    // context.bindValue(ViewersObservables
    // .observeSingleSelection(comboViewer), BeansObservables
    // .observeValue(model,
    // "selectedType"));
    // ObservableListContentProvider viewerContentProvider=new ObservableListContentProvider();
    comboViewer.setContentProvider(new ArrayContentProvider());
    comboViewer.setComparator(new ViewerComparator());
    // IObservableMap[] attributeMaps = BeansObservables.observeMaps(
    // viewerContentProvider.getKnownElements(),
    // ConverterBean.class, new String[] { "description" });
    // comboViewer.setLabelProvider(new ObservableMapLabelProvider(
    // attributeMaps));
    // comboViewer.setInput(Observables.staticObservableList(model.getSupportTypes(),ConverterBean.class));
    comboViewer.setInput(model.getSupportTypes());
    IViewerObservableValue selection = ViewersObservables.observeSingleSelection(comboViewer);
    IObservableValue observableValue = BeansObservables.observeDetailValue(selection, PROPERTIES_NAME, null);
    context.bindValue(observableValue, BeansObservables.observeValue(model, PROPERTIES_SELECTED_TYPE));
}
Also used : ViewerComparator(org.eclipse.jface.viewers.ViewerComparator) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue) IViewerObservableValue(org.eclipse.jface.databinding.viewers.IViewerObservableValue)

Example 4 with IViewerObservableValue

use of org.eclipse.jface.databinding.viewers.IViewerObservableValue in project jbosstools-openshift by jbosstools.

the class ServerSettingsWizardPage method createResourceTree.

@SuppressWarnings("unchecked")
private IViewerObservableValue createResourceTree(ServerSettingsWizardPageModel model, SashForm resourceControlsContainer, DataBindingContext dbc) {
    Composite resourceTreeContainer = new Composite(resourceControlsContainer, SWT.None);
    GridLayoutFactory.fillDefaults().applyTo(resourceTreeContainer);
    // filter
    Text selectorText = UIUtils.createSearchText(resourceTreeContainer);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(selectorText);
    // resource tree
    final TreeViewer resourcesViewer = createResourcesTreeViewer(resourceTreeContainer, model, selectorText);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(RESOURCE_TREE_WIDTH, RESOURCE_TREE_HEIGHT).applyTo(resourcesViewer.getControl());
    resourcesViewer.addDoubleClickListener(onDoubleClickService());
    IObservableList<ObservableTreeItem> resourceItemsObservable = BeanProperties.list(ServerSettingsWizardPageModel.PROPERTY_RESOURCE_ITEMS).observe(model);
    DataBindingUtils.addDisposableListChangeListener(onResourceItemsChanged(resourcesViewer), resourceItemsObservable, resourcesViewer.getTree());
    selectorText.addModifyListener(onFilterTextModified(resourcesViewer));
    IViewerObservableValue selectedResourceTreeItem = ViewerProperties.singleSelection().observe(resourcesViewer);
    ValueBindingBuilder.bind(selectedResourceTreeItem).converting(new ObservableTreeItem2ModelConverter(IResource.class)).validatingAfterConvert(value -> {
        if ((value instanceof IResource) && OpenShiftServerUtils.isAllowedForServerAdapter((IResource) value)) {
            return ValidationStatus.ok();
        }
        return ValidationStatus.cancel("Please select a resource that this adapter will be bound to.");
    }).to(BeanProperties.value(ServerSettingsWizardPageModel.PROPERTY_RESOURCE).observe(model)).converting(new Model2ObservableTreeItemConverter(new ServerSettingsWizardPageModel.ResourceTreeItemsFactory())).in(dbc);
    return selectedResourceTreeItem;
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) SelectProjectComponentBuilder(org.jboss.tools.openshift.internal.common.ui.SelectProjectComponentBuilder) CoreException(org.eclipse.core.runtime.CoreException) IDialogConstants(org.eclipse.jface.dialogs.IDialogConstants) IObservableList(org.eclipse.core.databinding.observable.list.IObservableList) BooleanUtils(org.apache.commons.lang.BooleanUtils) ValidationStatus(org.eclipse.core.databinding.validation.ValidationStatus) OpenShiftIdentifierValidator(org.jboss.tools.openshift.internal.ui.validator.OpenShiftIdentifierValidator) Composite(org.eclipse.swt.widgets.Composite) Map(java.util.Map) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) DialogAdvancedPart(org.jboss.tools.openshift.internal.common.ui.utils.DialogAdvancedPart) BrowserUtility(org.jboss.tools.foundation.ui.util.BrowserUtility) Status(org.eclipse.core.runtime.Status) ValidationStatusProvider(org.eclipse.core.databinding.ValidationStatusProvider) ProjectViewerComparator(org.jboss.tools.openshift.internal.ui.comparators.ProjectViewerComparator) GridLayoutFactory(org.eclipse.jface.layout.GridLayoutFactory) InvocationTargetException(java.lang.reflect.InvocationTargetException) ICompletable(org.jboss.ide.eclipse.as.ui.editor.DeploymentTypeUIUtil.ICompletable) OCBinary(org.jboss.tools.openshift.internal.core.preferences.OCBinary) Path(org.eclipse.core.runtime.Path) SWT(org.eclipse.swt.SWT) SelectExistingProjectDialog(org.jboss.tools.openshift.internal.common.ui.SelectExistingProjectDialog) SelectionListener(org.eclipse.swt.events.SelectionListener) WorkbenchContentProvider(org.eclipse.ui.model.WorkbenchContentProvider) ImportApplicationWizard(org.jboss.tools.openshift.internal.ui.wizard.importapp.ImportApplicationWizard) IListProperty(org.eclipse.core.databinding.property.list.IListProperty) Converter(org.eclipse.core.databinding.conversion.Converter) ResourcesPlugin(org.eclipse.core.resources.ResourcesPlugin) NumericValidator(org.jboss.tools.openshift.internal.common.ui.databinding.NumericValidator) IBuildConfig(com.openshift.restclient.model.IBuildConfig) IWizard(org.eclipse.jface.wizard.IWizard) ProjectUtils(org.jboss.tools.openshift.common.core.utils.ProjectUtils) IValidator(org.eclipse.core.databinding.validation.IValidator) JFaceResources(org.eclipse.jface.resource.JFaceResources) DataBindingContext(org.eclipse.core.databinding.DataBindingContext) IContainer(org.eclipse.core.resources.IContainer) WidgetProperties(org.eclipse.jface.databinding.swt.WidgetProperties) ExpansionEvent(org.eclipse.ui.forms.events.ExpansionEvent) OpenShiftCommonUIMessages(org.jboss.tools.openshift.internal.common.ui.OpenShiftCommonUIMessages) IProject(org.eclipse.core.resources.IProject) VariablesHelper(org.jboss.tools.openshift.common.core.utils.VariablesHelper) Link(org.eclipse.swt.widgets.Link) RsyncStatus(org.jboss.tools.openshift.internal.core.util.RSyncValidator.RsyncStatus) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Shell(org.eclipse.swt.widgets.Shell) IResource(com.openshift.restclient.model.IResource) MultiListProperty(org.eclipse.core.databinding.property.list.MultiListProperty) GridDataFactory(org.eclipse.jface.layout.GridDataFactory) IServer(org.eclipse.wst.server.core.IServer) OpenShiftServerUtils(org.jboss.tools.openshift.core.server.OpenShiftServerUtils) File(java.io.File) MultiValidator(org.eclipse.core.databinding.validation.MultiValidator) DOWNLOAD_INSTRUCTIONS_URL(org.jboss.tools.openshift.core.preferences.IOpenShiftCoreConstants.DOWNLOAD_INSTRUCTIONS_URL) Dialog(org.eclipse.jface.dialogs.Dialog) ModifyListener(org.eclipse.swt.events.ModifyListener) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) FormPresenterSupport(org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport) StringUtils(org.jboss.tools.openshift.common.core.utils.StringUtils) RouteLabelProvider(org.jboss.tools.openshift.internal.ui.dialog.SelectRouteDialog.RouteLabelProvider) ControlDecorationSupport(org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport) IStatus(org.eclipse.core.runtime.IStatus) IPath(org.eclipse.core.runtime.IPath) ValueBindingBuilder(org.jboss.tools.common.ui.databinding.ValueBindingBuilder) AbstractOpenShiftWizardPage(org.jboss.tools.openshift.internal.common.ui.wizard.AbstractOpenShiftWizardPage) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) RequiredControlDecorationUpdater(org.jboss.tools.openshift.internal.common.ui.databinding.RequiredControlDecorationUpdater) Model2ObservableTreeItemConverter(org.jboss.tools.openshift.internal.ui.treeitem.Model2ObservableTreeItemConverter) Button(org.eclipse.swt.widgets.Button) Collection(java.util.Collection) IViewerObservableValue(org.eclipse.jface.databinding.viewers.IViewerObservableValue) PreferencesUtil(org.eclipse.ui.dialogs.PreferencesUtil) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ExpansionAdapter(org.eclipse.ui.forms.events.ExpansionAdapter) Binding(org.eclipse.core.databinding.Binding) BeanProperties(org.eclipse.core.databinding.beans.BeanProperties) IRoute(com.openshift.restclient.model.route.IRoute) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog) TreeViewer(org.eclipse.jface.viewers.TreeViewer) IWizardContainer(org.eclipse.jface.wizard.IWizardContainer) Label(org.eclipse.swt.widgets.Label) ElementTreeSelectionDialog(org.eclipse.ui.dialogs.ElementTreeSelectionDialog) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) RSyncValidator(org.jboss.tools.openshift.internal.core.util.RSyncValidator) Image(org.eclipse.swt.graphics.Image) HashMap(java.util.HashMap) ISWTObservableValue(org.eclipse.jface.databinding.swt.ISWTObservableValue) ObservableTreeItem2ModelConverter(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItem2ModelConverter) ObservableListContentProvider(org.eclipse.jface.databinding.viewers.ObservableListContentProvider) ComboViewer(org.eclipse.jface.viewers.ComboViewer) StructuredViewer(org.eclipse.jface.viewers.StructuredViewer) ObservableTreeItem(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItem) IObservableValue(org.eclipse.core.databinding.observable.value.IObservableValue) DataBindingUtils(org.jboss.tools.openshift.internal.common.ui.utils.DataBindingUtils) OPEN_SHIFT_PREFERENCE_PAGE_ID(org.jboss.tools.openshift.core.preferences.IOpenShiftCoreConstants.OPEN_SHIFT_PREFERENCE_PAGE_ID) UIUtils(org.jboss.tools.openshift.internal.common.ui.utils.UIUtils) ObservableListTreeContentProvider(org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider) InvertingBooleanConverter(org.jboss.tools.common.ui.databinding.InvertingBooleanConverter) FillLayout(org.eclipse.swt.layout.FillLayout) OpenShiftUIActivator(org.jboss.tools.openshift.internal.ui.OpenShiftUIActivator) WorkbenchLabelProvider(org.eclipse.ui.model.WorkbenchLabelProvider) Viewer(org.eclipse.jface.viewers.Viewer) Job(org.eclipse.core.runtime.jobs.Job) IFormPresenter(org.jboss.tools.openshift.internal.common.ui.databinding.FormPresenterSupport.IFormPresenter) ViewerProperties(org.eclipse.jface.databinding.viewers.ViewerProperties) Group(org.eclipse.swt.widgets.Group) Connection(org.jboss.tools.openshift.core.connection.Connection) WritableValue(org.eclipse.core.databinding.observable.value.WritableValue) WizardUtils(org.jboss.tools.common.ui.WizardUtils) DisableableMultiValitdator(org.jboss.tools.openshift.internal.common.ui.databinding.DisableableMultiValitdator) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) OpenShiftCoreException(org.jboss.tools.openshift.common.core.OpenShiftCoreException) OpenShiftUIMessages(org.jboss.tools.openshift.internal.ui.OpenShiftUIMessages) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IListChangeListener(org.eclipse.core.databinding.observable.list.IListChangeListener) Collections(java.util.Collections) Control(org.eclipse.swt.widgets.Control) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) Model2ObservableTreeItemConverter(org.jboss.tools.openshift.internal.ui.treeitem.Model2ObservableTreeItemConverter) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ObservableTreeItem2ModelConverter(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItem2ModelConverter) Text(org.eclipse.swt.widgets.Text) ObservableTreeItem(org.jboss.tools.openshift.internal.ui.treeitem.ObservableTreeItem) IViewerObservableValue(org.eclipse.jface.databinding.viewers.IViewerObservableValue) IResource(com.openshift.restclient.model.IResource)

Example 5 with IViewerObservableValue

use of org.eclipse.jface.databinding.viewers.IViewerObservableValue in project jbosstools-openshift by jbosstools.

the class ServerSettingsWizardPage method createResourceControls.

private void createResourceControls(Composite parent, ServerSettingsWizardPageModel model, DataBindingContext dbc) {
    SashForm resourceControlsContainer = new SashForm(parent, SWT.HORIZONTAL);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).hint(RESOURCE_PANEL_WIDTH, SWT.DEFAULT).applyTo(resourceControlsContainer);
    IViewerObservableValue selectedResourceTreeItem = createResourceTree(model, resourceControlsContainer, dbc);
    createResourceDetails(selectedResourceTreeItem, resourceControlsContainer, dbc);
    resourceControlsContainer.setWeights(new int[] { 1, 2 });
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) IViewerObservableValue(org.eclipse.jface.databinding.viewers.IViewerObservableValue)

Aggregations

IViewerObservableValue (org.eclipse.jface.databinding.viewers.IViewerObservableValue)5 IObservableValue (org.eclipse.core.databinding.observable.value.IObservableValue)3 Binding (org.eclipse.core.databinding.Binding)2 MultiValidator (org.eclipse.core.databinding.validation.MultiValidator)2 IStatus (org.eclipse.core.runtime.IStatus)2 SashForm (org.eclipse.swt.custom.SashForm)2 IBuildConfig (com.openshift.restclient.model.IBuildConfig)1 IResource (com.openshift.restclient.model.IResource)1 IRoute (com.openshift.restclient.model.route.IRoute)1 File (java.io.File)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 BooleanUtils (org.apache.commons.lang.BooleanUtils)1 DataBindingContext (org.eclipse.core.databinding.DataBindingContext)1 UpdateValueStrategy (org.eclipse.core.databinding.UpdateValueStrategy)1 ValidationStatusProvider (org.eclipse.core.databinding.ValidationStatusProvider)1 BeanProperties (org.eclipse.core.databinding.beans.BeanProperties)1