use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent 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.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class ForeignKeyElementPropertiesEditionPartForm method createTargetTableText.
protected Composite createTargetTableText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_TargetTableLabel);
// $NON-NLS-1$
targetTable = widgetFactory.createText(parent, "");
targetTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData targetTableData = new GridData(GridData.FILL_HORIZONTAL);
targetTable.setLayoutData(targetTableData);
targetTable.addFocusListener(new FocusAdapter() {
/**
* @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void focusLost(FocusEvent e) {
if (propertiesEditionComponent != null) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, targetTable.getText()));
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, targetTable.getText()));
}
}
/**
* @see org.eclipse.swt.events.FocusAdapter#focusGained(org.eclipse.swt.events.FocusEvent)
*/
@Override
public void focusGained(FocusEvent e) {
if (propertiesEditionComponent != null) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
}
}
});
targetTable.addKeyListener(new KeyAdapter() {
/**
* @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void keyPressed(KeyEvent e) {
if (e.character == SWT.CR) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, targetTable.getText()));
}
}
});
EditingUtils.setID(targetTable, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable);
// $NON-NLS-1$
EditingUtils.setEEFtype(targetTable, "eef::Text");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, DatabaseViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class ForeignKeyElementPropertiesEditionPartForm method createSourceTableText.
protected Composite createSourceTableText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_SourceTableLabel);
// $NON-NLS-1$
sourceTable = widgetFactory.createText(parent, "");
sourceTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData sourceTableData = new GridData(GridData.FILL_HORIZONTAL);
sourceTable.setLayoutData(sourceTableData);
sourceTable.addFocusListener(new FocusAdapter() {
/**
* @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void focusLost(FocusEvent e) {
if (propertiesEditionComponent != null) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, sourceTable.getText()));
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, sourceTable.getText()));
}
}
/**
* @see org.eclipse.swt.events.FocusAdapter#focusGained(org.eclipse.swt.events.FocusEvent)
*/
@Override
public void focusGained(FocusEvent e) {
if (propertiesEditionComponent != null) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
}
}
});
sourceTable.addKeyListener(new KeyAdapter() {
/**
* @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void keyPressed(KeyEvent e) {
if (e.character == SWT.CR) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, sourceTable.getText()));
}
}
});
EditingUtils.setID(sourceTable, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable);
// $NON-NLS-1$
EditingUtils.setEEFtype(sourceTable, "eef::Text");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, DatabaseViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent 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;
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class ForeignKeyElementPropertiesEditionPartForm method createPKColumnFlatComboViewer.
/**
* @param parent the parent composite
* @param widgetFactory factory to use to instanciante widget of the form
*/
protected Composite createPKColumnFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_PKColumnLabel);
pKColumn = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn, DatabaseViewsRepository.FORM_KIND));
widgetFactory.adapt(pKColumn);
pKColumn.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
GridData pKColumnData = new GridData(GridData.FILL_HORIZONTAL);
pKColumn.setLayoutData(pKColumnData);
pKColumn.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.pKColumn, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getPKColumn()));
}
});
pKColumn.setID(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn);
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn, DatabaseViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
Aggregations