use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class DataBasePropertiesEditionPartImpl method createUsedLibrariesFlatReferencesTable.
/**
* @param parent
*/
protected Composite createUsedLibrariesFlatReferencesTable(Composite parent) {
createDescription(parent, DatabaseViewsRepository.DataBase_.Properties.usedLibraries, DatabaseMessages.DataBasePropertiesEditionPart_UsedLibrariesLabel);
usedLibraries = new FlatReferencesTable(parent);
usedLibraries.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
usedLibraries.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
if (event.getSelection() instanceof StructuredSelection)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(DataBasePropertiesEditionPartImpl.this, DatabaseViewsRepository.DataBase_.Properties.usedLibraries, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, ((StructuredSelection) event.getSelection()).toList()));
}
});
GridData usedLibrariesData = new GridData(GridData.FILL_HORIZONTAL);
usedLibraries.setLayoutData(usedLibrariesData);
usedLibraries.setID(DatabaseViewsRepository.DataBase_.Properties.usedLibraries);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.DataBase_.Properties.usedLibraries, DatabaseViewsRepository.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 ColumnPropertiesEditionPartForm method createTypeEMFComboViewer.
protected Composite createTypeEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Column.Properties.type, DatabaseMessages.ColumnPropertiesEditionPart_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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
}
});
type.setContentProvider(new EMFListContentProvider());
EditingUtils.setID(type.getCombo(), DatabaseViewsRepository.Column.Properties.type);
EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.type, DatabaseViewsRepository.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 ColumnPropertiesEditionPartForm method createLiteralsMultiValuedEditor.
/**
*/
protected Composite createLiteralsMultiValuedEditor(FormToolkit widgetFactory, Composite parent) {
// $NON-NLS-1$
literals = widgetFactory.createText(parent, "", SWT.READ_ONLY);
GridData literalsData = new GridData(GridData.FILL_HORIZONTAL);
literalsData.horizontalSpan = 2;
literals.setLayoutData(literalsData);
EditingUtils.setID(literals, DatabaseViewsRepository.Column.Properties.literals);
// $NON-NLS-1$
EditingUtils.setEEFtype(literals, "eef::MultiValuedEditor::field");
editLiterals = widgetFactory.createButton(parent, getDescription(DatabaseViewsRepository.Column.Properties.literals, DatabaseMessages.ColumnPropertiesEditionPart_LiteralsLabel), SWT.NONE);
GridData editLiteralsData = new GridData();
editLiterals.setLayoutData(editLiteralsData);
editLiterals.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
public void widgetSelected(SelectionEvent e) {
EEFFeatureEditorDialog dialog = new EEFFeatureEditorDialog(// $NON-NLS-1$
literals.getShell(), // $NON-NLS-1$
"Column", // $NON-NLS-1$
new AdapterFactoryLabelProvider(adapterFactory), literalsList, TypesLibraryPackage.eINSTANCE.getTypeInstance_Literals().getEType(), null, false, true, null, null);
if (dialog.open() == Window.OK) {
literalsList = dialog.getResult();
if (literalsList == null) {
literalsList = new BasicEList();
}
literals.setText(literalsList.toString());
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.literals, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(literalsList)));
setHasChanged(true);
}
}
});
EditingUtils.setID(editLiterals, DatabaseViewsRepository.Column.Properties.literals);
// $NON-NLS-1$
EditingUtils.setEEFtype(editLiterals, "eef::MultiValuedEditor::browsebutton");
// End of user code
return parent;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class DataBasePropertiesEditionPartForm method createUsedLibrariesFlatReferencesTable.
/**
* @param parent
*/
protected Composite createUsedLibrariesFlatReferencesTable(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.DataBase_.Properties.usedLibraries, DatabaseMessages.DataBasePropertiesEditionPart_UsedLibrariesLabel);
usedLibraries = new FlatReferencesTable(parent);
usedLibraries.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
usedLibraries.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
if (event.getSelection() instanceof StructuredSelection)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(DataBasePropertiesEditionPartForm.this, DatabaseViewsRepository.DataBase_.Properties.usedLibraries, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, ((StructuredSelection) event.getSelection()).toList()));
}
});
GridData usedLibrariesData = new GridData(GridData.FILL_HORIZONTAL);
usedLibraries.setLayoutData(usedLibrariesData);
usedLibraries.setID(DatabaseViewsRepository.DataBase_.Properties.usedLibraries);
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.DataBase_.Properties.usedLibraries, DatabaseViewsRepository.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 ForeignKeyElementPropertiesEditionPartForm method createFKColumnFlatComboViewer.
/**
* @param parent the parent composite
* @param widgetFactory factory to use to instanciante widget of the form
*/
protected Composite createFKColumnFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_FKColumnLabel);
fKColumn = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseViewsRepository.FORM_KIND));
widgetFactory.adapt(fKColumn);
fKColumn.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
GridData fKColumnData = new GridData(GridData.FILL_HORIZONTAL);
fKColumn.setLayoutData(fKColumnData);
fKColumn.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(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getFKColumn()));
}
});
fKColumn.setID(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn);
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
Aggregations