Search in sources :

Example 51 with EObjectFlatComboViewer

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

the class DtoPropertiesEditionPartForm method createSupertypeFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createSupertypeFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, EnvironmentViewsRepository.Dto.Properties.supertype, EnvironmentMessages.DtoPropertiesEditionPart_SupertypeLabel);
    supertype = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(EnvironmentViewsRepository.Dto.Properties.supertype, EnvironmentViewsRepository.FORM_KIND));
    widgetFactory.adapt(supertype);
    supertype.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData supertypeData = new GridData(GridData.FILL_HORIZONTAL);
    supertype.setLayoutData(supertypeData);
    supertype.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(DtoPropertiesEditionPartForm.this, EnvironmentViewsRepository.Dto.Properties.supertype, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getSupertype()));
        }
    });
    supertype.setID(EnvironmentViewsRepository.Dto.Properties.supertype);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.Dto.Properties.supertype, EnvironmentViewsRepository.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 52 with EObjectFlatComboViewer

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

the class ReferencePropertiesEditionPartImpl method createReferencedTypeFlatComboViewer.

/**
 * @param parent the parent composite
 */
protected Composite createReferencedTypeFlatComboViewer(Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.Reference.Properties.referencedType, EnvironmentMessages.ReferencePropertiesEditionPart_ReferencedTypeLabel);
    referencedType = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(EnvironmentViewsRepository.Reference.Properties.referencedType, EnvironmentViewsRepository.SWT_KIND));
    referencedType.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    referencedType.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ReferencePropertiesEditionPartImpl.this, EnvironmentViewsRepository.Reference.Properties.referencedType, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getReferencedType()));
        }
    });
    GridData referencedTypeData = new GridData(GridData.FILL_HORIZONTAL);
    referencedType.setLayoutData(referencedTypeData);
    referencedType.setID(EnvironmentViewsRepository.Reference.Properties.referencedType);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.Reference.Properties.referencedType, EnvironmentViewsRepository.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)

Example 53 with EObjectFlatComboViewer

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

the class ActorPropertiesEditionPartForm method createSuperActorFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createSuperActorFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, GraalViewsRepository.Actor.Properties.superActor, GraalMessages.ActorPropertiesEditionPart_SuperActorLabel);
    superActor = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(GraalViewsRepository.Actor.Properties.superActor, GraalViewsRepository.FORM_KIND));
    widgetFactory.adapt(superActor);
    superActor.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData superActorData = new GridData(GridData.FILL_HORIZONTAL);
    superActor.setLayoutData(superActorData);
    superActor.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(ActorPropertiesEditionPartForm.this, GraalViewsRepository.Actor.Properties.superActor, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getSuperActor()));
        }
    });
    superActor.setID(GraalViewsRepository.Actor.Properties.superActor);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Actor.Properties.superActor, GraalViewsRepository.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 54 with EObjectFlatComboViewer

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

the class DtoPropertiesEditionPartImpl method createSupertypeFlatComboViewer.

/**
 * @param parent the parent composite
 */
protected Composite createSupertypeFlatComboViewer(Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.Dto.Properties.supertype, EnvironmentMessages.DtoPropertiesEditionPart_SupertypeLabel);
    supertype = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(EnvironmentViewsRepository.Dto.Properties.supertype, EnvironmentViewsRepository.SWT_KIND));
    supertype.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    supertype.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(DtoPropertiesEditionPartImpl.this, EnvironmentViewsRepository.Dto.Properties.supertype, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getSupertype()));
        }
    });
    GridData supertypeData = new GridData(GridData.FILL_HORIZONTAL);
    supertype.setLayoutData(supertypeData);
    supertype.setID(EnvironmentViewsRepository.Dto.Properties.supertype);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.Dto.Properties.supertype, EnvironmentViewsRepository.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)

Example 55 with EObjectFlatComboViewer

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

the class InterDSMLinkPropertiesEditionPartImpl method createTargetFlatComboViewer.

/**
 * @param parent the parent composite
 */
protected Composite createTargetFlatComboViewer(Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.InterDSMLink.Properties.target, EnvironmentMessages.InterDSMLinkPropertiesEditionPart_TargetLabel);
    target = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(EnvironmentViewsRepository.InterDSMLink.Properties.target, EnvironmentViewsRepository.SWT_KIND));
    target.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    target.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InterDSMLinkPropertiesEditionPartImpl.this, EnvironmentViewsRepository.InterDSMLink.Properties.target, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getTarget()));
        }
    });
    GridData targetData = new GridData(GridData.FILL_HORIZONTAL);
    target.setLayoutData(targetData);
    target.setID(EnvironmentViewsRepository.InterDSMLink.Properties.target);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.InterDSMLink.Properties.target, EnvironmentViewsRepository.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)60 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)60 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)60 EObjectFlatComboViewer (org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer)60 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)60 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)60 GridData (org.eclipse.swt.layout.GridData)60