/**
* Generated with Acceleo
*/
package org.obeonetwork.dsl.database.parts.forms;
// Start of user code for imports
import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
import org.eclipse.emf.eef.runtime.part.impl.SectionPropertiesEditingPart;
import org.eclipse.emf.eef.runtime.ui.parts.PartComposer;
import org.eclipse.emf.eef.runtime.ui.parts.sequence.BindingCompositionSequence;
import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionSequence;
import org.eclipse.emf.eef.runtime.ui.parts.sequence.CompositionStep;
import org.eclipse.emf.eef.runtime.ui.utils.EditingUtils;
import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
import org.eclipse.emf.eef.runtime.ui.widgets.HorizontalBox;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.obeonetwork.dsl.database.parts.DatabaseViewsRepository;
import org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart;
import org.obeonetwork.dsl.database.providers.DatabaseMessages;
// End of user code
/**
*
*
*/
public class SequencePropertiesEditionPartForm extends SectionPropertiesEditingPart implements IFormPropertiesEditionPart, SequencePropertiesEditionPart {
protected Text name;
protected Text start;
protected Text increment;
protected Text minValue;
protected Text maxValue;
protected Text comments;
/**
* For {@link ISection} use only.
*/
public SequencePropertiesEditionPartForm() { super(); }
/**
* Default constructor
* @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
*
*/
public SequencePropertiesEditionPartForm(IPropertiesEditionComponent editionComponent) {
super(editionComponent);
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
* createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
*
*/
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
view = form.getBody();
GridLayout layout = new GridLayout();
layout.numColumns = 3;
view.setLayout(layout);
createControls(widgetFactory, view);
return scrolledForm;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
* createControls(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite)
*
*/
public void createControls(final FormToolkit widgetFactory, Composite view) {
CompositionSequence sequenceStep = new BindingCompositionSequence(propertiesEditionComponent);
CompositionStep propertiesStep = sequenceStep.addStep(DatabaseViewsRepository.Sequence.Properties.class);
propertiesStep.addStep(DatabaseViewsRepository.Sequence.Properties.name);
CompositionStep startIncrementStep = propertiesStep.addStep(DatabaseViewsRepository.Sequence.Properties.StartIncrement.class);
startIncrementStep.addStep(DatabaseViewsRepository.Sequence.Properties.StartIncrement.start);
startIncrementStep.addStep(DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment);
CompositionStep minMaxStep = propertiesStep.addStep(DatabaseViewsRepository.Sequence.Properties.MinMax.class);
minMaxStep.addStep(DatabaseViewsRepository.Sequence.Properties.MinMax.minValue);
minMaxStep.addStep(DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue);
propertiesStep.addStep(DatabaseViewsRepository.Sequence.Properties.comments);
composer = new PartComposer(sequenceStep) {
@Override
public Composite addToPart(Composite parent, Object key) {
if (key == DatabaseViewsRepository.Sequence.Properties.class) {
return createPropertiesGroup(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.name) {
return createNameText(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.StartIncrement.class) {
return createStartIncrementHBox(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.StartIncrement.start) {
return createStartText(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment) {
return createIncrementText(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.MinMax.class) {
return createMinMaxHBox(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.MinMax.minValue) {
return createMinValueText(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue) {
return createMaxValueText(widgetFactory, parent);
}
if (key == DatabaseViewsRepository.Sequence.Properties.comments) {
return createCommentsTextarea(widgetFactory, parent);
}
return parent;
}
};
composer.compose(view);
}
/**
*
*/
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
propertiesSection.setText(DatabaseMessages.SequencePropertiesEditionPart_PropertiesGroupLabel);
GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
propertiesSectionData.horizontalSpan = 3;
propertiesSection.setLayoutData(propertiesSectionData);
Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
GridLayout propertiesGroupLayout = new GridLayout();
propertiesGroupLayout.numColumns = 3;
propertiesGroup.setLayout(propertiesGroupLayout);
propertiesSection.setClient(propertiesGroup);
return propertiesGroup;
}
protected Composite createNameText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Sequence.Properties.name, DatabaseMessages.SequencePropertiesEditionPart_NameLabel);
name = widgetFactory.createText(parent, ""); //$NON-NLS-1$
name.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData nameData = new GridData(GridData.FILL_HORIZONTAL);
name.setLayoutData(nameData);
name.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(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.name,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.name,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, name.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(
SequencePropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
name.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(SequencePropertiesEditionPartForm.this, DatabaseViewsRepository.Sequence.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
}
}
});
EditingUtils.setID(name, DatabaseViewsRepository.Sequence.Properties.name);
EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.name, DatabaseViewsRepository.FORM_KIND), null); //$NON-NLS-1$
return parent;
}
/**
*
*/
protected Composite createStartIncrementHBox(FormToolkit widgetFactory, Composite parent) {
Composite container = widgetFactory.createComposite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
container.setLayout(layout);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan=3;
container.setLayoutData(gridData);
HorizontalBox startIncrementHBox = new HorizontalBox(container);
widgetFactory.adapt(startIncrementHBox);
return startIncrementHBox;
}
protected Composite createStartText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Sequence.Properties.StartIncrement.start, DatabaseMessages.SequencePropertiesEditionPart_StartLabel);
start = widgetFactory.createText(parent, ""); //$NON-NLS-1$
start.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData startData = new GridData(GridData.FILL_HORIZONTAL);
start.setLayoutData(startData);
start.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(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.StartIncrement.start,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, start.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.StartIncrement.start,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, start.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(
SequencePropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
start.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(SequencePropertiesEditionPartForm.this, DatabaseViewsRepository.Sequence.Properties.StartIncrement.start, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, start.getText()));
}
}
});
EditingUtils.setID(start, DatabaseViewsRepository.Sequence.Properties.StartIncrement.start);
EditingUtils.setEEFtype(start, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.StartIncrement.start, DatabaseViewsRepository.FORM_KIND), null); //$NON-NLS-1$
return parent;
}
protected Composite createIncrementText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment, DatabaseMessages.SequencePropertiesEditionPart_IncrementLabel);
increment = widgetFactory.createText(parent, ""); //$NON-NLS-1$
increment.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData incrementData = new GridData(GridData.FILL_HORIZONTAL);
increment.setLayoutData(incrementData);
increment.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(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, increment.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, increment.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(
SequencePropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
increment.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(SequencePropertiesEditionPartForm.this, DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, increment.getText()));
}
}
});
EditingUtils.setID(increment, DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment);
EditingUtils.setEEFtype(increment, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.StartIncrement.increment, DatabaseViewsRepository.FORM_KIND), null); //$NON-NLS-1$
return parent;
}
/**
*
*/
protected Composite createMinMaxHBox(FormToolkit widgetFactory, Composite parent) {
Composite container = widgetFactory.createComposite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
container.setLayout(layout);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan=3;
container.setLayoutData(gridData);
HorizontalBox minMaxHBox = new HorizontalBox(container);
widgetFactory.adapt(minMaxHBox);
return minMaxHBox;
}
protected Composite createMinValueText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Sequence.Properties.MinMax.minValue, DatabaseMessages.SequencePropertiesEditionPart_MinValueLabel);
minValue = widgetFactory.createText(parent, ""); //$NON-NLS-1$
minValue.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData minValueData = new GridData(GridData.FILL_HORIZONTAL);
minValue.setLayoutData(minValueData);
minValue.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(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.MinMax.minValue,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, minValue.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.MinMax.minValue,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, minValue.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(
SequencePropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
minValue.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(SequencePropertiesEditionPartForm.this, DatabaseViewsRepository.Sequence.Properties.MinMax.minValue, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, minValue.getText()));
}
}
});
EditingUtils.setID(minValue, DatabaseViewsRepository.Sequence.Properties.MinMax.minValue);
EditingUtils.setEEFtype(minValue, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.MinMax.minValue, DatabaseViewsRepository.FORM_KIND), null); //$NON-NLS-1$
return parent;
}
protected Composite createMaxValueText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue, DatabaseMessages.SequencePropertiesEditionPart_MaxValueLabel);
maxValue = widgetFactory.createText(parent, ""); //$NON-NLS-1$
maxValue.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData maxValueData = new GridData(GridData.FILL_HORIZONTAL);
maxValue.setLayoutData(maxValueData);
maxValue.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(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, maxValue.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, maxValue.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(
SequencePropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
maxValue.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(SequencePropertiesEditionPartForm.this, DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, maxValue.getText()));
}
}
});
EditingUtils.setID(maxValue, DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue);
EditingUtils.setEEFtype(maxValue, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.MinMax.maxValue, DatabaseViewsRepository.FORM_KIND), null); //$NON-NLS-1$
return parent;
}
protected Composite createCommentsTextarea(FormToolkit widgetFactory, Composite parent) {
Label commentsLabel = createDescription(parent, DatabaseViewsRepository.Sequence.Properties.comments, DatabaseMessages.SequencePropertiesEditionPart_CommentsLabel);
GridData commentsLabelData = new GridData(GridData.FILL_HORIZONTAL);
commentsLabelData.horizontalSpan = 3;
commentsLabel.setLayoutData(commentsLabelData);
comments = widgetFactory.createText(parent, "", SWT.BORDER | SWT.WRAP | SWT.MULTI | SWT.V_SCROLL); //$NON-NLS-1$
GridData commentsData = new GridData(GridData.FILL_HORIZONTAL);
commentsData.horizontalSpan = 2;
commentsData.heightHint = 80;
commentsData.widthHint = 200;
comments.setLayoutData(commentsData);
comments.addFocusListener(new FocusAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
*
*/
public void focusLost(FocusEvent e) {
if (propertiesEditionComponent != null) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.comments,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, comments.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
SequencePropertiesEditionPartForm.this,
DatabaseViewsRepository.Sequence.Properties.comments,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, comments.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(
SequencePropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
EditingUtils.setID(comments, DatabaseViewsRepository.Sequence.Properties.comments);
EditingUtils.setEEFtype(comments, "eef::Textarea"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.comments, DatabaseViewsRepository.FORM_KIND), null); //$NON-NLS-1$
return parent;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionListener#firePropertiesChanged(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*
*/
public void firePropertiesChanged(IPropertiesEditionEvent event) {
// Start of user code for tab synchronization
// End of user code
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#getName()
*
*/
public String getName() {
return name.getText();
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#setName(String newValue)
*
*/
public void setName(String newValue) {
if (newValue != null) {
name.setText(newValue);
} else {
name.setText(""); //$NON-NLS-1$
}
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#getStart()
*
*/
public String getStart() {
return start.getText();
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#setStart(String newValue)
*
*/
public void setStart(String newValue) {
if (newValue != null) {
start.setText(newValue);
} else {
start.setText(""); //$NON-NLS-1$
}
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#getIncrement()
*
*/
public String getIncrement() {
return increment.getText();
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#setIncrement(String newValue)
*
*/
public void setIncrement(String newValue) {
if (newValue != null) {
increment.setText(newValue);
} else {
increment.setText(""); //$NON-NLS-1$
}
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#getMinValue()
*
*/
public String getMinValue() {
return minValue.getText();
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#setMinValue(String newValue)
*
*/
public void setMinValue(String newValue) {
if (newValue != null) {
minValue.setText(newValue);
} else {
minValue.setText(""); //$NON-NLS-1$
}
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#getMaxValue()
*
*/
public String getMaxValue() {
return maxValue.getText();
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#setMaxValue(String newValue)
*
*/
public void setMaxValue(String newValue) {
if (newValue != null) {
maxValue.setText(newValue);
} else {
maxValue.setText(""); //$NON-NLS-1$
}
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#getComments()
*
*/
public String getComments() {
return comments.getText();
}
/**
* {@inheritDoc}
*
* @see org.obeonetwork.dsl.database.parts.SequencePropertiesEditionPart#setComments(String newValue)
*
*/
public void setComments(String newValue) {
if (newValue != null) {
comments.setText(newValue);
} else {
comments.setText(""); //$NON-NLS-1$
}
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle()
*
*/
public String getTitle() {
return DatabaseMessages.Sequence_Part_Title;
}
// Start of user code additional methods
// End of user code
}