use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class ActorPropertiesEditionPartImpl method createSuperActorFlatComboViewer.
/**
* @param parent the parent composite
*/
protected Composite createSuperActorFlatComboViewer(Composite parent) {
createDescription(parent, GraalViewsRepository.Actor.Properties.superActor, GraalMessages.ActorPropertiesEditionPart_SuperActorLabel);
superActor = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(GraalViewsRepository.Actor.Properties.superActor, GraalViewsRepository.SWT_KIND));
superActor.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
superActor.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ActorPropertiesEditionPartImpl.this, GraalViewsRepository.Actor.Properties.superActor, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getSuperActor()));
}
});
GridData superActorData = new GridData(GridData.FILL_HORIZONTAL);
superActor.setLayoutData(superActorData);
superActor.setID(GraalViewsRepository.Actor.Properties.superActor);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Actor.Properties.superActor, 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 OperatorPropertiesEditionPartForm method createKindEMFComboViewer.
protected Composite createKindEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, GraalViewsRepository.Operator.Properties.kind, GraalMessages.OperatorPropertiesEditionPart_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(OperatorPropertiesEditionPartForm.this, GraalViewsRepository.Operator.Properties.kind, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getKind()));
}
});
kind.setID(GraalViewsRepository.Operator.Properties.kind);
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Operator.Properties.kind, GraalViewsRepository.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 CreateUseRelationshipDialog method createDialogArea.
/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(2, false));
Label lblSource = new Label(container, SWT.NONE);
lblSource.setText("Source :");
Label lblTarget = new Label(container, SWT.NONE);
lblTarget.setText("Target :");
treeSourceViewer = new TreeViewer(container, SWT.BORDER | SWT.MULTI);
treeSourceViewer.setContentProvider(new TasksContentProvider());
treeSourceViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
treeSourceViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@SuppressWarnings("rawtypes")
public void selectionChanged(SelectionChangedEvent event) {
if (event.getSelection().isEmpty()) {
selectedTasksAsSource.clear();
} else if (event.getSelection() instanceof IStructuredSelection) {
selectedTasksAsSource.clear();
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
for (Iterator iterator = selection.iterator(); iterator.hasNext(); ) {
Object domain = (Object) iterator.next();
if (domain instanceof Task) {
selectedTasksAsSource.add((Task) domain);
}
}
}
computeOkButtonState();
}
});
treeSourceViewer.setInput(new RootElement(this.source));
treeSourceViewer.setSelection(new StructuredSelection(this.source), true);
Tree treeSource = treeSourceViewer.getTree();
treeSource.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
treeTargetViewer = new TreeViewer(container, SWT.BORDER | SWT.MULTI);
treeTargetViewer.setContentProvider(new TasksContentProvider());
treeTargetViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
treeTargetViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@SuppressWarnings("rawtypes")
public void selectionChanged(SelectionChangedEvent event) {
if (event.getSelection().isEmpty()) {
selectedTasksAsTarget.clear();
} else if (event.getSelection() instanceof IStructuredSelection) {
selectedTasksAsTarget.clear();
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
for (Iterator iterator = selection.iterator(); iterator.hasNext(); ) {
Object domain = (Object) iterator.next();
if (domain instanceof Task) {
selectedTasksAsTarget.add((Task) domain);
}
}
}
computeOkButtonState();
}
});
treeTargetViewer.setInput(new RootElement(this.target));
treeTargetViewer.setSelection(new StructuredSelection(this.target), true);
Tree treeTarget = treeTargetViewer.getTree();
treeTarget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
return container;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class PersistencePropertiesEditionPartForm method createInheritanceKindEMFComboViewer.
protected Composite createInheritanceKindEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, EntityViewsRepository.Persistence.Properties.inheritanceKind, EntityMessages.PersistencePropertiesEditionPart_InheritanceKindLabel);
inheritanceKind = new EMFComboViewer(parent);
inheritanceKind.setContentProvider(new ArrayContentProvider());
inheritanceKind.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
GridData inheritanceKindData = new GridData(GridData.FILL_HORIZONTAL);
inheritanceKind.getCombo().setLayoutData(inheritanceKindData);
inheritanceKind.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(PersistencePropertiesEditionPartForm.this, EntityViewsRepository.Persistence.Properties.inheritanceKind, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getInheritanceKind()));
}
});
inheritanceKind.setID(EntityViewsRepository.Persistence.Properties.inheritanceKind);
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(EntityViewsRepository.Persistence.Properties.inheritanceKind, EntityViewsRepository.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 PersistencePropertiesEditionPartImpl method createInheritanceKindEMFComboViewer.
protected Composite createInheritanceKindEMFComboViewer(Composite parent) {
createDescription(parent, EntityViewsRepository.Persistence.Properties.inheritanceKind, EntityMessages.PersistencePropertiesEditionPart_InheritanceKindLabel);
inheritanceKind = new EMFComboViewer(parent);
inheritanceKind.setContentProvider(new ArrayContentProvider());
inheritanceKind.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
GridData inheritanceKindData = new GridData(GridData.FILL_HORIZONTAL);
inheritanceKind.getCombo().setLayoutData(inheritanceKindData);
inheritanceKind.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(PersistencePropertiesEditionPartImpl.this, EntityViewsRepository.Persistence.Properties.inheritanceKind, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getInheritanceKind()));
}
});
inheritanceKind.setID(EntityViewsRepository.Persistence.Properties.inheritanceKind);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EntityViewsRepository.Persistence.Properties.inheritanceKind, EntityViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
Aggregations