Search in sources :

Example 1 with EMFComboViewer

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

the class ColumnPropertiesEditionPartForm method createTypeEMFComboViewer.

protected Composite createTypeEMFComboViewer(FormToolkit widgetFactory, 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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(type.getCombo(), DatabaseViewsRepository.Column.Properties.type);
    EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.type, DatabaseViewsRepository.FORM_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 2 with EMFComboViewer

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

the class NativeTypePropertiesEditionPartImpl method createSpecEMFComboViewer.

protected Composite createSpecEMFComboViewer(Composite parent) {
    createDescription(parent, TypeslibraryViewsRepository.NativeType.Properties.spec, TypeslibraryMessages.NativeTypePropertiesEditionPart_SpecLabel);
    spec = new EMFComboViewer(parent);
    spec.setContentProvider(new ArrayContentProvider());
    spec.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
    GridData specData = new GridData(GridData.FILL_HORIZONTAL);
    spec.getCombo().setLayoutData(specData);
    spec.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(NativeTypePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.NativeType.Properties.spec, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getSpec()));
        }
    });
    spec.setID(TypeslibraryViewsRepository.NativeType.Properties.spec);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.NativeType.Properties.spec, TypeslibraryViewsRepository.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 3 with EMFComboViewer

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

the class TypeInstancePropertiesEditionPartImpl method createTypeEMFComboViewer.

protected Composite createTypeEMFComboViewer(Composite parent) {
    createDescription(parent, TypeslibraryViewsRepository.TypeInstance.Properties.type, TypeslibraryMessages.TypeInstancePropertiesEditionPart_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(TypeInstancePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.TypeInstance.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(type.getCombo(), TypeslibraryViewsRepository.TypeInstance.Properties.type);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.TypeInstance.Properties.type, TypeslibraryViewsRepository.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 4 with EMFComboViewer

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

the class TypeInstancePropertiesEditionPartForm method createTypeEMFComboViewer.

protected Composite createTypeEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, TypeslibraryViewsRepository.TypeInstance.Properties.type, TypeslibraryMessages.TypeInstancePropertiesEditionPart_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(TypeInstancePropertiesEditionPartForm.this, TypeslibraryViewsRepository.TypeInstance.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(type.getCombo(), TypeslibraryViewsRepository.TypeInstance.Properties.type);
    EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.TypeInstance.Properties.type, TypeslibraryViewsRepository.FORM_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 5 with EMFComboViewer

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

the class TransitionPropertiesEditionPartImpl method createKindEMFComboViewer.

protected Composite createKindEMFComboViewer(Composite parent) {
    createDescription(parent, GraalViewsRepository.Transition.Properties.kind, GraalMessages.TransitionPropertiesEditionPart_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(TransitionPropertiesEditionPartImpl.this, GraalViewsRepository.Transition.Properties.kind, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getKind()));
        }
    });
    kind.setID(GraalViewsRepository.Transition.Properties.kind);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Transition.Properties.kind, GraalViewsRepository.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