use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project statecharts by Yakindu.
the class OrderElementControl method init.
private void init() {
this.setLayout(new GridLayout(2, false));
viewer = new TableViewer(this, SWT.SINGLE | SWT.BORDER);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(new AdapterFactoryLabelProvider(new SGraphItemProviderAdapterFactory()));
Composite buttonComposite = getToolkit().createComposite(this);
buttonComposite.setLayout(new FillLayout(SWT.VERTICAL));
btnUp = getToolkit().createButton(buttonComposite, "up", SWT.PUSH);
btnDown = getToolkit().createButton(buttonComposite, "down", SWT.PUSH);
viewer.addSelectionChangedListener(enableButtonListener);
viewer.addSelectionChangedListener(editPartSelectionListener);
btnUp.addSelectionListener(upButtonListener);
btnDown.addSelectionListener(downButtonListener);
GridDataFactory.fillDefaults().applyTo(viewer.getControl());
GridDataFactory.fillDefaults().applyTo(buttonComposite);
GridDataFactory.fillDefaults().grab(true, false).applyTo(viewer.getControl());
GridDataFactory.fillDefaults().grab(true, false).applyTo(this);
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class ForeignKeyElementPropertiesEditionPartImpl method createFKColumnFlatComboViewer.
/**
* @param parent the parent composite
*/
protected Composite createFKColumnFlatComboViewer(Composite parent) {
createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_FKColumnLabel);
fKColumn = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseViewsRepository.SWT_KIND));
fKColumn.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
fKColumn.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getFKColumn()));
}
});
GridData fKColumnData = new GridData(GridData.FILL_HORIZONTAL);
fKColumn.setLayoutData(fKColumnData);
fKColumn.setID(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, 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 IndexElementPropertiesEditionPartImpl method createColumnFlatComboViewer.
/**
* @param parent the parent composite
*/
protected Composite createColumnFlatComboViewer(Composite parent) {
createDescription(parent, DatabaseViewsRepository.IndexElement.Properties.column, DatabaseMessages.IndexElementPropertiesEditionPart_ColumnLabel);
column = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.IndexElement.Properties.column, DatabaseViewsRepository.SWT_KIND));
column.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
column.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(IndexElementPropertiesEditionPartImpl.this, DatabaseViewsRepository.IndexElement.Properties.column, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getColumn()));
}
});
GridData columnData = new GridData(GridData.FILL_HORIZONTAL);
column.setLayoutData(columnData);
column.setID(DatabaseViewsRepository.IndexElement.Properties.column);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.IndexElement.Properties.column, 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 PrimaryKeyPropertiesEditionPartImpl method addColumns.
/**
*/
protected void addColumns() {
EMFModelViewerDialog dialog = new EMFModelViewerDialog(new AdapterFactoryLabelProvider(adapterFactory), columns.getInput(), columnsFilters, columnsBusinessFilters, false, true) {
public void process(IStructuredSelection selection) {
for (Iterator iter = selection.iterator(); iter.hasNext(); ) {
EObject elem = (EObject) iter.next();
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PrimaryKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.PrimaryKey.Properties.columns, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
}
}
};
dialog.open();
// Start of user code for addColumns
// End of user code
columns.refresh();
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class ColumnPropertiesEditionPartImpl method createSequenceFlatComboViewer.
/**
* @param parent the parent composite
*/
protected Composite createSequenceFlatComboViewer(Composite parent) {
createDescription(parent, DatabaseViewsRepository.Column.Properties.Sequence.sequence_, DatabaseMessages.ColumnPropertiesEditionPart_SequenceLabel);
sequence = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.Column.Properties.Sequence.sequence_, DatabaseViewsRepository.SWT_KIND));
sequence.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
sequence.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartImpl.this, DatabaseViewsRepository.Column.Properties.Sequence.sequence_, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getSequence()));
}
});
GridData sequenceData = new GridData(GridData.FILL_HORIZONTAL);
sequence.setLayoutData(sequenceData);
sequence.setID(DatabaseViewsRepository.Column.Properties.Sequence.sequence_);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.Sequence.sequence_, DatabaseViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
Aggregations