use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class DataBasePropertiesEditionPartImpl method createNameText.
protected Composite createNameText(Composite parent) {
createDescription(parent, DatabaseViewsRepository.DataBase_.Properties.name, DatabaseMessages.DataBasePropertiesEditionPart_NameLabel);
name = SWTUtils.createScrollableText(parent, SWT.BORDER);
GridData nameData = new GridData(GridData.FILL_HORIZONTAL);
name.setLayoutData(nameData);
name.addFocusListener(new FocusAdapter() {
/**
* {@inheritDoc}
*
* @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(DataBasePropertiesEditionPartImpl.this, DatabaseViewsRepository.DataBase_.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
}
});
name.addKeyListener(new KeyAdapter() {
/**
* {@inheritDoc}
*
* @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(DataBasePropertiesEditionPartImpl.this, DatabaseViewsRepository.DataBase_.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
}
}
});
EditingUtils.setID(name, DatabaseViewsRepository.DataBase_.Properties.name);
// $NON-NLS-1$
EditingUtils.setEEFtype(name, "eef::Text");
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.DataBase_.Properties.name, DatabaseViewsRepository.SWT_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 ColumnPropertiesEditionPartForm method createPrecisionText.
protected Composite createPrecisionText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, DatabaseMessages.ColumnPropertiesEditionPart_PrecisionLabel);
// $NON-NLS-1$
precision = widgetFactory.createText(parent, "");
precision.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData precisionData = new GridData(GridData.FILL_HORIZONTAL);
precision.setLayoutData(precisionData);
precision.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, precision.getText()));
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, precision.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(ColumnPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
}
}
});
precision.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, precision.getText()));
}
}
});
EditingUtils.setID(precision, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision);
// $NON-NLS-1$
EditingUtils.setEEFtype(precision, "eef::Text");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, 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 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.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class ColumnPropertiesEditionPartForm method createLengthText.
protected Composite createLengthText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, DatabaseMessages.ColumnPropertiesEditionPart_LengthLabel);
// $NON-NLS-1$
length = widgetFactory.createText(parent, "");
length.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData lengthData = new GridData(GridData.FILL_HORIZONTAL);
length.setLayoutData(lengthData);
length.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, length.getText()));
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, length.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(ColumnPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
}
}
});
length.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, length.getText()));
}
}
});
EditingUtils.setID(length, DatabaseViewsRepository.Column.Properties.TypeAttributes.length);
// $NON-NLS-1$
EditingUtils.setEEFtype(length, "eef::Text");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.TypeAttributes.length, 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 ColumnPropertiesEditionPartForm method createDefaultValueText.
protected Composite createDefaultValueText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Column.Properties.defaultValue, DatabaseMessages.ColumnPropertiesEditionPart_DefaultValueLabel);
// $NON-NLS-1$
defaultValue = widgetFactory.createText(parent, "");
defaultValue.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData defaultValueData = new GridData(GridData.FILL_HORIZONTAL);
defaultValue.setLayoutData(defaultValueData);
defaultValue.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.defaultValue, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, defaultValue.getText()));
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.defaultValue, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, defaultValue.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(ColumnPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
}
}
});
defaultValue.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.defaultValue, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, defaultValue.getText()));
}
}
});
EditingUtils.setID(defaultValue, DatabaseViewsRepository.Column.Properties.defaultValue);
// $NON-NLS-1$
EditingUtils.setEEFtype(defaultValue, "eef::Text");
// $NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.defaultValue, DatabaseViewsRepository.FORM_KIND), null);
// End of user code
return parent;
}
Aggregations