diff options
Diffstat (limited to 'deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ExceptionHandlerPropertiesEditionPartForm.java')
1 files changed, 0 insertions, 540 deletions
diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ExceptionHandlerPropertiesEditionPartForm.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ExceptionHandlerPropertiesEditionPartForm.java deleted file mode 100644 index 31f652b0f2e..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.tabbedproperties.uml/generated/org/eclipse/papyrus/tabbedproperties/uml/parts/forms/ExceptionHandlerPropertiesEditionPartForm.java +++ /dev/null @@ -1,540 +0,0 @@ -/******************************************************************************* - * 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.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.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.IStructuredSelection; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart; -import org.eclipse.papyrus.tabbedproperties.uml.parts.UMLViewsRepository; -import org.eclipse.papyrus.tabbedproperties.uml.providers.UMLMessages; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -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.Classifier; -import org.eclipse.uml2.uml.Comment; -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 ExceptionHandlerPropertiesEditionPartForm extends CompositePropertiesEditionPart implements IFormPropertiesEditionPart, ExceptionHandlerPropertiesEditionPart { - - protected EMFListEditUtil ownedCommentEditUtil; - - protected ReferencesTable<? extends EObject> ownedComment; - - protected List<ViewerFilter> ownedCommentBusinessFilters = new ArrayList<ViewerFilter>(); - - protected List<ViewerFilter> ownedCommentFilters = new ArrayList<ViewerFilter>(); - - private EMFListEditUtil exceptionTypeEditUtil; - - protected ReferencesTable<? extends EObject> exceptionType; - - protected List<ViewerFilter> exceptionTypeBusinessFilters = new ArrayList<ViewerFilter>(); - - protected List<ViewerFilter> exceptionTypeFilters = new ArrayList<ViewerFilter>(); - - - - - - /** - * Default constructor - * - * @param editionComponent - * the {@link IPropertiesEditionComponent} that manage this part - */ - public ExceptionHandlerPropertiesEditionPartForm(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.ExceptionHandlerPropertiesEditionPart_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); - createExceptionTypeReferencesTable(widgetFactory, propertiesGroup); - propertiesSection.setClient(propertiesGroup); - } - - /** - * @param container - */ - protected void createOwnedCommentTableComposition(FormToolkit widgetFactory, Composite parent) { - this.ownedComment = new ReferencesTable<Comment>(UMLMessages.ExceptionHandlerPropertiesEditionPart_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.ExceptionHandler.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(ExceptionHandlerPropertiesEditionPartForm.this, UMLViewsRepository.ExceptionHandler.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( - ExceptionHandlerPropertiesEditionPartForm.this, - UMLViewsRepository.ExceptionHandler.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( - ExceptionHandlerPropertiesEditionPartForm.this, UMLViewsRepository.ExceptionHandler.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( - ExceptionHandlerPropertiesEditionPartForm.this, - UMLViewsRepository.ExceptionHandler.ownedComment, PropertiesEditionEvent.COMMIT, - PropertiesEditionEvent.SET, editedElement, propertiesEditionObject)); - } - } - // End of user code - - } - - protected void createExceptionTypeReferencesTable(FormToolkit widgetFactory, Composite parent) { - this.exceptionType = new ReferencesTable<Classifier>(UMLMessages.ExceptionHandlerPropertiesEditionPart_ExceptionTypeLabel, new ReferencesTableListener<Classifier>() { - - public void handleAdd() { - TabElementTreeSelectionDialog<Classifier> dialog = new TabElementTreeSelectionDialog<Classifier>(resourceSet, exceptionTypeFilters, exceptionTypeBusinessFilters, - "Classifier", UMLPackage.eINSTANCE.getClassifier(), current.eResource()) { - - @Override - public void process(IStructuredSelection selection) { - for(Iterator<?> iter = selection.iterator(); iter.hasNext();) { - EObject elem = (EObject)iter.next(); - if(!exceptionTypeEditUtil.getVirtualList().contains(elem)) - exceptionTypeEditUtil.addElement(elem); - propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ExceptionHandlerPropertiesEditionPartForm.this, UMLViewsRepository.ExceptionHandler.exceptionType, - PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem)); - } - exceptionType.refresh(); - } - }; - dialog.open(); - } - - public void handleEdit(Classifier element) { - editExceptionType(element); - } - - public void handleMove(Classifier element, int oldIndex, int newIndex) { - moveExceptionType(element, oldIndex, newIndex); - } - - public void handleRemove(Classifier element) { - removeFromExceptionType(element); - } - - public void navigateTo(Classifier element) { - } - }); - this.exceptionType.setHelpText(propertiesEditionComponent.getHelpContent(UMLViewsRepository.ExceptionHandler.exceptionType, UMLViewsRepository.FORM_KIND)); - this.exceptionType.createControls(parent, widgetFactory); - GridData exceptionTypeData = new GridData(GridData.FILL_HORIZONTAL); - exceptionTypeData.horizontalSpan = 3; - this.exceptionType.setLayoutData(exceptionTypeData); - this.exceptionType.disableMove(); - } - - /**
- *
- */ - protected void moveExceptionType(Classifier element, int oldIndex, int newIndex) { - } - - /**
- *
- */ - protected void removeFromExceptionType(Classifier element) { - // Start of user code for the removeFromExceptionType() method body - EObject editedElement = exceptionTypeEditUtil.foundCorrespondingEObject(element); - exceptionTypeEditUtil.removeElement(element); - exceptionType.refresh(); - propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( - ExceptionHandlerPropertiesEditionPartForm.this, UMLViewsRepository.ExceptionHandler.exceptionType, - PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, editedElement)); - // End of user code - - } - - /**
- *
- */ - protected void editExceptionType(Classifier element) { - // Start of user code editExceptionType() method body - - EObject editedElement = exceptionTypeEditUtil.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) { - exceptionTypeEditUtil.putElementToRefresh(editedElement, propertiesEditionObject); - exceptionType.refresh(); - propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent( - ExceptionHandlerPropertiesEditionPartForm.this, - UMLViewsRepository.ExceptionHandler.exceptionType, PropertiesEditionEvent.COMMIT, - PropertiesEditionEvent.SET, editedElement, propertiesEditionObject)); - } - } - // End of user code - - } - - - public void firePropertiesChanged(PropertiesEditionEvent event) { - // Start of user code for tab synchronization - - // End of user code - - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getOwnedCommentToAdd() - */ - public List getOwnedCommentToAdd() { - return ownedCommentEditUtil.getElementsToAdd(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getOwnedCommentToRemove() - */ - public List getOwnedCommentToRemove() { - return ownedCommentEditUtil.getElementsToRemove(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getOwnedCommentToEdit() - */ - public Map getOwnedCommentToEdit() { - return ownedCommentEditUtil.getElementsToRefresh(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getOwnedCommentToMove() - */ - public List getOwnedCommentToMove() { - return ownedCommentEditUtil.getElementsToMove(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getOwnedCommentTable() - */ - public List getOwnedCommentTable() { - return ownedCommentEditUtil.getVirtualList(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#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.ExceptionHandlerPropertiesEditionPart#updateOwnedComment(EObject newValue) - */ - public void updateOwnedComment(EObject newValue) { - if(ownedCommentEditUtil != null) { - ownedCommentEditUtil.reinit(newValue); - ownedComment.refresh(); - } - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#addFilterOwnedComment(ViewerFilter filter) - */ - public void addFilterToOwnedComment(ViewerFilter filter) { - ownedCommentFilters.add(filter); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#addBusinessFilterOwnedComment(ViewerFilter filter) - */ - public void addBusinessFilterToOwnedComment(ViewerFilter filter) { - ownedCommentBusinessFilters.add(filter); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#isContainedInOwnedCommentTable(EObject element) - */ - public boolean isContainedInOwnedCommentTable(EObject element) { - return ownedCommentEditUtil.contains(element); - } - - - - - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getExceptionTypeToAdd() - */ - public List getExceptionTypeToAdd() { - return exceptionTypeEditUtil.getElementsToAdd(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getExceptionTypeToRemove() - */ - public List getExceptionTypeToRemove() { - return exceptionTypeEditUtil.getElementsToRemove(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#getExceptionTypeTable() - */ - public List getExceptionTypeTable() { - return exceptionTypeEditUtil.getVirtualList(); - } - - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#initExceptionType(EObject current, EReference - * containingFeature, EReference feature) - */ - public void initExceptionType(EObject current, EReference containingFeature, EReference feature) { - if(current.eResource() != null && current.eResource().getResourceSet() != null) - this.resourceSet = current.eResource().getResourceSet(); - if(containingFeature != null) - exceptionTypeEditUtil = new EMFListEditUtil(current, containingFeature, feature); - else - exceptionTypeEditUtil = new EMFListEditUtil(current, feature); - this.exceptionType.setInput(exceptionTypeEditUtil.getVirtualList()); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#updateExceptionType(EObject newValue) - */ - public void updateExceptionType(EObject newValue) { - if(exceptionTypeEditUtil != null) { - exceptionTypeEditUtil.reinit(newValue); - exceptionType.refresh(); - } - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#addFilterExceptionType(ViewerFilter filter) - */ - public void addFilterToExceptionType(ViewerFilter filter) { - exceptionTypeFilters.add(filter); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#addBusinessFilterExceptionType(ViewerFilter filter) - */ - public void addBusinessFilterToExceptionType(ViewerFilter filter) { - exceptionTypeBusinessFilters.add(filter); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.papyrus.tabbedproperties.uml.parts.ExceptionHandlerPropertiesEditionPart#isContainedInExceptionTypeTable(EObject element) - */ - public boolean isContainedInExceptionTypeTable(EObject element) { - return exceptionTypeEditUtil.contains(element); - } - - - - - - // Start of user code additional methods - - // End of user code - -} |