| /******************************************************************************* |
| * Copyright (c) 2016 Fundación Tecnalia Research & Innovation. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Huascar Espinoza - initial API and implementation |
| * Alejandra Ruíz - initial API and implementation |
| * Idoya Del Río - initial API and implementation |
| * Mari Carmen Palacios - initial API and implementation |
| * Angel López - initial API and implementation |
| *******************************************************************************/ |
| /** |
| * Generated with Acceleo |
| */ |
| package org.eclipse.opencert.pkm.refframework.refframework.parts.forms; |
| |
| // Start of user code for imports |
| import java.util.ArrayList;
|
| import java.util.List;
|
|
|
| import org.eclipse.emf.ecore.EObject;
|
|
|
| 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.ReferencesTable;
|
|
|
| import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener;
|
|
|
| import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableContentProvider;
|
| import org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings;
|
|
|
| import org.eclipse.jface.viewers.ViewerFilter;
|
|
|
| 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.events.SelectionAdapter;
|
| import org.eclipse.swt.events.SelectionEvent;
|
|
|
| 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.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart;
|
| import org.eclipse.opencert.pkm.refframework.refframework.parts.RefframeworkViewsRepository;
|
|
|
| import org.eclipse.opencert.pkm.refframework.refframework.providers.RefframeworkMessages; |
| |
| // End of user code |
| |
| /** |
| * |
| * |
| */ |
| public class RefRequirementPropertiesEditionPartForm extends SectionPropertiesEditingPart implements IFormPropertiesEditionPart, RefRequirementPropertiesEditionPart { |
| |
| protected Text id; |
| protected Text name; |
| protected Text description; |
| protected Text reference; |
| protected Text assumptions; |
| protected Text rationale; |
| protected Text image; |
| protected Text annotations; |
| protected ReferencesTable ownedRel; |
| protected List<ViewerFilter> ownedRelBusinessFilters = new ArrayList<ViewerFilter>(); |
| protected List<ViewerFilter> ownedRelFilters = new ArrayList<ViewerFilter>(); |
| protected ReferencesTable subRequirement; |
| protected List<ViewerFilter> subRequirementBusinessFilters = new ArrayList<ViewerFilter>(); |
| protected List<ViewerFilter> subRequirementFilters = new ArrayList<ViewerFilter>(); |
| |
| |
| |
| /** |
| * For {@link ISection} use only. |
| */ |
| public RefRequirementPropertiesEditionPartForm() { super(); } |
| |
| /** |
| * Default constructor |
| * @param editionComponent the {@link IPropertiesEditionComponent} that manage this part |
| * |
| */ |
| public RefRequirementPropertiesEditionPartForm(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 refRequirementStep = new BindingCompositionSequence(propertiesEditionComponent); |
| CompositionStep propertiesStep = refRequirementStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.class); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.id); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.name); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.description); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.reference); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.assumptions); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.rationale); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.image); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.annotations); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.ownedRel); |
| propertiesStep.addStep(RefframeworkViewsRepository.RefRequirement.Properties.subRequirement); |
| |
| |
| composer = new PartComposer(refRequirementStep) { |
| |
| @Override |
| public Composite addToPart(Composite parent, Object key) { |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.class) { |
| return createPropertiesGroup(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.id) { |
| return createIdText(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.name) { |
| return createNameText(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.description) { |
| return createDescriptionTextarea(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.reference) { |
| return createReferenceText(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.assumptions) { |
| return createAssumptionsText(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.rationale) { |
| return createRationaleText(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.image) { |
| return createImageText(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.annotations) { |
| return createAnnotationsText(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.ownedRel) { |
| return createOwnedRelTableComposition(widgetFactory, parent); |
| } |
| if (key == RefframeworkViewsRepository.RefRequirement.Properties.subRequirement) { |
| return createSubRequirementTableComposition(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(RefframeworkMessages.RefRequirementPropertiesEditionPart_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 createIdText(FormToolkit widgetFactory, Composite parent) { |
| createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.id, RefframeworkMessages.RefRequirementPropertiesEditionPart_IdLabel); |
| id = widgetFactory.createText(parent, ""); //$NON-NLS-1$ |
| id.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
| widgetFactory.paintBordersFor(parent); |
| GridData idData = new GridData(GridData.FILL_HORIZONTAL); |
| id.setLayoutData(idData); |
| id.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.id, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, id.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.id, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, |
| null, id.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| null, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, |
| null, null)); |
| } |
| } |
| }); |
| id.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(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.id, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, id.getText())); |
| } |
| } |
| }); |
| EditingUtils.setID(id, RefframeworkViewsRepository.RefRequirement.Properties.id); |
| EditingUtils.setEEFtype(id, "eef::Text"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.id, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createIdText |
| |
| // End of user code |
| return parent; |
| } |
| |
| |
| protected Composite createNameText(FormToolkit widgetFactory, Composite parent) { |
| createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.name, RefframeworkMessages.RefRequirementPropertiesEditionPart_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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.name, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.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( |
| RefRequirementPropertiesEditionPartForm.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(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); |
| } |
| } |
| }); |
| EditingUtils.setID(name, RefframeworkViewsRepository.RefRequirement.Properties.name); |
| EditingUtils.setEEFtype(name, "eef::Text"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.name, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createNameText |
| |
| // End of user code |
| return parent; |
| } |
| |
| |
| protected Composite createDescriptionTextarea(FormToolkit widgetFactory, Composite parent) { |
| Label descriptionLabel = createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.description, RefframeworkMessages.RefRequirementPropertiesEditionPart_DescriptionLabel); |
| GridData descriptionLabelData = new GridData(GridData.FILL_HORIZONTAL); |
| descriptionLabelData.horizontalSpan = 3; |
| descriptionLabel.setLayoutData(descriptionLabelData); |
| description = widgetFactory.createText(parent, "", SWT.BORDER | SWT.WRAP | SWT.MULTI | SWT.V_SCROLL); //$NON-NLS-1$ |
| GridData descriptionData = new GridData(GridData.FILL_HORIZONTAL); |
| descriptionData.horizontalSpan = 2; |
| descriptionData.heightHint = 80; |
| descriptionData.widthHint = 200; |
| description.setLayoutData(descriptionData); |
| description.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.description, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.description, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, |
| null, description.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| null, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, |
| null, null)); |
| } |
| } |
| }); |
| EditingUtils.setID(description, RefframeworkViewsRepository.RefRequirement.Properties.description); |
| EditingUtils.setEEFtype(description, "eef::Textarea"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.description, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createDescriptionTextArea |
| |
| // End of user code |
| return parent; |
| } |
| |
| |
| protected Composite createReferenceText(FormToolkit widgetFactory, Composite parent) { |
| createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.reference, RefframeworkMessages.RefRequirementPropertiesEditionPart_ReferenceLabel); |
| reference = widgetFactory.createText(parent, ""); //$NON-NLS-1$ |
| reference.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
| widgetFactory.paintBordersFor(parent); |
| GridData referenceData = new GridData(GridData.FILL_HORIZONTAL); |
| reference.setLayoutData(referenceData); |
| reference.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.reference, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, reference.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.reference, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, |
| null, reference.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| null, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, |
| null, null)); |
| } |
| } |
| }); |
| reference.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(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.reference, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, reference.getText())); |
| } |
| } |
| }); |
| EditingUtils.setID(reference, RefframeworkViewsRepository.RefRequirement.Properties.reference); |
| EditingUtils.setEEFtype(reference, "eef::Text"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.reference, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createReferenceText |
| |
| // End of user code |
| return parent; |
| } |
| |
| |
| protected Composite createAssumptionsText(FormToolkit widgetFactory, Composite parent) { |
| createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.assumptions, RefframeworkMessages.RefRequirementPropertiesEditionPart_AssumptionsLabel); |
| assumptions = widgetFactory.createText(parent, ""); //$NON-NLS-1$ |
| assumptions.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
| widgetFactory.paintBordersFor(parent); |
| GridData assumptionsData = new GridData(GridData.FILL_HORIZONTAL); |
| assumptions.setLayoutData(assumptionsData); |
| assumptions.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.assumptions, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, assumptions.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.assumptions, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, |
| null, assumptions.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| null, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, |
| null, null)); |
| } |
| } |
| }); |
| assumptions.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(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.assumptions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, assumptions.getText())); |
| } |
| } |
| }); |
| EditingUtils.setID(assumptions, RefframeworkViewsRepository.RefRequirement.Properties.assumptions); |
| EditingUtils.setEEFtype(assumptions, "eef::Text"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.assumptions, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createAssumptionsText |
| |
| // End of user code |
| return parent; |
| } |
| |
| |
| protected Composite createRationaleText(FormToolkit widgetFactory, Composite parent) { |
| createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.rationale, RefframeworkMessages.RefRequirementPropertiesEditionPart_RationaleLabel); |
| rationale = widgetFactory.createText(parent, ""); //$NON-NLS-1$ |
| rationale.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
| widgetFactory.paintBordersFor(parent); |
| GridData rationaleData = new GridData(GridData.FILL_HORIZONTAL); |
| rationale.setLayoutData(rationaleData); |
| rationale.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.rationale, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, rationale.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.rationale, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, |
| null, rationale.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| null, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, |
| null, null)); |
| } |
| } |
| }); |
| rationale.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(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.rationale, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, rationale.getText())); |
| } |
| } |
| }); |
| EditingUtils.setID(rationale, RefframeworkViewsRepository.RefRequirement.Properties.rationale); |
| EditingUtils.setEEFtype(rationale, "eef::Text"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.rationale, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createRationaleText |
| |
| // End of user code |
| return parent; |
| } |
| |
| |
| protected Composite createImageText(FormToolkit widgetFactory, Composite parent) { |
| createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.image, RefframeworkMessages.RefRequirementPropertiesEditionPart_ImageLabel); |
| image = widgetFactory.createText(parent, ""); //$NON-NLS-1$ |
| image.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
| widgetFactory.paintBordersFor(parent); |
| GridData imageData = new GridData(GridData.FILL_HORIZONTAL); |
| image.setLayoutData(imageData); |
| image.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.image, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, image.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.image, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, |
| null, image.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| null, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, |
| null, null)); |
| } |
| } |
| }); |
| image.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(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.image, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, image.getText())); |
| } |
| } |
| }); |
| EditingUtils.setID(image, RefframeworkViewsRepository.RefRequirement.Properties.image); |
| EditingUtils.setEEFtype(image, "eef::Text"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.image, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createImageText |
| |
| // End of user code |
| return parent; |
| } |
| |
| |
| protected Composite createAnnotationsText(FormToolkit widgetFactory, Composite parent) { |
| createDescription(parent, RefframeworkViewsRepository.RefRequirement.Properties.annotations, RefframeworkMessages.RefRequirementPropertiesEditionPart_AnnotationsLabel); |
| annotations = widgetFactory.createText(parent, ""); //$NON-NLS-1$ |
| annotations.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); |
| widgetFactory.paintBordersFor(parent); |
| GridData annotationsData = new GridData(GridData.FILL_HORIZONTAL); |
| annotations.setLayoutData(annotationsData); |
| annotations.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.annotations, |
| PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, annotations.getText())); |
| propertiesEditionComponent |
| .firePropertiesChanged(new PropertiesEditionEvent( |
| RefRequirementPropertiesEditionPartForm.this, |
| RefframeworkViewsRepository.RefRequirement.Properties.annotations, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, |
| null, annotations.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( |
| RefRequirementPropertiesEditionPartForm.this, |
| null, |
| PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, |
| null, null)); |
| } |
| } |
| }); |
| annotations.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(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.annotations, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, annotations.getText())); |
| } |
| } |
| }); |
| EditingUtils.setID(annotations, RefframeworkViewsRepository.RefRequirement.Properties.annotations); |
| EditingUtils.setEEFtype(annotations, "eef::Text"); //$NON-NLS-1$ |
| FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.annotations, RefframeworkViewsRepository.FORM_KIND), null); //$NON-NLS-1$ |
| // Start of user code for createAnnotationsText |
| |
| // End of user code |
| return parent; |
| } |
| |
| /** |
| * @param container |
| * |
| */ |
| protected Composite createOwnedRelTableComposition(FormToolkit widgetFactory, Composite parent) { |
| this.ownedRel = new ReferencesTable(getDescription(RefframeworkViewsRepository.RefRequirement.Properties.ownedRel, RefframeworkMessages.RefRequirementPropertiesEditionPart_OwnedRelLabel), new ReferencesTableListener() { |
| public void handleAdd() { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.ownedRel, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null)); |
| ownedRel.refresh(); |
| } |
| public void handleEdit(EObject element) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.ownedRel, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element)); |
| ownedRel.refresh(); |
| } |
| public void handleMove(EObject element, int oldIndex, int newIndex) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.ownedRel, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex)); |
| ownedRel.refresh(); |
| } |
| public void handleRemove(EObject element) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.ownedRel, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element)); |
| ownedRel.refresh(); |
| } |
| public void navigateTo(EObject element) { } |
| }); |
| for (ViewerFilter filter : this.ownedRelFilters) { |
| this.ownedRel.addFilter(filter); |
| } |
| this.ownedRel.setHelpText(propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.ownedRel, RefframeworkViewsRepository.FORM_KIND)); |
| this.ownedRel.createControls(parent, widgetFactory); |
| this.ownedRel.addSelectionListener(new SelectionAdapter() { |
| |
| public void widgetSelected(SelectionEvent e) { |
| if (e.item != null && e.item.getData() instanceof EObject) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.ownedRel, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); |
| } |
| } |
| |
| }); |
| GridData ownedRelData = new GridData(GridData.FILL_HORIZONTAL); |
| ownedRelData.horizontalSpan = 3; |
| this.ownedRel.setLayoutData(ownedRelData); |
| this.ownedRel.setLowerBound(0); |
| this.ownedRel.setUpperBound(-1); |
| ownedRel.setID(RefframeworkViewsRepository.RefRequirement.Properties.ownedRel); |
| ownedRel.setEEFType("eef::AdvancedTableComposition"); //$NON-NLS-1$ |
| // Start of user code for createOwnedRelTableComposition |
| |
| // End of user code |
| return parent; |
| } |
| |
| /** |
| * @param container |
| * |
| */ |
| protected Composite createSubRequirementTableComposition(FormToolkit widgetFactory, Composite parent) { |
| this.subRequirement = new ReferencesTable(getDescription(RefframeworkViewsRepository.RefRequirement.Properties.subRequirement, RefframeworkMessages.RefRequirementPropertiesEditionPart_SubRequirementLabel), new ReferencesTableListener() { |
| public void handleAdd() { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.subRequirement, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null)); |
| subRequirement.refresh(); |
| } |
| public void handleEdit(EObject element) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.subRequirement, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element)); |
| subRequirement.refresh(); |
| } |
| public void handleMove(EObject element, int oldIndex, int newIndex) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.subRequirement, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex)); |
| subRequirement.refresh(); |
| } |
| public void handleRemove(EObject element) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.subRequirement, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element)); |
| subRequirement.refresh(); |
| } |
| public void navigateTo(EObject element) { } |
| }); |
| for (ViewerFilter filter : this.subRequirementFilters) { |
| this.subRequirement.addFilter(filter); |
| } |
| this.subRequirement.setHelpText(propertiesEditionComponent.getHelpContent(RefframeworkViewsRepository.RefRequirement.Properties.subRequirement, RefframeworkViewsRepository.FORM_KIND)); |
| this.subRequirement.createControls(parent, widgetFactory); |
| this.subRequirement.addSelectionListener(new SelectionAdapter() { |
| |
| public void widgetSelected(SelectionEvent e) { |
| if (e.item != null && e.item.getData() instanceof EObject) { |
| propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RefRequirementPropertiesEditionPartForm.this, RefframeworkViewsRepository.RefRequirement.Properties.subRequirement, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); |
| } |
| } |
| |
| }); |
| GridData subRequirementData = new GridData(GridData.FILL_HORIZONTAL); |
| subRequirementData.horizontalSpan = 3; |
| this.subRequirement.setLayoutData(subRequirementData); |
| this.subRequirement.setLowerBound(0); |
| this.subRequirement.setUpperBound(-1); |
| subRequirement.setID(RefframeworkViewsRepository.RefRequirement.Properties.subRequirement); |
| subRequirement.setEEFType("eef::AdvancedTableComposition"); //$NON-NLS-1$ |
| // Start of user code for createSubRequirementTableComposition |
| |
| // 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 org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getId() |
| * |
| */ |
| public String getId() { |
| return id.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setId(String newValue) |
| * |
| */ |
| public void setId(String newValue) { |
| if (newValue != null) { |
| id.setText(newValue); |
| } else { |
| id.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.id); |
| if (eefElementEditorReadOnlyState && id.isEnabled()) { |
| id.setEnabled(false); |
| id.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !id.isEnabled()) { |
| id.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getName() |
| * |
| */ |
| public String getName() { |
| return name.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setName(String newValue) |
| * |
| */ |
| public void setName(String newValue) { |
| if (newValue != null) { |
| name.setText(newValue); |
| } else { |
| name.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.name); |
| if (eefElementEditorReadOnlyState && name.isEnabled()) { |
| name.setEnabled(false); |
| name.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !name.isEnabled()) { |
| name.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getDescription() |
| * |
| */ |
| public String getDescription() { |
| return description.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setDescription(String newValue) |
| * |
| */ |
| public void setDescription(String newValue) { |
| if (newValue != null) { |
| description.setText(newValue); |
| } else { |
| description.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.description); |
| if (eefElementEditorReadOnlyState && description.isEnabled()) { |
| description.setEnabled(false); |
| description.setBackground(description.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); |
| description.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !description.isEnabled()) { |
| description.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getReference() |
| * |
| */ |
| public String getReference() { |
| return reference.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setReference(String newValue) |
| * |
| */ |
| public void setReference(String newValue) { |
| if (newValue != null) { |
| reference.setText(newValue); |
| } else { |
| reference.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.reference); |
| if (eefElementEditorReadOnlyState && reference.isEnabled()) { |
| reference.setEnabled(false); |
| reference.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !reference.isEnabled()) { |
| reference.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getAssumptions() |
| * |
| */ |
| public String getAssumptions() { |
| return assumptions.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setAssumptions(String newValue) |
| * |
| */ |
| public void setAssumptions(String newValue) { |
| if (newValue != null) { |
| assumptions.setText(newValue); |
| } else { |
| assumptions.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.assumptions); |
| if (eefElementEditorReadOnlyState && assumptions.isEnabled()) { |
| assumptions.setEnabled(false); |
| assumptions.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !assumptions.isEnabled()) { |
| assumptions.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getRationale() |
| * |
| */ |
| public String getRationale() { |
| return rationale.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setRationale(String newValue) |
| * |
| */ |
| public void setRationale(String newValue) { |
| if (newValue != null) { |
| rationale.setText(newValue); |
| } else { |
| rationale.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.rationale); |
| if (eefElementEditorReadOnlyState && rationale.isEnabled()) { |
| rationale.setEnabled(false); |
| rationale.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !rationale.isEnabled()) { |
| rationale.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getImage() |
| * |
| */ |
| public String getImage() { |
| return image.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setImage(String newValue) |
| * |
| */ |
| public void setImage(String newValue) { |
| if (newValue != null) { |
| image.setText(newValue); |
| } else { |
| image.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.image); |
| if (eefElementEditorReadOnlyState && image.isEnabled()) { |
| image.setEnabled(false); |
| image.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !image.isEnabled()) { |
| image.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#getAnnotations() |
| * |
| */ |
| public String getAnnotations() { |
| return annotations.getText(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#setAnnotations(String newValue) |
| * |
| */ |
| public void setAnnotations(String newValue) { |
| if (newValue != null) { |
| annotations.setText(newValue); |
| } else { |
| annotations.setText(""); //$NON-NLS-1$ |
| } |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.annotations); |
| if (eefElementEditorReadOnlyState && annotations.isEnabled()) { |
| annotations.setEnabled(false); |
| annotations.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !annotations.isEnabled()) { |
| annotations.setEnabled(true); |
| } |
| |
| } |
| |
| |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#initOwnedRel(EObject current, EReference containingFeature, EReference feature) |
| */ |
| public void initOwnedRel(ReferencesTableSettings settings) { |
| if (current.eResource() != null && current.eResource().getResourceSet() != null) |
| this.resourceSet = current.eResource().getResourceSet(); |
| ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider(); |
| ownedRel.setContentProvider(contentProvider); |
| ownedRel.setInput(settings); |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.ownedRel); |
| if (eefElementEditorReadOnlyState && ownedRel.isEnabled()) { |
| ownedRel.setEnabled(false); |
| ownedRel.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !ownedRel.isEnabled()) { |
| ownedRel.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#updateOwnedRel() |
| * |
| */ |
| public void updateOwnedRel() { |
| ownedRel.refresh(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#addFilterOwnedRel(ViewerFilter filter) |
| * |
| */ |
| public void addFilterToOwnedRel(ViewerFilter filter) { |
| ownedRelFilters.add(filter); |
| if (this.ownedRel != null) { |
| this.ownedRel.addFilter(filter); |
| } |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#addBusinessFilterOwnedRel(ViewerFilter filter) |
| * |
| */ |
| public void addBusinessFilterToOwnedRel(ViewerFilter filter) { |
| ownedRelBusinessFilters.add(filter); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#isContainedInOwnedRelTable(EObject element) |
| * |
| */ |
| public boolean isContainedInOwnedRelTable(EObject element) { |
| return ((ReferencesTableSettings)ownedRel.getInput()).contains(element); |
| } |
| |
| |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#initSubRequirement(EObject current, EReference containingFeature, EReference feature) |
| */ |
| public void initSubRequirement(ReferencesTableSettings settings) { |
| if (current.eResource() != null && current.eResource().getResourceSet() != null) |
| this.resourceSet = current.eResource().getResourceSet(); |
| ReferencesTableContentProvider contentProvider = new ReferencesTableContentProvider(); |
| subRequirement.setContentProvider(contentProvider); |
| subRequirement.setInput(settings); |
| boolean eefElementEditorReadOnlyState = isReadOnly(RefframeworkViewsRepository.RefRequirement.Properties.subRequirement); |
| if (eefElementEditorReadOnlyState && subRequirement.isEnabled()) { |
| subRequirement.setEnabled(false); |
| subRequirement.setToolTipText(RefframeworkMessages.RefRequirement_ReadOnly); |
| } else if (!eefElementEditorReadOnlyState && !subRequirement.isEnabled()) { |
| subRequirement.setEnabled(true); |
| } |
| |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#updateSubRequirement() |
| * |
| */ |
| public void updateSubRequirement() { |
| subRequirement.refresh(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#addFilterSubRequirement(ViewerFilter filter) |
| * |
| */ |
| public void addFilterToSubRequirement(ViewerFilter filter) { |
| subRequirementFilters.add(filter); |
| if (this.subRequirement != null) { |
| this.subRequirement.addFilter(filter); |
| } |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#addBusinessFilterSubRequirement(ViewerFilter filter) |
| * |
| */ |
| public void addBusinessFilterToSubRequirement(ViewerFilter filter) { |
| subRequirementBusinessFilters.add(filter); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.opencert.pkm.refframework.refframework.parts.RefRequirementPropertiesEditionPart#isContainedInSubRequirementTable(EObject element) |
| * |
| */ |
| public boolean isContainedInSubRequirementTable(EObject element) { |
| return ((ReferencesTableSettings)subRequirement.getInput()).contains(element); |
| } |
| |
| |
| |
| |
| |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart#getTitle() |
| * |
| */ |
| public String getTitle() { |
| return RefframeworkMessages.RefRequirement_Part_Title; |
| } |
| |
| // Start of user code additional methods |
| |
| // End of user code |
| |
| |
| } |