blob: 8af245d20cfd075023c231e535cb1dea3a329c0f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
* 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:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.infra.emf.embeddededitor.editor.actions;
import java.util.Collection;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.ui.action.DeleteAction;
import org.eclipse.papyrus.infra.emf.embeddededitor.util.ActionUtil;
/**
* An adapter for the EMF "Delete" Action, compatible with the
* MoDisco customizable content provider.
*
* @author Camille Letavernier
*/
public class MoDiscoDeleteAction extends DeleteAction {
/**
* Constructor.
*
* @param domain
* The editing domain on which the action will be called
* @param removeAllReferences
* If true, all references to the deleted object will be removed.
* This causes the whole resourceSet to be loaded, which may
* lead to performance issues.
*/
public MoDiscoDeleteAction(EditingDomain domain, boolean removeAllReferences) {
super(domain, removeAllReferences);
}
/**
* Constructor. All references to the deleted object will be removed.
*
* @param domain
* The editing domain on which the action will be called
*/
public MoDiscoDeleteAction(EditingDomain domain) {
super(domain);
}
/**
*
* Constructor.
*
* @param removeAllReferences
* If true, all references to the deleted object will be removed.
* This causes the whole resourceSet to be loaded, which may
* lead to performance issues.
*/
public MoDiscoDeleteAction(boolean removeAllReferences) {
super(removeAllReferences);
}
/**
* Constructor. All references to the deleted object will be removed.
*/
public MoDiscoDeleteAction() {
super();
}
@Override
public Command createCommand(Collection<?> selection) {
Collection<?> newSelection = ActionUtil.getAdaptedSelection(selection);
return super.createCommand(newSelection);
}
}
|