Search in sources :

Example 16 with EMFComboViewer

use of org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer in project InformationSystem by ObeoNetwork.

the class ServicePropertiesEditionPartImpl method createKindEMFComboViewer.

protected Composite createKindEMFComboViewer(Composite parent) {
    createDescription(parent, SoaViewsRepository.Service.Properties.kind, SoaMessages.ServicePropertiesEditionPart_KindLabel);
    kind = new EMFComboViewer(parent);
    kind.setContentProvider(new ArrayContentProvider());
    kind.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
    GridData kindData = new GridData(GridData.FILL_HORIZONTAL);
    kind.getCombo().setLayoutData(kindData);
    kind.addSelectionChangedListener(new ISelectionChangedListener() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        public void selectionChanged(SelectionChangedEvent event) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ServicePropertiesEditionPartImpl.this, SoaViewsRepository.Service.Properties.kind, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getKind()));
        }
    });
    kind.setID(SoaViewsRepository.Service.Properties.kind);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(SoaViewsRepository.Service.Properties.kind, SoaViewsRepository.SWT_KIND), null);
    // End of user code
    return parent;
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) EMFComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Example 17 with EMFComboViewer

use of org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer in project InformationSystem by ObeoNetwork.

the class RiskPropertiesEditionPartImpl method createRiskEMFComboViewer.

protected Composite createRiskEMFComboViewer(Composite parent) {
    createDescription(parent, GraalextensionsViewsRepository.Risk.Properties.risk_, GraalextensionsMessages.RiskPropertiesEditionPart_RiskLabel);
    risk = new EMFComboViewer(parent);
    risk.setContentProvider(new ArrayContentProvider());
    risk.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
    GridData riskData = new GridData(GridData.FILL_HORIZONTAL);
    risk.getCombo().setLayoutData(riskData);
    risk.addSelectionChangedListener(new ISelectionChangedListener() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        public void selectionChanged(SelectionChangedEvent event) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RiskPropertiesEditionPartImpl.this, GraalextensionsViewsRepository.Risk.Properties.risk_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getRisk()));
        }
    });
    risk.setID(GraalextensionsViewsRepository.Risk.Properties.risk_);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalextensionsViewsRepository.Risk.Properties.risk_, GraalextensionsViewsRepository.SWT_KIND), null);
    // End of user code
    return parent;
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) EMFComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Example 18 with EMFComboViewer

use of org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer in project InformationSystem by ObeoNetwork.

the class RiskPropertiesEditionPartForm method createBenefitsEMFComboViewer.

protected Composite createBenefitsEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, GraalextensionsViewsRepository.Risk.Properties.benefits, GraalextensionsMessages.RiskPropertiesEditionPart_BenefitsLabel);
    benefits = new EMFComboViewer(parent);
    benefits.setContentProvider(new ArrayContentProvider());
    benefits.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
    GridData benefitsData = new GridData(GridData.FILL_HORIZONTAL);
    benefits.getCombo().setLayoutData(benefitsData);
    benefits.addSelectionChangedListener(new ISelectionChangedListener() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        public void selectionChanged(SelectionChangedEvent event) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RiskPropertiesEditionPartForm.this, GraalextensionsViewsRepository.Risk.Properties.benefits, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getBenefits()));
        }
    });
    benefits.setID(GraalextensionsViewsRepository.Risk.Properties.benefits);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(GraalextensionsViewsRepository.Risk.Properties.benefits, GraalextensionsViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) EMFComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Example 19 with EMFComboViewer

use of org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer in project InformationSystem by ObeoNetwork.

the class ReferencePropertiesEditionPartForm method createMultiplicityEMFComboViewer.

protected Composite createMultiplicityEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.Reference.Properties.multiplicity, EnvironmentMessages.ReferencePropertiesEditionPart_MultiplicityLabel);
    multiplicity = new EMFComboViewer(parent);
    multiplicity.setContentProvider(new ArrayContentProvider());
    multiplicity.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
    GridData multiplicityData = new GridData(GridData.FILL_HORIZONTAL);
    multiplicity.getCombo().setLayoutData(multiplicityData);
    multiplicity.addSelectionChangedListener(new ISelectionChangedListener() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        public void selectionChanged(SelectionChangedEvent event) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ReferencePropertiesEditionPartForm.this, EnvironmentViewsRepository.Reference.Properties.multiplicity, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getMultiplicity()));
        }
    });
    multiplicity.setID(EnvironmentViewsRepository.Reference.Properties.multiplicity);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.Reference.Properties.multiplicity, EnvironmentViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) EMFComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Example 20 with EMFComboViewer

use of org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer in project InformationSystem by ObeoNetwork.

the class AttributePropertiesEditionPartImpl method createTypeEMFComboViewer.

protected Composite createTypeEMFComboViewer(Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.Attribute.Properties.type, EnvironmentMessages.AttributePropertiesEditionPart_TypeLabel);
    type = new EMFComboViewer(parent);
    GridData typeData = new GridData(GridData.FILL_HORIZONTAL);
    type.getCombo().setLayoutData(typeData);
    type.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    type.addSelectionChangedListener(new ISelectionChangedListener() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        public void selectionChanged(SelectionChangedEvent event) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AttributePropertiesEditionPartImpl.this, EnvironmentViewsRepository.Attribute.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(type.getCombo(), EnvironmentViewsRepository.Attribute.Properties.type);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.Attribute.Properties.type, EnvironmentViewsRepository.SWT_KIND), null);
    // End of user code
    return parent;
}
Also used : EMFListContentProvider(org.eclipse.emf.eef.runtime.ui.providers.EMFListContentProvider) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) EMFComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Aggregations

AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)50 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)50 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)50 EMFComboViewer (org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer)50 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)50 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)50 GridData (org.eclipse.swt.layout.GridData)50 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)34 EMFListContentProvider (org.eclipse.emf.eef.runtime.ui.providers.EMFListContentProvider)16