use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class NativeTypePropertiesEditionPartForm method createMapsToFlatComboViewer.
/**
* @param parent the parent composite
* @param widgetFactory factory to use to instanciante widget of the form
*/
protected Composite createMapsToFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
createDescription(parent, TypeslibraryViewsRepository.NativeType.Properties.mapsTo, TypeslibraryMessages.NativeTypePropertiesEditionPart_MapsToLabel);
mapsTo = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(TypeslibraryViewsRepository.NativeType.Properties.mapsTo, TypeslibraryViewsRepository.FORM_KIND));
widgetFactory.adapt(mapsTo);
mapsTo.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
GridData mapsToData = new GridData(GridData.FILL_HORIZONTAL);
mapsTo.setLayoutData(mapsToData);
mapsTo.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(NativeTypePropertiesEditionPartForm.this, TypeslibraryViewsRepository.NativeType.Properties.mapsTo, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getMapsTo()));
}
});
mapsTo.setID(TypeslibraryViewsRepository.NativeType.Properties.mapsTo);
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.NativeType.Properties.mapsTo, TypeslibraryViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class TypeInstancePropertiesEditionPartForm method createTypeEMFComboViewer.
protected Composite createTypeEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, TypeslibraryViewsRepository.TypeInstance.Properties.type, TypeslibraryMessages.TypeInstancePropertiesEditionPart_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(TypeInstancePropertiesEditionPartForm.this, TypeslibraryViewsRepository.TypeInstance.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
}
});
type.setContentProvider(new EMFListContentProvider());
EditingUtils.setID(type.getCombo(), TypeslibraryViewsRepository.TypeInstance.Properties.type);
EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.TypeInstance.Properties.type, TypeslibraryViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class UserDefinedTypeRefPropertiesEditionPartForm method createTypeFlatComboViewer.
/**
* @param parent the parent composite
* @param widgetFactory factory to use to instanciante widget of the form
*/
protected Composite createTypeFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
createDescription(parent, TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, TypeslibraryMessages.UserDefinedTypeRefPropertiesEditionPart_TypeLabel);
type = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, TypeslibraryViewsRepository.FORM_KIND));
widgetFactory.adapt(type);
type.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
GridData typeData = new GridData(GridData.FILL_HORIZONTAL);
type.setLayoutData(typeData);
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(UserDefinedTypeRefPropertiesEditionPartForm.this, TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
}
});
type.setID(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type);
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type, TypeslibraryViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class TransitionPropertiesEditionPartImpl method createKindEMFComboViewer.
protected Composite createKindEMFComboViewer(Composite parent) {
createDescription(parent, GraalViewsRepository.Transition.Properties.kind, GraalMessages.TransitionPropertiesEditionPart_KindLabel);
kind = new EMFComboViewer(parent);
kind.setContentProvider(new ArrayContentProvider());
kind.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
GridData kindData = new GridData(GridData.FILL_HORIZONTAL);
kind.getCombo().setLayoutData(kindData);
kind.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(TransitionPropertiesEditionPartImpl.this, GraalViewsRepository.Transition.Properties.kind, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getKind()));
}
});
kind.setID(GraalViewsRepository.Transition.Properties.kind);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Transition.Properties.kind, GraalViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class TransitionPropertiesEditionPartImpl method createTargetFlatComboViewer.
/**
* @param parent the parent composite
*/
protected Composite createTargetFlatComboViewer(Composite parent) {
createDescription(parent, GraalViewsRepository.Transition.Properties.target, GraalMessages.TransitionPropertiesEditionPart_TargetLabel);
target = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(GraalViewsRepository.Transition.Properties.target, GraalViewsRepository.SWT_KIND));
target.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
target.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TransitionPropertiesEditionPartImpl.this, GraalViewsRepository.Transition.Properties.target, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getTarget()));
}
});
GridData targetData = new GridData(GridData.FILL_HORIZONTAL);
target.setLayoutData(targetData);
target.setID(GraalViewsRepository.Transition.Properties.target);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Transition.Properties.target, GraalViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
Aggregations