/**
* Generated with Acceleo
*/
package net.certware.measurement.sco.parts.forms;
import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.emf.eef.runtime.EEFRuntimePlugin;
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.EMFComboViewer;
import org.eclipse.emf.eef.runtime.ui.widgets.FormUtils;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
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.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.eclipse.ui.views.properties.tabbed.ISection;
// Start of user code for imports
import net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart;
import net.certware.measurement.sco.parts.ScoViewsRepository;
import net.certware.measurement.sco.providers.ScoMessages;
// End of user code
/**
*
*
*/
public class NormalDefectChangeOrdersPropertiesEditionPartForm extends SectionPropertiesEditingPart implements IFormPropertiesEditionPart, NormalDefectChangeOrdersPropertiesEditionPart {
protected Text name;
protected Text value;
protected EMFComboViewer type;
protected Text brokenLines;
protected Text fixedLines;
protected Text repairEffort;
/**
* For {@link ISection} use only.
*/
public NormalDefectChangeOrdersPropertiesEditionPartForm() { super(); }
/**
* Default constructor
* @param editionComponent the {@link IPropertiesEditionComponent} that manage this part
*
*/
public NormalDefectChangeOrdersPropertiesEditionPartForm(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 normalDefectChangeOrdersStep = new BindingCompositionSequence(propertiesEditionComponent);
CompositionStep propertiesStep = normalDefectChangeOrdersStep.addStep(ScoViewsRepository.NormalDefectChangeOrders.Properties.class);
propertiesStep.addStep(ScoViewsRepository.NormalDefectChangeOrders.Properties.name);
propertiesStep.addStep(ScoViewsRepository.NormalDefectChangeOrders.Properties.value);
propertiesStep.addStep(ScoViewsRepository.NormalDefectChangeOrders.Properties.type);
propertiesStep.addStep(ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines);
propertiesStep.addStep(ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines);
propertiesStep.addStep(ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort);
composer = new PartComposer(normalDefectChangeOrdersStep) {
@Override
public Composite addToPart(Composite parent, Object key) {
if (key == ScoViewsRepository.NormalDefectChangeOrders.Properties.class) {
return createPropertiesGroup(widgetFactory, parent);
}
if (key == ScoViewsRepository.NormalDefectChangeOrders.Properties.name) {
return createNameText(widgetFactory, parent);
}
if (key == ScoViewsRepository.NormalDefectChangeOrders.Properties.value) {
return createValueText(widgetFactory, parent);
}
if (key == ScoViewsRepository.NormalDefectChangeOrders.Properties.type) {
return createTypeEMFComboViewer(widgetFactory, parent);
}
if (key == ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines) {
return createBrokenLinesText(widgetFactory, parent);
}
if (key == ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines) {
return createFixedLinesText(widgetFactory, parent);
}
if (key == ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort) {
return createRepairEffortText(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(ScoMessages.NormalDefectChangeOrdersPropertiesEditionPart_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, ScoViewsRepository.NormalDefectChangeOrders.Properties.name, ScoMessages.NormalDefectChangeOrdersPropertiesEditionPart_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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.name,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.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(NormalDefectChangeOrdersPropertiesEditionPartForm.this, ScoViewsRepository.NormalDefectChangeOrders.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
}
}
});
EditingUtils.setID(name, ScoViewsRepository.NormalDefectChangeOrders.Properties.name);
EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ScoViewsRepository.NormalDefectChangeOrders.Properties.name, ScoViewsRepository.FORM_KIND), null); //$NON-NLS-1$
// Start of user code for createNameText
// End of user code
return parent;
}
protected Composite createValueText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, ScoViewsRepository.NormalDefectChangeOrders.Properties.value, ScoMessages.NormalDefectChangeOrdersPropertiesEditionPart_ValueLabel);
value = widgetFactory.createText(parent, ""); //$NON-NLS-1$
value.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData valueData = new GridData(GridData.FILL_HORIZONTAL);
value.setLayoutData(valueData);
value.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.value,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, value.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.value,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, value.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
value.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(NormalDefectChangeOrdersPropertiesEditionPartForm.this, ScoViewsRepository.NormalDefectChangeOrders.Properties.value, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, value.getText()));
}
}
});
EditingUtils.setID(value, ScoViewsRepository.NormalDefectChangeOrders.Properties.value);
EditingUtils.setEEFtype(value, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ScoViewsRepository.NormalDefectChangeOrders.Properties.value, ScoViewsRepository.FORM_KIND), null); //$NON-NLS-1$
// Start of user code for createValueText
// End of user code
return parent;
}
protected Composite createTypeEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, ScoViewsRepository.NormalDefectChangeOrders.Properties.type, ScoMessages.NormalDefectChangeOrdersPropertiesEditionPart_TypeLabel);
type = new EMFComboViewer(parent);
type.setContentProvider(new ArrayContentProvider());
type.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
GridData typeData = new GridData(GridData.FILL_HORIZONTAL);
type.getCombo().setLayoutData(typeData);
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(NormalDefectChangeOrdersPropertiesEditionPartForm.this, ScoViewsRepository.NormalDefectChangeOrders.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
}
});
type.setID(ScoViewsRepository.NormalDefectChangeOrders.Properties.type);
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ScoViewsRepository.NormalDefectChangeOrders.Properties.type, ScoViewsRepository.FORM_KIND), null); //$NON-NLS-1$
// Start of user code for createTypeEMFComboViewer
// End of user code
return parent;
}
protected Composite createBrokenLinesText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines, ScoMessages.NormalDefectChangeOrdersPropertiesEditionPart_BrokenLinesLabel);
brokenLines = widgetFactory.createText(parent, ""); //$NON-NLS-1$
brokenLines.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData brokenLinesData = new GridData(GridData.FILL_HORIZONTAL);
brokenLines.setLayoutData(brokenLinesData);
brokenLines.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, brokenLines.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, brokenLines.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
brokenLines.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(NormalDefectChangeOrdersPropertiesEditionPartForm.this, ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, brokenLines.getText()));
}
}
});
EditingUtils.setID(brokenLines, ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines);
EditingUtils.setEEFtype(brokenLines, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines, ScoViewsRepository.FORM_KIND), null); //$NON-NLS-1$
// Start of user code for createBrokenLinesText
// End of user code
return parent;
}
protected Composite createFixedLinesText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines, ScoMessages.NormalDefectChangeOrdersPropertiesEditionPart_FixedLinesLabel);
fixedLines = widgetFactory.createText(parent, ""); //$NON-NLS-1$
fixedLines.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData fixedLinesData = new GridData(GridData.FILL_HORIZONTAL);
fixedLines.setLayoutData(fixedLinesData);
fixedLines.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, fixedLines.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, fixedLines.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
fixedLines.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(NormalDefectChangeOrdersPropertiesEditionPartForm.this, ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, fixedLines.getText()));
}
}
});
EditingUtils.setID(fixedLines, ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines);
EditingUtils.setEEFtype(fixedLines, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines, ScoViewsRepository.FORM_KIND), null); //$NON-NLS-1$
// Start of user code for createFixedLinesText
// End of user code
return parent;
}
protected Composite createRepairEffortText(FormToolkit widgetFactory, Composite parent) {
createDescription(parent, ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort, ScoMessages.NormalDefectChangeOrdersPropertiesEditionPart_RepairEffortLabel);
repairEffort = widgetFactory.createText(parent, ""); //$NON-NLS-1$
repairEffort.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
widgetFactory.paintBordersFor(parent);
GridData repairEffortData = new GridData(GridData.FILL_HORIZONTAL);
repairEffort.setLayoutData(repairEffortData);
repairEffort.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort,
PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, repairEffort.getText()));
propertiesEditionComponent
.firePropertiesChanged(new PropertiesEditionEvent(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST,
null, repairEffort.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(
NormalDefectChangeOrdersPropertiesEditionPartForm.this,
null,
PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED,
null, null));
}
}
});
repairEffort.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(NormalDefectChangeOrdersPropertiesEditionPartForm.this, ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, repairEffort.getText()));
}
}
});
EditingUtils.setID(repairEffort, ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort);
EditingUtils.setEEFtype(repairEffort, "eef::Text"); //$NON-NLS-1$
FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort, ScoViewsRepository.FORM_KIND), null); //$NON-NLS-1$
// Start of user code for createRepairEffortText
// End of user code
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 net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#getName()
*
*/
public String getName() {
return name.getText();
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#setName(String newValue)
*
*/
public void setName(String newValue) {
if (newValue != null) {
name.setText(newValue);
} else {
name.setText(""); //$NON-NLS-1$
}
boolean eefElementEditorReadOnlyState = isReadOnly(ScoViewsRepository.NormalDefectChangeOrders.Properties.name);
if (eefElementEditorReadOnlyState && name.isEnabled()) {
name.setEnabled(false);
name.setToolTipText(ScoMessages.NormalDefectChangeOrders_ReadOnly);
} else if (!eefElementEditorReadOnlyState && !name.isEnabled()) {
name.setEnabled(true);
}
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#getValue()
*
*/
public String getValue() {
return value.getText();
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#setValue(String newValue)
*
*/
public void setValue(String newValue) {
if (newValue != null) {
value.setText(newValue);
} else {
value.setText(""); //$NON-NLS-1$
}
boolean eefElementEditorReadOnlyState = isReadOnly(ScoViewsRepository.NormalDefectChangeOrders.Properties.value);
if (eefElementEditorReadOnlyState && value.isEnabled()) {
value.setEnabled(false);
value.setToolTipText(ScoMessages.NormalDefectChangeOrders_ReadOnly);
} else if (!eefElementEditorReadOnlyState && !value.isEnabled()) {
value.setEnabled(true);
}
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#getType()
*
*/
public Enumerator getType() {
Enumerator selection = (Enumerator) ((StructuredSelection) type.getSelection()).getFirstElement();
return selection;
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#initType(Object input, Enumerator current)
*/
public void initType(Object input, Enumerator current) {
type.setInput(input);
type.modelUpdating(new StructuredSelection(current));
boolean eefElementEditorReadOnlyState = isReadOnly(ScoViewsRepository.NormalDefectChangeOrders.Properties.type);
if (eefElementEditorReadOnlyState && type.isEnabled()) {
type.setEnabled(false);
type.setToolTipText(ScoMessages.NormalDefectChangeOrders_ReadOnly);
} else if (!eefElementEditorReadOnlyState && !type.isEnabled()) {
type.setEnabled(true);
}
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#setType(Enumerator newValue)
*
*/
public void setType(Enumerator newValue) {
type.modelUpdating(new StructuredSelection(newValue));
boolean eefElementEditorReadOnlyState = isReadOnly(ScoViewsRepository.NormalDefectChangeOrders.Properties.type);
if (eefElementEditorReadOnlyState && type.isEnabled()) {
type.setEnabled(false);
type.setToolTipText(ScoMessages.NormalDefectChangeOrders_ReadOnly);
} else if (!eefElementEditorReadOnlyState && !type.isEnabled()) {
type.setEnabled(true);
}
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#getBrokenLines()
*
*/
public String getBrokenLines() {
return brokenLines.getText();
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#setBrokenLines(String newValue)
*
*/
public void setBrokenLines(String newValue) {
if (newValue != null) {
brokenLines.setText(newValue);
} else {
brokenLines.setText(""); //$NON-NLS-1$
}
boolean eefElementEditorReadOnlyState = isReadOnly(ScoViewsRepository.NormalDefectChangeOrders.Properties.brokenLines);
if (eefElementEditorReadOnlyState && brokenLines.isEnabled()) {
brokenLines.setEnabled(false);
brokenLines.setToolTipText(ScoMessages.NormalDefectChangeOrders_ReadOnly);
} else if (!eefElementEditorReadOnlyState && !brokenLines.isEnabled()) {
brokenLines.setEnabled(true);
}
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#getFixedLines()
*
*/
public String getFixedLines() {
return fixedLines.getText();
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#setFixedLines(String newValue)
*
*/
public void setFixedLines(String newValue) {
if (newValue != null) {
fixedLines.setText(newValue);
} else {
fixedLines.setText(""); //$NON-NLS-1$
}
boolean eefElementEditorReadOnlyState = isReadOnly(ScoViewsRepository.NormalDefectChangeOrders.Properties.fixedLines);
if (eefElementEditorReadOnlyState && fixedLines.isEnabled()) {
fixedLines.setEnabled(false);
fixedLines.setToolTipText(ScoMessages.NormalDefectChangeOrders_ReadOnly);
} else if (!eefElementEditorReadOnlyState && !fixedLines.isEnabled()) {
fixedLines.setEnabled(true);
}
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#getRepairEffort()
*
*/
public String getRepairEffort() {
return repairEffort.getText();
}
/**
* {@inheritDoc}
*
* @see net.certware.measurement.sco.parts.NormalDefectChangeOrdersPropertiesEditionPart#setRepairEffort(String newValue)
*
*/
public void setRepairEffort(String newValue) {
if (newValue != null) {
repairEffort.setText(newValue);
} else {
repairEffort.setText(""); //$NON-NLS-1$
}
boolean eefElementEditorReadOnlyState = isReadOnly(ScoViewsRepository.NormalDefectChangeOrders.Properties.repairEffort);
if (eefElementEditorReadOnlyState && repairEffort.isEnabled()) {
repairEffort.setEnabled(false);
repairEffort.setToolTipText(ScoMessages.NormalDefectChangeOrders_ReadOnly);
} else if (!eefElementEditorReadOnlyState && !repairEffort.isEnabled()) {
repairEffort.setEnabled(true);
}
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle()
*
*/
public String getTitle() {
return ScoMessages.NormalDefectChangeOrders_Part_Title;
}
// Start of user code additional methods
// End of user code
}