Search in sources :

Example 56 with EObjectFlatComboViewer

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

the class OppositePropertiesEditionPartImpl method createReferencedTypeFlatComboViewer.

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

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

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

the class TransitionPropertiesEditionPartForm method createTargetFlatComboViewer.

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

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

the class TaskReferencePropertiesEditionPartForm method createTaskFlatComboViewer.

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

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

the class ReferencePropertiesEditionPartForm method createReferencedTypeFlatComboViewer.

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

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

the class ParticipantPropertiesEditionPartImpl method createTypeFlatComboViewer.

/**
 * @param parent the parent composite
 */
protected Composite createTypeFlatComboViewer(Composite parent) {
    createDescription(parent, InteractionViewsRepository.Participant.Properties.type, InteractionMessages.ParticipantPropertiesEditionPart_TypeLabel);
    type = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(InteractionViewsRepository.Participant.Properties.type, InteractionViewsRepository.SWT_KIND));
    type.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    type.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ParticipantPropertiesEditionPartImpl.this, InteractionViewsRepository.Participant.Properties.type, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    GridData typeData = new GridData(GridData.FILL_HORIZONTAL);
    type.setLayoutData(typeData);
    type.setID(InteractionViewsRepository.Participant.Properties.type);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(InteractionViewsRepository.Participant.Properties.type, InteractionViewsRepository.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