diff options
Diffstat (limited to 'extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/JoinNodePropertiesEditionPartForm.java')
1 files changed, 1760 insertions, 0 deletions
diff --git a/extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/JoinNodePropertiesEditionPartForm.java b/extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/JoinNodePropertiesEditionPartForm.java new file mode 100644 index 00000000000..09073aa4caf --- /dev/null +++ b/extraplugins/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/JoinNodePropertiesEditionPartForm.java @@ -0,0 +1,1760 @@ +/******************************************************************************* + * 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.Iterator; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.Enumerator; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EEnumLiteral; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.util.EcoreAdapterFactory; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +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.EMFComboViewer; +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.TabElementTreeSelectionDialog; +import org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.ViewerFilter; +import org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart; +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.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +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.swt.widgets.Text; +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.ActivityEdge; +import org.eclipse.uml2.uml.ActivityNode; +import org.eclipse.uml2.uml.ActivityPartition; +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.InterruptibleActivityRegion; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.UMLPackage; + +// End of user code + +/** + * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a> + */ +public class JoinNodePropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, JoinNodePropertiesEditionPart { + + protected EMFListEditUtil ownedCommentEditUtil; + + protected ReferencesTable<? extends EObject> ownedComment; + + protected List<ViewerFilter> ownedCommentBusinessFilters = new ArrayList<ViewerFilter>(); + + protected List<ViewerFilter> ownedCommentFilters = new ArrayList<ViewerFilter>(); + + protected Text name; + + protected EMFComboViewer visibility; + + private EMFListEditUtil clientDependencyEditUtil; + + protected ReferencesTable<? extends EObject> clientDependency; + + protected List<ViewerFilter> clientDependencyBusinessFilters = new ArrayList<ViewerFilter>(); + + protected List<ViewerFilter> clientDependencyFilters = new ArrayList<ViewerFilter>(); + + protected Button isLeaf; + + private EMFListEditUtil outgoingEditUtil; + + protected ReferencesTable<? extends EObject> outgoing; + + protected List<ViewerFilter> outgoingBusinessFilters = new ArrayList<ViewerFilter>(); + + protected List<ViewerFilter> outgoingFilters = new ArrayList<ViewerFilter>(); + + private EMFListEditUtil incomingEditUtil; + + protected ReferencesTable<? extends EObject> incoming; + + protected List<ViewerFilter> incomingBusinessFilters = new ArrayList<ViewerFilter>(); + + protected List<ViewerFilter> incomingFilters = new ArrayList<ViewerFilter>(); + + private EMFListEditUtil inPartitionEditUtil; + + protected ReferencesTable<? extends EObject> inPartition; + + protected List<ViewerFilter> inPartitionBusinessFilters = new ArrayList<ViewerFilter>(); + + protected List<ViewerFilter> inPartitionFilters = new ArrayList<ViewerFilter>(); + + private EMFListEditUtil inInterruptibleRegionEditUtil; + + protected ReferencesTable<? extends EObject> inInterruptibleRegion; + + protected List<ViewerFilter> inInterruptibleRegionBusinessFilters = new ArrayList<ViewerFilter>(); + + protected List<ViewerFilter> inInterruptibleRegionFilters = new ArrayList<ViewerFilter>(); + + private EMFListEditUtil redefinedNodeEditUtil; + + protected ReferencesTable<? extends EObject> redefinedNode; + + protected List<ViewerFilter> redefinedNodeBusinessFilters = new ArrayList<ViewerFilter>(); + + protected List<ViewerFilter> redefinedNodeFilters = new ArrayList<ViewerFilter>(); + + protected Button isCombineDuplicate; + + + + + + /** + * Default constructor + * + * @param editionComponent + * the {@link IPropertiesEditionComponent} that manage this part + */ + public JoinNodePropertiesEditionPartForm(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.JoinNodePropertiesEditionPart_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); + createNameText(widgetFactory, propertiesGroup); + createVisibilityEMFComboViewer(widgetFactory, propertiesGroup); + createClientDependencyReferencesTable(widgetFactory, propertiesGroup); + createIsLeafCheckbox(widgetFactory, propertiesGroup); + createOutgoingReferencesTable(widgetFactory, propertiesGroup); + createIncomingReferencesTable(widgetFactory, propertiesGroup); + createInPartitionReferencesTable(widgetFactory, propertiesGroup); + createInInterruptibleRegionReferencesTable(widgetFactory, propertiesGroup); + createRedefinedNodeReferencesTable(widgetFactory, propertiesGroup); + createIsCombineDuplicateCheckbox(widgetFactory, propertiesGroup); + propertiesSection.setClient(propertiesGroup); + } + + /** + * @param container + */ + protected void createOwnedCommentTableComposition(FormToolkit widgetFactory, Composite parent) { + this.ownedComment = new ReferencesTable<Comment>(UMLMessages.JoinNodePropertiesEditionPart_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.JoinNode.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(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.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( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.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( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.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( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.ownedComment, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, editedElement, + propertiesEditionObject)); + } + } + // End of user code + + } + + protected void createNameText(FormToolkit widgetFactory, Composite parent) { + FormUtils.createPartLabel(widgetFactory, parent, UMLMessages.JoinNodePropertiesEditionPart_NameLabel, propertiesEditionComponent.isRequired(UMLViewsRepository.JoinNode.name, UMLViewsRepository.FORM_KIND)); + 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.addModifyListener(new ModifyListener() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent) + */ + public void modifyText(ModifyEvent e) { + if(propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.name, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, name.getText())); + } + + }); + name.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(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + + }); + name.addKeyListener(new KeyAdapter() { + + /** + * {@inheritDoc} + * + * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) + */ + public void keyPressed(KeyEvent e) { + if(e.character == SWT.CR) { + if(propertiesEditionComponent != null) + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText())); + } + } + + }); + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.name, UMLViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + } + + protected void createVisibilityEMFComboViewer(FormToolkit widgetFactory, Composite parent) { + FormUtils.createPartLabel(widgetFactory, parent, UMLMessages.JoinNodePropertiesEditionPart_VisibilityLabel, propertiesEditionComponent.isRequired(UMLViewsRepository.JoinNode.visibility, UMLViewsRepository.FORM_KIND)); + visibility = new EMFComboViewer(parent); + visibility.setContentProvider(new ArrayContentProvider()); + visibility.setLabelProvider(new AdapterFactoryLabelProvider(new EcoreAdapterFactory())); + GridData visibilityData = new GridData(GridData.FILL_HORIZONTAL); + visibility.getCombo().setLayoutData(visibilityData); + visibility.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(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.visibility, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getVisibility())); + } + + }); + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.visibility, UMLViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + } + + protected void createClientDependencyReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.clientDependency = new ReferencesTable<Dependency>(UMLMessages.JoinNodePropertiesEditionPart_ClientDependencyLabel, new ReferencesTableListener<Dependency>() { + + public void handleAdd() { + TabElementTreeSelectionDialog<Dependency> dialog = new TabElementTreeSelectionDialog<Dependency>(resourceSet, clientDependencyFilters, clientDependencyBusinessFilters, + "Dependency", UMLPackage.eINSTANCE.getDependency(), current.eResource()) { + + @Override + public void process(IStructuredSelection selection) { + for(Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject)iter.next(); + if(!clientDependencyEditUtil.getVirtualList().contains(elem)) + clientDependencyEditUtil.addElement(elem); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.clientDependency, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + clientDependency.refresh(); + } + }; + dialog.open(); + } + + public void handleEdit(Dependency element) { + editClientDependency(element); + } + + public void handleMove(Dependency element, int oldIndex, int newIndex) { + moveClientDependency(element, oldIndex, newIndex); + } + + public void handleRemove(Dependency element) { + removeFromClientDependency(element); + } + + public void navigateTo(Dependency element) { + } + }); + this.clientDependency.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.clientDependency, UMLViewsRepository.FORM_KIND)); + this.clientDependency.createControls(parent, widgetFactory); + GridData clientDependencyData = new GridData(GridData.FILL_HORIZONTAL); + clientDependencyData.horizontalSpan = 3; + this.clientDependency.setLayoutData(clientDependencyData); + this.clientDependency.disableMove(); + } + + /**
+ *
+ */ + protected void moveClientDependency(Dependency element, int oldIndex, int newIndex) { + EObject editedElement = clientDependencyEditUtil.foundCorrespondingEObject(element); + clientDependencyEditUtil.moveElement(element, oldIndex, newIndex); + clientDependency.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.clientDependency, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex)); + } + + /**
+ *
+ */ + protected void removeFromClientDependency(Dependency element) { + // Start of user code for the removeFromClientDependency() method body + EObject editedElement = clientDependencyEditUtil.foundCorrespondingEObject(element); + clientDependencyEditUtil.removeElement(element); + clientDependency.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.clientDependency, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement)); + // End of user code + + } + + /**
+ *
+ */ + protected void editClientDependency(Dependency element) { + // Start of user code editClientDependency() method body + + EObject editedElement = clientDependencyEditUtil.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) { + clientDependencyEditUtil.putElementToRefresh(editedElement, propertiesEditionObject); + clientDependency.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.clientDependency, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, editedElement, + propertiesEditionObject)); + } + } + // End of user code + + } + + protected void createIsLeafCheckbox(FormToolkit widgetFactory, Composite parent) { + isLeaf = widgetFactory.createButton(parent, UMLMessages.JoinNodePropertiesEditionPart_IsLeafLabel, SWT.CHECK); + isLeaf.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(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.isLeaf, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(isLeaf.getSelection()))); + } + + }); + GridData isLeafData = new GridData(GridData.FILL_HORIZONTAL); + isLeafData.horizontalSpan = 2; + isLeaf.setLayoutData(isLeafData); + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.isLeaf, UMLViewsRepository.FORM_KIND), null); //$NON-NLS-1$ + } + + protected void createOutgoingReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.outgoing = new ReferencesTable<ActivityEdge>(UMLMessages.JoinNodePropertiesEditionPart_OutgoingLabel, new ReferencesTableListener<ActivityEdge>() { + + public void handleAdd() { + TabElementTreeSelectionDialog<ActivityEdge> dialog = new TabElementTreeSelectionDialog<ActivityEdge>(resourceSet, outgoingFilters, outgoingBusinessFilters, + "ActivityEdge", UMLPackage.eINSTANCE.getActivityEdge(), current.eResource()) { + + @Override + public void process(IStructuredSelection selection) { + for(Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject)iter.next(); + if(!outgoingEditUtil.getVirtualList().contains(elem)) + outgoingEditUtil.addElement(elem); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.outgoing, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + outgoing.refresh(); + } + }; + dialog.open(); + } + + public void handleEdit(ActivityEdge element) { + editOutgoing(element); + } + + public void handleMove(ActivityEdge element, int oldIndex, int newIndex) { + moveOutgoing(element, oldIndex, newIndex); + } + + public void handleRemove(ActivityEdge element) { + removeFromOutgoing(element); + } + + public void navigateTo(ActivityEdge element) { + } + }); + this.outgoing.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.outgoing, UMLViewsRepository.FORM_KIND)); + this.outgoing.createControls(parent, widgetFactory); + GridData outgoingData = new GridData(GridData.FILL_HORIZONTAL); + outgoingData.horizontalSpan = 3; + this.outgoing.setLayoutData(outgoingData); + this.outgoing.disableMove(); + } + + /**
+ *
+ */ + protected void moveOutgoing(ActivityEdge element, int oldIndex, int newIndex) { + } + + /**
+ *
+ */ + protected void removeFromOutgoing(ActivityEdge element) { + // Start of user code for the removeFromOutgoing() method body + EObject editedElement = outgoingEditUtil.foundCorrespondingEObject(element); + outgoingEditUtil.removeElement(element); + outgoing.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.outgoing, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement)); + // End of user code + + } + + /**
+ *
+ */ + protected void editOutgoing(ActivityEdge element) { + // Start of user code editOutgoing() method body + + EObject editedElement = outgoingEditUtil.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) { + outgoingEditUtil.putElementToRefresh(editedElement, propertiesEditionObject); + outgoing.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.outgoing, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, editedElement, + propertiesEditionObject)); + } + } + // End of user code + + } + + protected void createIncomingReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.incoming = new ReferencesTable<ActivityEdge>(UMLMessages.JoinNodePropertiesEditionPart_IncomingLabel, new ReferencesTableListener<ActivityEdge>() { + + public void handleAdd() { + TabElementTreeSelectionDialog<ActivityEdge> dialog = new TabElementTreeSelectionDialog<ActivityEdge>(resourceSet, incomingFilters, incomingBusinessFilters, + "ActivityEdge", UMLPackage.eINSTANCE.getActivityEdge(), current.eResource()) { + + @Override + public void process(IStructuredSelection selection) { + for(Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject)iter.next(); + if(!incomingEditUtil.getVirtualList().contains(elem)) + incomingEditUtil.addElement(elem); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.incoming, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + incoming.refresh(); + } + }; + dialog.open(); + } + + public void handleEdit(ActivityEdge element) { + editIncoming(element); + } + + public void handleMove(ActivityEdge element, int oldIndex, int newIndex) { + moveIncoming(element, oldIndex, newIndex); + } + + public void handleRemove(ActivityEdge element) { + removeFromIncoming(element); + } + + public void navigateTo(ActivityEdge element) { + } + }); + this.incoming.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.incoming, UMLViewsRepository.FORM_KIND)); + this.incoming.createControls(parent, widgetFactory); + GridData incomingData = new GridData(GridData.FILL_HORIZONTAL); + incomingData.horizontalSpan = 3; + this.incoming.setLayoutData(incomingData); + this.incoming.disableMove(); + } + + /**
+ *
+ */ + protected void moveIncoming(ActivityEdge element, int oldIndex, int newIndex) { + } + + /**
+ *
+ */ + protected void removeFromIncoming(ActivityEdge element) { + // Start of user code for the removeFromIncoming() method body + EObject editedElement = incomingEditUtil.foundCorrespondingEObject(element); + incomingEditUtil.removeElement(element); + incoming.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.incoming, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement)); + // End of user code + + } + + /**
+ *
+ */ + protected void editIncoming(ActivityEdge element) { + // Start of user code editIncoming() method body + + EObject editedElement = incomingEditUtil.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) { + incomingEditUtil.putElementToRefresh(editedElement, propertiesEditionObject); + incoming.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.incoming, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, editedElement, + propertiesEditionObject)); + } + } + // End of user code + + } + + protected void createInPartitionReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.inPartition = new ReferencesTable<ActivityPartition>(UMLMessages.JoinNodePropertiesEditionPart_InPartitionLabel, new ReferencesTableListener<ActivityPartition>() { + + public void handleAdd() { + TabElementTreeSelectionDialog<ActivityPartition> dialog = new TabElementTreeSelectionDialog<ActivityPartition>(resourceSet, inPartitionFilters, inPartitionBusinessFilters, + "ActivityPartition", UMLPackage.eINSTANCE.getActivityPartition(), current.eResource()) { + + @Override + public void process(IStructuredSelection selection) { + for(Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject)iter.next(); + if(!inPartitionEditUtil.getVirtualList().contains(elem)) + inPartitionEditUtil.addElement(elem); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inPartition, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + inPartition.refresh(); + } + }; + dialog.open(); + } + + public void handleEdit(ActivityPartition element) { + editInPartition(element); + } + + public void handleMove(ActivityPartition element, int oldIndex, int newIndex) { + moveInPartition(element, oldIndex, newIndex); + } + + public void handleRemove(ActivityPartition element) { + removeFromInPartition(element); + } + + public void navigateTo(ActivityPartition element) { + } + }); + this.inPartition.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.inPartition, UMLViewsRepository.FORM_KIND)); + this.inPartition.createControls(parent, widgetFactory); + GridData inPartitionData = new GridData(GridData.FILL_HORIZONTAL); + inPartitionData.horizontalSpan = 3; + this.inPartition.setLayoutData(inPartitionData); + this.inPartition.disableMove(); + } + + /**
+ *
+ */ + protected void moveInPartition(ActivityPartition element, int oldIndex, int newIndex) { + EObject editedElement = inPartitionEditUtil.foundCorrespondingEObject(element); + inPartitionEditUtil.moveElement(element, oldIndex, newIndex); + inPartition.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inPartition, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex)); + } + + /**
+ *
+ */ + protected void removeFromInPartition(ActivityPartition element) { + // Start of user code for the removeFromInPartition() method body + EObject editedElement = inPartitionEditUtil.foundCorrespondingEObject(element); + inPartitionEditUtil.removeElement(element); + inPartition.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inPartition, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement)); + // End of user code + + } + + /**
+ *
+ */ + protected void editInPartition(ActivityPartition element) { + // Start of user code editInPartition() method body + + EObject editedElement = inPartitionEditUtil.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) { + inPartitionEditUtil.putElementToRefresh(editedElement, propertiesEditionObject); + inPartition.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inPartition, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, editedElement, + propertiesEditionObject)); + } + } + // End of user code + + } + + protected void createInInterruptibleRegionReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.inInterruptibleRegion = new ReferencesTable<InterruptibleActivityRegion>(UMLMessages.JoinNodePropertiesEditionPart_InInterruptibleRegionLabel, new ReferencesTableListener<InterruptibleActivityRegion>() { + + public void handleAdd() { + TabElementTreeSelectionDialog<InterruptibleActivityRegion> dialog = new TabElementTreeSelectionDialog<InterruptibleActivityRegion>(resourceSet, inInterruptibleRegionFilters, inInterruptibleRegionBusinessFilters, + "InterruptibleActivityRegion", UMLPackage.eINSTANCE.getInterruptibleActivityRegion(), current.eResource()) { + + @Override + public void process(IStructuredSelection selection) { + for(Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject)iter.next(); + if(!inInterruptibleRegionEditUtil.getVirtualList().contains(elem)) + inInterruptibleRegionEditUtil.addElement(elem); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inInterruptibleRegion, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + inInterruptibleRegion.refresh(); + } + }; + dialog.open(); + } + + public void handleEdit(InterruptibleActivityRegion element) { + editInInterruptibleRegion(element); + } + + public void handleMove(InterruptibleActivityRegion element, int oldIndex, int newIndex) { + moveInInterruptibleRegion(element, oldIndex, newIndex); + } + + public void handleRemove(InterruptibleActivityRegion element) { + removeFromInInterruptibleRegion(element); + } + + public void navigateTo(InterruptibleActivityRegion element) { + } + }); + this.inInterruptibleRegion.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.inInterruptibleRegion, UMLViewsRepository.FORM_KIND)); + this.inInterruptibleRegion.createControls(parent, widgetFactory); + GridData inInterruptibleRegionData = new GridData(GridData.FILL_HORIZONTAL); + inInterruptibleRegionData.horizontalSpan = 3; + this.inInterruptibleRegion.setLayoutData(inInterruptibleRegionData); + this.inInterruptibleRegion.disableMove(); + } + + /**
+ *
+ */ + protected void moveInInterruptibleRegion(InterruptibleActivityRegion element, int oldIndex, int newIndex) { + EObject editedElement = inInterruptibleRegionEditUtil.foundCorrespondingEObject(element); + inInterruptibleRegionEditUtil.moveElement(element, oldIndex, newIndex); + inInterruptibleRegion.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inInterruptibleRegion, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, editedElement, newIndex)); + } + + /**
+ *
+ */ + protected void removeFromInInterruptibleRegion(InterruptibleActivityRegion element) { + // Start of user code for the removeFromInInterruptibleRegion() method body + EObject editedElement = inInterruptibleRegionEditUtil.foundCorrespondingEObject(element); + inInterruptibleRegionEditUtil.removeElement(element); + inInterruptibleRegion.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inInterruptibleRegion, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement)); + // End of user code + + } + + /**
+ *
+ */ + protected void editInInterruptibleRegion(InterruptibleActivityRegion element) { + // Start of user code editInInterruptibleRegion() method body + + EObject editedElement = inInterruptibleRegionEditUtil.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) { + inInterruptibleRegionEditUtil.putElementToRefresh(editedElement, propertiesEditionObject); + inInterruptibleRegion.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.inInterruptibleRegion, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, editedElement, + propertiesEditionObject)); + } + } + // End of user code + + } + + protected void createRedefinedNodeReferencesTable(FormToolkit widgetFactory, Composite parent) { + this.redefinedNode = new ReferencesTable<ActivityNode>(UMLMessages.JoinNodePropertiesEditionPart_RedefinedNodeLabel, new ReferencesTableListener<ActivityNode>() { + + public void handleAdd() { + TabElementTreeSelectionDialog<ActivityNode> dialog = new TabElementTreeSelectionDialog<ActivityNode>(resourceSet, redefinedNodeFilters, redefinedNodeBusinessFilters, + "ActivityNode", UMLPackage.eINSTANCE.getActivityNode(), current.eResource()) { + + @Override + public void process(IStructuredSelection selection) { + for(Iterator<?> iter = selection.iterator(); iter.hasNext();) { + EObject elem = (EObject)iter.next(); + if(!redefinedNodeEditUtil.getVirtualList().contains(elem)) + redefinedNodeEditUtil.addElement(elem); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.redefinedNode, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); + } + redefinedNode.refresh(); + } + }; + dialog.open(); + } + + public void handleEdit(ActivityNode element) { + editRedefinedNode(element); + } + + public void handleMove(ActivityNode element, int oldIndex, int newIndex) { + moveRedefinedNode(element, oldIndex, newIndex); + } + + public void handleRemove(ActivityNode element) { + removeFromRedefinedNode(element); + } + + public void navigateTo(ActivityNode element) { + } + }); + this.redefinedNode.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.redefinedNode, UMLViewsRepository.FORM_KIND)); + this.redefinedNode.createControls(parent, widgetFactory); + GridData redefinedNodeData = new GridData(GridData.FILL_HORIZONTAL); + redefinedNodeData.horizontalSpan = 3; + this.redefinedNode.setLayoutData(redefinedNodeData); + this.redefinedNode.disableMove(); + } + + /**
+ *
+ */ + protected void moveRedefinedNode(ActivityNode element, int oldIndex, int newIndex) { + } + + /**
+ *
+ */ + protected void removeFromRedefinedNode(ActivityNode element) { + // Start of user code for the removeFromRedefinedNode() method body + EObject editedElement = redefinedNodeEditUtil.foundCorrespondingEObject(element); + redefinedNodeEditUtil.removeElement(element); + redefinedNode.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.redefinedNode, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement)); + // End of user code + + } + + /**
+ *
+ */ + protected void editRedefinedNode(ActivityNode element) { + // Start of user code editRedefinedNode() method body + + EObject editedElement = redefinedNodeEditUtil.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) { + redefinedNodeEditUtil.putElementToRefresh(editedElement, propertiesEditionObject); + redefinedNode.refresh(); + propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( + JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.redefinedNode, + PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, editedElement, + propertiesEditionObject)); + } + } + // End of user code + + } + + protected void createIsCombineDuplicateCheckbox(FormToolkit widgetFactory, Composite parent) { + isCombineDuplicate = widgetFactory.createButton(parent, UMLMessages.JoinNodePropertiesEditionPart_IsCombineDuplicateLabel, SWT.CHECK); + isCombineDuplicate.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(JoinNodePropertiesEditionPartForm.this, UMLViewsRepository.JoinNode.isCombineDuplicate, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(isCombineDuplicate.getSelection()))); + } + + }); + GridData isCombineDuplicateData = new GridData(GridData.FILL_HORIZONTAL); + isCombineDuplicateData.horizontalSpan = 2; + isCombineDuplicate.setLayoutData(isCombineDuplicateData); + FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(UMLViewsRepository.JoinNode.isCombineDuplicate, 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.JoinNodePropertiesEditionPart#getOwnedCommentToAdd() + */ + public List getOwnedCommentToAdd() { + return ownedCommentEditUtil.getElementsToAdd(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getOwnedCommentToRemove() + */ + public List getOwnedCommentToRemove() { + return ownedCommentEditUtil.getElementsToRemove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getOwnedCommentToEdit() + */ + public Map getOwnedCommentToEdit() { + return ownedCommentEditUtil.getElementsToRefresh(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getOwnedCommentToMove() + */ + public List getOwnedCommentToMove() { + return ownedCommentEditUtil.getElementsToMove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getOwnedCommentTable() + */ + public List getOwnedCommentTable() { + return ownedCommentEditUtil.getVirtualList(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#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.JoinNodePropertiesEditionPart#updateOwnedComment(EObject newValue) + */ + public void updateOwnedComment(EObject newValue) { + if(ownedCommentEditUtil != null) { + ownedCommentEditUtil.reinit(newValue); + ownedComment.refresh(); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addFilterOwnedComment(ViewerFilter filter) + */ + public void addFilterToOwnedComment(ViewerFilter filter) { + ownedCommentFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addBusinessFilterOwnedComment(ViewerFilter filter) + */ + public void addBusinessFilterToOwnedComment(ViewerFilter filter) { + ownedCommentBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#isContainedInOwnedCommentTable(EObject element) + */ + public boolean isContainedInOwnedCommentTable(EObject element) { + return ownedCommentEditUtil.contains(element); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getName() + */ + public String getName() { + return name.getText(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#setName(String newValue) + */ + public void setName(String newValue) { + if(newValue != null) { + name.setText(newValue); + } else { + name.setText(""); //$NON-NLS-1$ + } + } + + public void setMessageForName(String msg, int msgLevel) { + messageManager.addMessage("Name_key", msg, null, msgLevel, name); + } + + public void unsetMessageForName() { + messageManager.removeMessage("Name_key", name); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getVisibility() + */ + public Enumerator getVisibility() { + EEnumLiteral selection = (EEnumLiteral)((StructuredSelection)visibility.getSelection()).getFirstElement(); + return selection.getInstance(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#initVisibility(EEnum eenum, Enumerator current) + */ + public void initVisibility(EEnum eenum, Enumerator current) { + visibility.setInput(eenum.getELiterals()); + visibility.modelUpdating(new StructuredSelection(current)); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#setVisibility(Enumerator newValue) + */ + public void setVisibility(Enumerator newValue) { + visibility.modelUpdating(new StructuredSelection(newValue)); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getClientDependencyToAdd() + */ + public List getClientDependencyToAdd() { + return clientDependencyEditUtil.getElementsToAdd(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getClientDependencyToRemove() + */ + public List getClientDependencyToRemove() { + return clientDependencyEditUtil.getElementsToRemove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getClientDependencyTable() + */ + public List getClientDependencyTable() { + return clientDependencyEditUtil.getVirtualList(); + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#initClientDependency(EObject current, EReference + * containingFeature, EReference feature) + */ + public void initClientDependency(EObject current, EReference containingFeature, EReference feature) { + if(current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + if(containingFeature != null) + clientDependencyEditUtil = new EMFListEditUtil(current, containingFeature, feature); + else + clientDependencyEditUtil = new EMFListEditUtil(current, feature); + this.clientDependency.setInput(clientDependencyEditUtil.getVirtualList()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#updateClientDependency(EObject newValue) + */ + public void updateClientDependency(EObject newValue) { + if(clientDependencyEditUtil != null) { + clientDependencyEditUtil.reinit(newValue); + clientDependency.refresh(); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addFilterClientDependency(ViewerFilter filter) + */ + public void addFilterToClientDependency(ViewerFilter filter) { + clientDependencyFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addBusinessFilterClientDependency(ViewerFilter filter) + */ + public void addBusinessFilterToClientDependency(ViewerFilter filter) { + clientDependencyBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#isContainedInClientDependencyTable(EObject element) + */ + public boolean isContainedInClientDependencyTable(EObject element) { + return clientDependencyEditUtil.contains(element); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getIsLeaf() + */ + public Boolean getIsLeaf() { + return Boolean.valueOf(isLeaf.getSelection()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#setIsLeaf(Boolean newValue) + */ + public void setIsLeaf(Boolean newValue) { + if(newValue != null) { + isLeaf.setSelection(newValue.booleanValue()); + } else { + isLeaf.setSelection(false); + } + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getOutgoingToAdd() + */ + public List getOutgoingToAdd() { + return outgoingEditUtil.getElementsToAdd(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getOutgoingToRemove() + */ + public List getOutgoingToRemove() { + return outgoingEditUtil.getElementsToRemove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getOutgoingTable() + */ + public List getOutgoingTable() { + return outgoingEditUtil.getVirtualList(); + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#initOutgoing(EObject current, EReference containingFeature, + * EReference feature) + */ + public void initOutgoing(EObject current, EReference containingFeature, EReference feature) { + if(current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + if(containingFeature != null) + outgoingEditUtil = new EMFListEditUtil(current, containingFeature, feature); + else + outgoingEditUtil = new EMFListEditUtil(current, feature); + this.outgoing.setInput(outgoingEditUtil.getVirtualList()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#updateOutgoing(EObject newValue) + */ + public void updateOutgoing(EObject newValue) { + if(outgoingEditUtil != null) { + outgoingEditUtil.reinit(newValue); + outgoing.refresh(); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addFilterOutgoing(ViewerFilter filter) + */ + public void addFilterToOutgoing(ViewerFilter filter) { + outgoingFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addBusinessFilterOutgoing(ViewerFilter filter) + */ + public void addBusinessFilterToOutgoing(ViewerFilter filter) { + outgoingBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#isContainedInOutgoingTable(EObject element) + */ + public boolean isContainedInOutgoingTable(EObject element) { + return outgoingEditUtil.contains(element); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getIncomingToAdd() + */ + public List getIncomingToAdd() { + return incomingEditUtil.getElementsToAdd(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getIncomingToRemove() + */ + public List getIncomingToRemove() { + return incomingEditUtil.getElementsToRemove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getIncomingTable() + */ + public List getIncomingTable() { + return incomingEditUtil.getVirtualList(); + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#initIncoming(EObject current, EReference containingFeature, + * EReference feature) + */ + public void initIncoming(EObject current, EReference containingFeature, EReference feature) { + if(current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + if(containingFeature != null) + incomingEditUtil = new EMFListEditUtil(current, containingFeature, feature); + else + incomingEditUtil = new EMFListEditUtil(current, feature); + this.incoming.setInput(incomingEditUtil.getVirtualList()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#updateIncoming(EObject newValue) + */ + public void updateIncoming(EObject newValue) { + if(incomingEditUtil != null) { + incomingEditUtil.reinit(newValue); + incoming.refresh(); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addFilterIncoming(ViewerFilter filter) + */ + public void addFilterToIncoming(ViewerFilter filter) { + incomingFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addBusinessFilterIncoming(ViewerFilter filter) + */ + public void addBusinessFilterToIncoming(ViewerFilter filter) { + incomingBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#isContainedInIncomingTable(EObject element) + */ + public boolean isContainedInIncomingTable(EObject element) { + return incomingEditUtil.contains(element); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getInPartitionToAdd() + */ + public List getInPartitionToAdd() { + return inPartitionEditUtil.getElementsToAdd(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getInPartitionToRemove() + */ + public List getInPartitionToRemove() { + return inPartitionEditUtil.getElementsToRemove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getInPartitionTable() + */ + public List getInPartitionTable() { + return inPartitionEditUtil.getVirtualList(); + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#initInPartition(EObject current, EReference + * containingFeature, EReference feature) + */ + public void initInPartition(EObject current, EReference containingFeature, EReference feature) { + if(current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + if(containingFeature != null) + inPartitionEditUtil = new EMFListEditUtil(current, containingFeature, feature); + else + inPartitionEditUtil = new EMFListEditUtil(current, feature); + this.inPartition.setInput(inPartitionEditUtil.getVirtualList()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#updateInPartition(EObject newValue) + */ + public void updateInPartition(EObject newValue) { + if(inPartitionEditUtil != null) { + inPartitionEditUtil.reinit(newValue); + inPartition.refresh(); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addFilterInPartition(ViewerFilter filter) + */ + public void addFilterToInPartition(ViewerFilter filter) { + inPartitionFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addBusinessFilterInPartition(ViewerFilter filter) + */ + public void addBusinessFilterToInPartition(ViewerFilter filter) { + inPartitionBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#isContainedInInPartitionTable(EObject element) + */ + public boolean isContainedInInPartitionTable(EObject element) { + return inPartitionEditUtil.contains(element); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getInInterruptibleRegionToAdd() + */ + public List getInInterruptibleRegionToAdd() { + return inInterruptibleRegionEditUtil.getElementsToAdd(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getInInterruptibleRegionToRemove() + */ + public List getInInterruptibleRegionToRemove() { + return inInterruptibleRegionEditUtil.getElementsToRemove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getInInterruptibleRegionTable() + */ + public List getInInterruptibleRegionTable() { + return inInterruptibleRegionEditUtil.getVirtualList(); + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#initInInterruptibleRegion(EObject current, EReference + * containingFeature, EReference feature) + */ + public void initInInterruptibleRegion(EObject current, EReference containingFeature, EReference feature) { + if(current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + if(containingFeature != null) + inInterruptibleRegionEditUtil = new EMFListEditUtil(current, containingFeature, feature); + else + inInterruptibleRegionEditUtil = new EMFListEditUtil(current, feature); + this.inInterruptibleRegion.setInput(inInterruptibleRegionEditUtil.getVirtualList()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#updateInInterruptibleRegion(EObject newValue) + */ + public void updateInInterruptibleRegion(EObject newValue) { + if(inInterruptibleRegionEditUtil != null) { + inInterruptibleRegionEditUtil.reinit(newValue); + inInterruptibleRegion.refresh(); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addFilterInInterruptibleRegion(ViewerFilter filter) + */ + public void addFilterToInInterruptibleRegion(ViewerFilter filter) { + inInterruptibleRegionFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addBusinessFilterInInterruptibleRegion(ViewerFilter filter) + */ + public void addBusinessFilterToInInterruptibleRegion(ViewerFilter filter) { + inInterruptibleRegionBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#isContainedInInInterruptibleRegionTable(EObject element) + */ + public boolean isContainedInInInterruptibleRegionTable(EObject element) { + return inInterruptibleRegionEditUtil.contains(element); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getRedefinedNodeToAdd() + */ + public List getRedefinedNodeToAdd() { + return redefinedNodeEditUtil.getElementsToAdd(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getRedefinedNodeToRemove() + */ + public List getRedefinedNodeToRemove() { + return redefinedNodeEditUtil.getElementsToRemove(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getRedefinedNodeTable() + */ + public List getRedefinedNodeTable() { + return redefinedNodeEditUtil.getVirtualList(); + } + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#initRedefinedNode(EObject current, EReference + * containingFeature, EReference feature) + */ + public void initRedefinedNode(EObject current, EReference containingFeature, EReference feature) { + if(current.eResource() != null && current.eResource().getResourceSet() != null) + this.resourceSet = current.eResource().getResourceSet(); + if(containingFeature != null) + redefinedNodeEditUtil = new EMFListEditUtil(current, containingFeature, feature); + else + redefinedNodeEditUtil = new EMFListEditUtil(current, feature); + this.redefinedNode.setInput(redefinedNodeEditUtil.getVirtualList()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#updateRedefinedNode(EObject newValue) + */ + public void updateRedefinedNode(EObject newValue) { + if(redefinedNodeEditUtil != null) { + redefinedNodeEditUtil.reinit(newValue); + redefinedNode.refresh(); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addFilterRedefinedNode(ViewerFilter filter) + */ + public void addFilterToRedefinedNode(ViewerFilter filter) { + redefinedNodeFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#addBusinessFilterRedefinedNode(ViewerFilter filter) + */ + public void addBusinessFilterToRedefinedNode(ViewerFilter filter) { + redefinedNodeBusinessFilters.add(filter); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#isContainedInRedefinedNodeTable(EObject element) + */ + public boolean isContainedInRedefinedNodeTable(EObject element) { + return redefinedNodeEditUtil.contains(element); + } + + + + + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#getIsCombineDuplicate() + */ + public Boolean getIsCombineDuplicate() { + return Boolean.valueOf(isCombineDuplicate.getSelection()); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.papyrus.tabbedproperties.uml.parts.JoinNodePropertiesEditionPart#setIsCombineDuplicate(Boolean newValue) + */ + public void setIsCombineDuplicate(Boolean newValue) { + if(newValue != null) { + isCombineDuplicate.setSelection(newValue.booleanValue()); + } else { + isCombineDuplicate.setSelection(false); + } + } + + + + + + // Start of user code additional methods + + // End of user code + +} |