Search in sources :

Example 6 with FlatReferencesTable

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

the class AdvancedPropertiesEditionPartForm method createReferencedObjectFlatReferencesTable.

/**
 * @param parent
 */
protected Composite createReferencedObjectFlatReferencesTable(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, RequirementViewsRepository.Advanced.referencedObject, RequirementMessages.AdvancedPropertiesEditionPart_ReferencedObjectLabel);
    referencedObject = new FlatReferencesTable(parent);
    referencedObject.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    referencedObject.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection() instanceof StructuredSelection)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(AdvancedPropertiesEditionPartForm.this, RequirementViewsRepository.Advanced.referencedObject, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, ((StructuredSelection) event.getSelection()).toList()));
        }
    });
    GridData referencedObjectData = new GridData(GridData.FILL_HORIZONTAL);
    referencedObject.setLayoutData(referencedObjectData);
    referencedObject.setID(RequirementViewsRepository.Advanced.referencedObject);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RequirementViewsRepository.Advanced.referencedObject, RequirementViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : FlatReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.FlatReferencesTable) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) 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)6 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)6 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)6 FlatReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.FlatReferencesTable)6 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)6 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)6 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)6 GridData (org.eclipse.swt.layout.GridData)6