Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ClassifierTemplateParameterPropertiesEditionPartForm.java')
-rw-r--r--extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ClassifierTemplateParameterPropertiesEditionPartForm.java405
1 files changed, 405 insertions, 0 deletions
diff --git a/extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ClassifierTemplateParameterPropertiesEditionPartForm.java b/extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ClassifierTemplateParameterPropertiesEditionPartForm.java
new file mode 100644
index 00000000000..28455c8f1ea
--- /dev/null
+++ b/extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ClassifierTemplateParameterPropertiesEditionPartForm.java
@@ -0,0 +1,405 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.tabbedproperties.uml.parts.forms;
+
+// Start of user code for imports
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
+import org.eclipse.emf.eef.runtime.api.parts.EEFMessageManager;
+import org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.api.policies.IPropertiesEditionPolicy;
+import org.eclipse.emf.eef.runtime.api.providers.IPropertiesEditionPolicyProvider;
+import org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent;
+import org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart;
+import org.eclipse.emf.eef.runtime.impl.policies.EObjectPropertiesEditionContext;
+import org.eclipse.emf.eef.runtime.impl.services.PropertiesEditionPolicyProviderService;
+import org.eclipse.emf.eef.runtime.impl.utils.EMFListEditUtil;
+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.jface.viewers.ViewerFilter;
+import org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart;
+import org.eclipse.papyrus.tabbedproperties.uml.parts.UMLViewsRepository;
+import org.eclipse.papyrus.tabbedproperties.uml.providers.UMLMessages;
+import org.eclipse.swt.SWT;
+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.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.IMessageManager;
+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.uml2.uml.Comment;
+import org.eclipse.uml2.uml.UMLFactory;
+
+// End of user code
+
+/**
+ * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a>
+ */
+public class ClassifierTemplateParameterPropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, ClassifierTemplateParameterPropertiesEditionPart {
+
+ protected EMFListEditUtil ownedCommentEditUtil;
+
+ protected ReferencesTable<? extends EObject> ownedComment;
+
+ protected List<ViewerFilter> ownedCommentBusinessFilters = new ArrayList<ViewerFilter>();
+
+ protected List<ViewerFilter> ownedCommentFilters = new ArrayList<ViewerFilter>();
+
+ protected Button allowSubstitutable;
+
+
+
+
+
+ /**
+ * Default constructor
+ *
+ * @param editionComponent
+ * the {@link IPropertiesEditionComponent} that manage this part
+ */
+ public ClassifierTemplateParameterPropertiesEditionPartForm(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, new EEFMessageManager(scrolledForm, widgetFactory));
+ return scrolledForm;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart# createControls(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.IMessageManager)
+ */
+ public void createControls(final FormToolkit widgetFactory, Composite view, IMessageManager messageManager) {
+ this.messageManager = messageManager;
+ createPropertiesGroup(widgetFactory, view);
+ // Start of user code for additional ui definition
+
+ // End of user code
+
+ }
+
+ protected void createPropertiesGroup(FormToolkit widgetFactory, final Composite view) {
+ Section propertiesSection = widgetFactory.createSection(view, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
+ propertiesSection.setText(UMLMessages.ClassifierTemplateParameterPropertiesEditionPart_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);
+ createOwnedCommentTableComposition(widgetFactory, propertiesGroup);
+ createAllowSubstitutableCheckbox(widgetFactory, propertiesGroup);
+ propertiesSection.setClient(propertiesGroup);
+ }
+
+ /**
+ * @param container
+ */
+ protected void createOwnedCommentTableComposition(FormToolkit widgetFactory, Composite parent) {
+ this.ownedComment = new ReferencesTable<Comment>(UMLMessages.ClassifierTemplateParameterPropertiesEditionPart_OwnedCommentLabel, new ReferencesTableListener<Comment>() {
+
+ public void handleAdd() {
+ addToOwnedComment();
+ }
+
+ public void handleEdit(Comment element) {
+ editOwnedComment(element);
+ }
+
+ public void handleMove(Comment element, int oldIndex, int newIndex) {
+ moveOwnedComment(element, oldIndex, newIndex);
+ }
+
+ public void handleRemove(Comment element) {
+ removeFromOwnedComment(element);
+ }
+
+ public void navigateTo(Comment element) {
+ }
+ });
+ this.ownedComment.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.ClassifierTemplateParameter.ownedComment, UMLViewsRepository.FORM_KIND));
+ this.ownedComment.createControls(parent, widgetFactory);
+ GridData ownedCommentData = new GridData(GridData.FILL_HORIZONTAL);
+ ownedCommentData.horizontalSpan = 3;
+ this.ownedComment.setLayoutData(ownedCommentData);
+ }
+
+ /**
+ *
+ */
+ protected void moveOwnedComment(Comment element, int oldIndex, int newIndex) {
+ EObject editedElement = ownedCommentEditUtil.foundCorrespondingEObject(element);
+ ownedCommentEditUtil.moveElement(element, oldIndex, newIndex);
+ ownedComment.refresh();
+ propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ClassifierTemplateParameterPropertiesEditionPartForm.this, UMLViewsRepository.ClassifierTemplateParameter.ownedComment, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex));
+ }
+
+ /**
+ *
+ */
+ protected void addToOwnedComment() {
+ // Start of user code addToOwnedComment() method body
+ Comment eObject = UMLFactory.eINSTANCE.createComment();
+ IPropertiesEditionPolicyProvider policyProvider = PropertiesEditionPolicyProviderService.getInstance()
+ .getProvider(eObject);
+ IPropertiesEditionPolicy editionPolicy = policyProvider.getEditionPolicy(eObject);
+ if(editionPolicy != null) {
+ EObject propertiesEditionObject = editionPolicy
+ .getPropertiesEditionObject(new EObjectPropertiesEditionContext(propertiesEditionComponent,
+ eObject, resourceSet));
+ if(propertiesEditionObject != null) {
+ ownedCommentEditUtil.addElement(propertiesEditionObject);
+ ownedComment.refresh();
+ propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
+ ClassifierTemplateParameterPropertiesEditionPartForm.this,
+ UMLViewsRepository.ClassifierTemplateParameter.ownedComment, PropertiesEditionEvent.COMMIT,
+ PropertiesEditionEvent.ADD, null, propertiesEditionObject));
+ }
+ }
+ // End of user code
+
+ }
+
+ /**
+ *
+ */
+ protected void removeFromOwnedComment(Comment element) {
+ // Start of user code for the removeFromOwnedComment() method body
+ EObject editedElement = ownedCommentEditUtil.foundCorrespondingEObject(element);
+ ownedCommentEditUtil.removeElement(element);
+ ownedComment.refresh();
+ propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
+ ClassifierTemplateParameterPropertiesEditionPartForm.this,
+ UMLViewsRepository.ClassifierTemplateParameter.ownedComment, PropertiesEditionEvent.COMMIT,
+ PropertiesEditionEvent.REMOVE, null, editedElement));
+ // End of user code
+
+ }
+
+ /**
+ *
+ */
+ protected void editOwnedComment(Comment element) {
+ // Start of user code editOwnedComment() method body
+ EObject editedElement = ownedCommentEditUtil.foundCorrespondingEObject(element);
+ IPropertiesEditionPolicyProvider policyProvider = PropertiesEditionPolicyProviderService.getInstance()
+ .getProvider(element);
+ IPropertiesEditionPolicy editionPolicy = policyProvider.getEditionPolicy(editedElement);
+ if(editionPolicy != null) {
+ EObject propertiesEditionObject = editionPolicy
+ .getPropertiesEditionObject(new EObjectPropertiesEditionContext(null, element, resourceSet));
+ if(propertiesEditionObject != null) {
+ ownedCommentEditUtil.putElementToRefresh(editedElement, propertiesEditionObject);
+ ownedComment.refresh();
+ propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
+ ClassifierTemplateParameterPropertiesEditionPartForm.this,
+ UMLViewsRepository.ClassifierTemplateParameter.ownedComment, PropertiesEditionEvent.COMMIT,
+ PropertiesEditionEvent.SET, editedElement, propertiesEditionObject));
+ }
+ }
+ // End of user code
+
+ }
+
+ protected void createAllowSubstitutableCheckbox(FormToolkit widgetFactory, Composite parent) {
+ allowSubstitutable = widgetFactory.createButton(parent, UMLMessages.ClassifierTemplateParameterPropertiesEditionPart_AllowSubstitutableLabel, SWT.CHECK);
+ allowSubstitutable.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent e) {
+ if(propertiesEditionComponent != null)
+ propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ClassifierTemplateParameterPropertiesEditionPartForm.this, UMLViewsRepository.ClassifierTemplateParameter.allowSubstitutable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(allowSubstitutable.getSelection())));
+ }
+
+ });
+ GridData allowSubstitutableData = new GridData(GridData.FILL_HORIZONTAL);
+ allowSubstitutableData.horizontalSpan = 2;
+ allowSubstitutable.setLayoutData(allowSubstitutableData);
+ FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(UMLViewsRepository.ClassifierTemplateParameter.allowSubstitutable, UMLViewsRepository.FORM_KIND), null); //$NON-NLS-1$
+ }
+
+
+ public void firePropertiesChanged(PropertiesEditionEvent event) {
+ // Start of user code for tab synchronization
+
+ // End of user code
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#getOwnedCommentToAdd()
+ */
+ public List getOwnedCommentToAdd() {
+ return ownedCommentEditUtil.getElementsToAdd();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#getOwnedCommentToRemove()
+ */
+ public List getOwnedCommentToRemove() {
+ return ownedCommentEditUtil.getElementsToRemove();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#getOwnedCommentToEdit()
+ */
+ public Map getOwnedCommentToEdit() {
+ return ownedCommentEditUtil.getElementsToRefresh();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#getOwnedCommentToMove()
+ */
+ public List getOwnedCommentToMove() {
+ return ownedCommentEditUtil.getElementsToMove();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#getOwnedCommentTable()
+ */
+ public List getOwnedCommentTable() {
+ return ownedCommentEditUtil.getVirtualList();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#initOwnedComment(EObject current,
+ * EReference containingFeature, EReference feature)
+ */
+ public void initOwnedComment(EObject current, EReference containingFeature, EReference feature) {
+ if(current.eResource() != null && current.eResource().getResourceSet() != null)
+ this.resourceSet = current.eResource().getResourceSet();
+ if(containingFeature != null)
+ ownedCommentEditUtil = new EMFListEditUtil(current, containingFeature, feature);
+ else
+ ownedCommentEditUtil = new EMFListEditUtil(current, feature);
+ this.ownedComment.setInput(ownedCommentEditUtil.getVirtualList());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#updateOwnedComment(EObject newValue)
+ */
+ public void updateOwnedComment(EObject newValue) {
+ if(ownedCommentEditUtil != null) {
+ ownedCommentEditUtil.reinit(newValue);
+ ownedComment.refresh();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#addFilterOwnedComment(ViewerFilter filter)
+ */
+ public void addFilterToOwnedComment(ViewerFilter filter) {
+ ownedCommentFilters.add(filter);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#addBusinessFilterOwnedComment(ViewerFilter
+ * filter)
+ */
+ public void addBusinessFilterToOwnedComment(ViewerFilter filter) {
+ ownedCommentBusinessFilters.add(filter);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#isContainedInOwnedCommentTable(EObject
+ * element)
+ */
+ public boolean isContainedInOwnedCommentTable(EObject element) {
+ return ownedCommentEditUtil.contains(element);
+ }
+
+
+
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#getAllowSubstitutable()
+ */
+ public Boolean getAllowSubstitutable() {
+ return Boolean.valueOf(allowSubstitutable.getSelection());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ClassifierTemplateParameterPropertiesEditionPart#setAllowSubstitutable(Boolean newValue)
+ */
+ public void setAllowSubstitutable(Boolean newValue) {
+ if(newValue != null) {
+ allowSubstitutable.setSelection(newValue.booleanValue());
+ } else {
+ allowSubstitutable.setSelection(false);
+ }
+ }
+
+
+
+
+
+ // Start of user code additional methods
+
+ // End of user code
+
+}

Back to the top