Search in sources :

Example 41 with AdapterFactoryLabelProvider

use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.

the class NativeTypePropertiesEditionPartForm method createMapsToFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createMapsToFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, TypeslibraryViewsRepository.NativeType.Properties.mapsTo, TypeslibraryMessages.NativeTypePropertiesEditionPart_MapsToLabel);
    mapsTo = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(TypeslibraryViewsRepository.NativeType.Properties.mapsTo, TypeslibraryViewsRepository.FORM_KIND));
    widgetFactory.adapt(mapsTo);
    mapsTo.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData mapsToData = new GridData(GridData.FILL_HORIZONTAL);
    mapsTo.setLayoutData(mapsToData);
    mapsTo.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(NativeTypePropertiesEditionPartForm.this, TypeslibraryViewsRepository.NativeType.Properties.mapsTo, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getMapsTo()));
        }
    });
    mapsTo.setID(TypeslibraryViewsRepository.NativeType.Properties.mapsTo);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.NativeType.Properties.mapsTo, TypeslibraryViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : EObjectFlatComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) 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 42 with AdapterFactoryLabelProvider

use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider 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 43 with AdapterFactoryLabelProvider

use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.

the class UserDefinedTypeRefPropertiesEditionPartForm method createTypeFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createTypeFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, TypeslibraryMessages.UserDefinedTypeRefPropertiesEditionPart_TypeLabel);
    type = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, TypeslibraryViewsRepository.FORM_KIND));
    widgetFactory.adapt(type);
    type.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData typeData = new GridData(GridData.FILL_HORIZONTAL);
    type.setLayoutData(typeData);
    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(UserDefinedTypeRefPropertiesEditionPartForm.this, TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setID(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, TypeslibraryViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : EObjectFlatComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) 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 44 with AdapterFactoryLabelProvider

use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider 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)

Example 45 with AdapterFactoryLabelProvider

use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.

the class TransitionPropertiesEditionPartImpl method createTargetFlatComboViewer.

/**
 * @param parent the parent composite
 */
protected Composite createTargetFlatComboViewer(Composite parent) {
    createDescription(parent, GraalViewsRepository.Transition.Properties.target, GraalMessages.TransitionPropertiesEditionPart_TargetLabel);
    target = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(GraalViewsRepository.Transition.Properties.target, GraalViewsRepository.SWT_KIND));
    target.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    target.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TransitionPropertiesEditionPartImpl.this, GraalViewsRepository.Transition.Properties.target, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getTarget()));
        }
    });
    GridData targetData = new GridData(GridData.FILL_HORIZONTAL);
    target.setLayoutData(targetData);
    target.setID(GraalViewsRepository.Transition.Properties.target);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Transition.Properties.target, GraalViewsRepository.SWT_KIND), null);
    // End of user code
    return parent;
}
Also used : EObjectFlatComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) 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)208 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)147 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)147 GridData (org.eclipse.swt.layout.GridData)136 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)134 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)134 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)66 AdapterFactoryContentProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)65 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)62 EObjectFlatComboViewer (org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer)60 Composite (org.eclipse.swt.widgets.Composite)52 EMFComboViewer (org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer)50 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)35 TreeViewer (org.eclipse.jface.viewers.TreeViewer)32 Tree (org.eclipse.swt.widgets.Tree)32 AdapterFactoryTreeEditor (org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor)31 IMenuManager (org.eclipse.jface.action.IMenuManager)30 IStatusLineManager (org.eclipse.jface.action.IStatusLineManager)30 IToolBarManager (org.eclipse.jface.action.IToolBarManager)30 ControlAdapter (org.eclipse.swt.events.ControlAdapter)30