Search in sources :

Example 41 with EObjectFlatComboViewer

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

the class IndexElementPropertiesEditionPartForm method createColumnFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createColumnFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, DatabaseViewsRepository.IndexElement.Properties.column, DatabaseMessages.IndexElementPropertiesEditionPart_ColumnLabel);
    column = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.IndexElement.Properties.column, DatabaseViewsRepository.FORM_KIND));
    widgetFactory.adapt(column);
    column.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData columnData = new GridData(GridData.FILL_HORIZONTAL);
    column.setLayoutData(columnData);
    column.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(IndexElementPropertiesEditionPartForm.this, DatabaseViewsRepository.IndexElement.Properties.column, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getColumn()));
        }
    });
    column.setID(DatabaseViewsRepository.IndexElement.Properties.column);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.IndexElement.Properties.column, DatabaseViewsRepository.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 EObjectFlatComboViewer

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

the class ColumnPropertiesEditionPartForm method createSequenceFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createSequenceFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, DatabaseViewsRepository.Column.Properties.Sequence.sequence_, DatabaseMessages.ColumnPropertiesEditionPart_SequenceLabel);
    sequence = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.Column.Properties.Sequence.sequence_, DatabaseViewsRepository.FORM_KIND));
    widgetFactory.adapt(sequence);
    sequence.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData sequenceData = new GridData(GridData.FILL_HORIZONTAL);
    sequence.setLayoutData(sequenceData);
    sequence.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.Sequence.sequence_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getSequence()));
        }
    });
    sequence.setID(DatabaseViewsRepository.Column.Properties.Sequence.sequence_);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.Sequence.sequence_, DatabaseViewsRepository.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 43 with EObjectFlatComboViewer

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

the class SubflowStatePropertiesEditionPartImpl method createSubflowFlatComboViewer.

/**
 * @param parent the parent composite
 */
protected Composite createSubflowFlatComboViewer(Composite parent) {
    createDescription(parent, FlowViewsRepository.SubflowState.Properties.subflow, FlowMessages.SubflowStatePropertiesEditionPart_SubflowLabel);
    subflow = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(FlowViewsRepository.SubflowState.Properties.subflow, FlowViewsRepository.SWT_KIND));
    subflow.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    subflow.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(SubflowStatePropertiesEditionPartImpl.this, FlowViewsRepository.SubflowState.Properties.subflow, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getSubflow()));
        }
    });
    GridData subflowData = new GridData(GridData.FILL_HORIZONTAL);
    subflow.setLayoutData(subflowData);
    subflow.setID(FlowViewsRepository.SubflowState.Properties.subflow);
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(FlowViewsRepository.SubflowState.Properties.subflow, FlowViewsRepository.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 44 with EObjectFlatComboViewer

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

the class TransitionPropertiesEditionPartForm method createToFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createToFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, FlowViewsRepository.Transition.Properties.to, FlowMessages.TransitionPropertiesEditionPart_ToLabel);
    to = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(FlowViewsRepository.Transition.Properties.to, FlowViewsRepository.FORM_KIND));
    widgetFactory.adapt(to);
    to.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData toData = new GridData(GridData.FILL_HORIZONTAL);
    to.setLayoutData(toData);
    to.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, FlowViewsRepository.Transition.Properties.to, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getTo()));
        }
    });
    to.setID(FlowViewsRepository.Transition.Properties.to);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(FlowViewsRepository.Transition.Properties.to, FlowViewsRepository.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 45 with EObjectFlatComboViewer

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

the class TransitionPropertiesEditionPartForm method createFromFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createFromFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, FlowViewsRepository.Transition.Properties.from, FlowMessages.TransitionPropertiesEditionPart_FromLabel);
    from = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(FlowViewsRepository.Transition.Properties.from, FlowViewsRepository.FORM_KIND));
    widgetFactory.adapt(from);
    from.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData fromData = new GridData(GridData.FILL_HORIZONTAL);
    from.setLayoutData(fromData);
    from.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, FlowViewsRepository.Transition.Properties.from, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getFrom()));
        }
    });
    from.setID(FlowViewsRepository.Transition.Properties.from);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(FlowViewsRepository.Transition.Properties.from, FlowViewsRepository.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)

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