Search in sources :

Example 31 with EMFComboViewer

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

the class FinderPropertiesEditionPartImpl method createMultiplicityEMFComboViewer.

protected Composite createMultiplicityEMFComboViewer(Composite parent) {
    createDescription(parent, EntityViewsRepository.Finder.Properties.multiplicity, EntityMessages.FinderPropertiesEditionPart_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(FinderPropertiesEditionPartImpl.this, EntityViewsRepository.Finder.Properties.multiplicity, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getMultiplicity()));
        }
    });
    multiplicity.setID(EntityViewsRepository.Finder.Properties.multiplicity);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EntityViewsRepository.Finder.Properties.multiplicity, EntityViewsRepository.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 32 with EMFComboViewer

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

the class ColumnPropertiesEditionPartImpl method createTypeEMFComboViewer.

protected Composite createTypeEMFComboViewer(Composite parent) {
    createDescription(parent, DatabaseViewsRepository.Column.Properties.type, DatabaseMessages.ColumnPropertiesEditionPart_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(ColumnPropertiesEditionPartImpl.this, DatabaseViewsRepository.Column.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(type.getCombo(), DatabaseViewsRepository.Column.Properties.type);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.type, DatabaseViewsRepository.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)

Example 33 with EMFComboViewer

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

the class RiskPropertiesEditionPartForm method createDrawbacksEMFComboViewer.

protected Composite createDrawbacksEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, GraalextensionsViewsRepository.Risk.Properties.drawbacks, GraalextensionsMessages.RiskPropertiesEditionPart_DrawbacksLabel);
    drawbacks = new EMFComboViewer(parent);
    drawbacks.setContentProvider(new ArrayContentProvider());
    drawbacks.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
    GridData drawbacksData = new GridData(GridData.FILL_HORIZONTAL);
    drawbacks.getCombo().setLayoutData(drawbacksData);
    drawbacks.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.drawbacks, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getDrawbacks()));
        }
    });
    drawbacks.setID(GraalextensionsViewsRepository.Risk.Properties.drawbacks);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(GraalextensionsViewsRepository.Risk.Properties.drawbacks, 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 34 with EMFComboViewer

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

the class RiskPropertiesEditionPartForm method createRiskEMFComboViewer.

protected Composite createRiskEMFComboViewer(FormToolkit widgetFactory, 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(RiskPropertiesEditionPartForm.this, GraalextensionsViewsRepository.Risk.Properties.risk_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getRisk()));
        }
    });
    risk.setID(GraalextensionsViewsRepository.Risk.Properties.risk_);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(GraalextensionsViewsRepository.Risk.Properties.risk_, 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 35 with EMFComboViewer

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

the class RiskPropertiesEditionPartImpl method createDrawbacksEMFComboViewer.

protected Composite createDrawbacksEMFComboViewer(Composite parent) {
    createDescription(parent, GraalextensionsViewsRepository.Risk.Properties.drawbacks, GraalextensionsMessages.RiskPropertiesEditionPart_DrawbacksLabel);
    drawbacks = new EMFComboViewer(parent);
    drawbacks.setContentProvider(new ArrayContentProvider());
    drawbacks.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
    GridData drawbacksData = new GridData(GridData.FILL_HORIZONTAL);
    drawbacks.getCombo().setLayoutData(drawbacksData);
    drawbacks.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.drawbacks, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getDrawbacks()));
        }
    });
    drawbacks.setID(GraalextensionsViewsRepository.Risk.Properties.drawbacks);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalextensionsViewsRepository.Risk.Properties.drawbacks, 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)

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