Search in sources :

Example 96 with AdapterFactoryLabelProvider

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

the class AttributePropertiesEditionPartForm method createTypeEMFComboViewer.

protected Composite createTypeEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.Attribute.Properties.type, EnvironmentMessages.AttributePropertiesEditionPart_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(AttributePropertiesEditionPartForm.this, EnvironmentViewsRepository.Attribute.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(type.getCombo(), EnvironmentViewsRepository.Attribute.Properties.type);
    EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.Attribute.Properties.type, EnvironmentViewsRepository.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 97 with AdapterFactoryLabelProvider

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

the class BindingElementPropertiesEditionPartForm method createBoundElementEMFComboViewer.

protected Composite createBoundElementEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.BindingElement.Properties.boundElement, EnvironmentMessages.BindingElementPropertiesEditionPart_BoundElementLabel);
    boundElement = new EMFComboViewer(parent);
    GridData boundElementData = new GridData(GridData.FILL_HORIZONTAL);
    boundElement.getCombo().setLayoutData(boundElementData);
    boundElement.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    boundElement.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(BindingElementPropertiesEditionPartForm.this, EnvironmentViewsRepository.BindingElement.Properties.boundElement, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getBoundElement()));
        }
    });
    boundElement.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(boundElement.getCombo(), EnvironmentViewsRepository.BindingElement.Properties.boundElement);
    EditingUtils.setEEFtype(boundElement.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.BindingElement.Properties.boundElement, EnvironmentViewsRepository.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 98 with AdapterFactoryLabelProvider

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

the class BindingInfoPropertiesEditionPartForm method createLeftEMFComboViewer.

protected Composite createLeftEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.BindingInfo.Properties.left, EnvironmentMessages.BindingInfoPropertiesEditionPart_LeftLabel);
    left = new EMFComboViewer(parent);
    GridData leftData = new GridData(GridData.FILL_HORIZONTAL);
    left.getCombo().setLayoutData(leftData);
    left.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    left.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(BindingInfoPropertiesEditionPartForm.this, EnvironmentViewsRepository.BindingInfo.Properties.left, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getLeft()));
        }
    });
    left.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(left.getCombo(), EnvironmentViewsRepository.BindingInfo.Properties.left);
    EditingUtils.setEEFtype(left.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.BindingInfo.Properties.left, EnvironmentViewsRepository.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 99 with AdapterFactoryLabelProvider

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

the class BindingReferencePropertiesEditionPartForm method createLeftEMFComboViewer.

protected Composite createLeftEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.BindingReference.Properties.left, EnvironmentMessages.BindingReferencePropertiesEditionPart_LeftLabel);
    left = new EMFComboViewer(parent);
    GridData leftData = new GridData(GridData.FILL_HORIZONTAL);
    left.getCombo().setLayoutData(leftData);
    left.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    left.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(BindingReferencePropertiesEditionPartForm.this, EnvironmentViewsRepository.BindingReference.Properties.left, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getLeft()));
        }
    });
    left.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(left.getCombo(), EnvironmentViewsRepository.BindingReference.Properties.left);
    EditingUtils.setEEFtype(left.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.BindingReference.Properties.left, EnvironmentViewsRepository.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 100 with AdapterFactoryLabelProvider

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

the class BindingReferencePropertiesEditionPartForm method createRightEMFComboViewer.

protected Composite createRightEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, EnvironmentViewsRepository.BindingReference.Properties.right, EnvironmentMessages.BindingReferencePropertiesEditionPart_RightLabel);
    right = new EMFComboViewer(parent);
    GridData rightData = new GridData(GridData.FILL_HORIZONTAL);
    right.getCombo().setLayoutData(rightData);
    right.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    right.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(BindingReferencePropertiesEditionPartForm.this, EnvironmentViewsRepository.BindingReference.Properties.right, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getRight()));
        }
    });
    right.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(right.getCombo(), EnvironmentViewsRepository.BindingReference.Properties.right);
    EditingUtils.setEEFtype(right.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EnvironmentViewsRepository.BindingReference.Properties.right, EnvironmentViewsRepository.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)

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