1
|
/*******************************************************************************
|
2
|
* Copyright (c) 2000, 2010 IBM Corporation and others.
|
3
|
* All rights reserved. This program and the accompanying materials
|
4
|
* are made available under the terms of the Eclipse Public License v1.0
|
5
|
* which accompanies this distribution, and is available at
|
6
|
* http://www.eclipse.org/legal/epl-v10.html
|
7
|
*
|
8
|
* Contributors:
|
9
|
* IBM Corporation - initial API and implementation
|
10
|
*******************************************************************************/
|
11
|
package org.eclipse.gef.editpolicies;
|
12
|
|
13
|
import org.eclipse.gef.commands.Command;
|
14
|
import org.eclipse.gef.commands.UnexecutableCommand;
|
15
|
import org.eclipse.gef.requests.GroupRequest;
|
16
|
|
17
|
/**
|
18
|
* The <i>root</i> component cannot be removed from its parent. This EditPolicy
|
19
|
* is typically installed on the Viewer's
|
20
|
* {@link org.eclipse.gef.EditPartViewer#getContents() contents}.
|
21
|
*/
|
22
|
public class RootComponentEditPolicy extends ComponentEditPolicy {
|
23
|
|
24
|
/**
|
25
|
* Overridden to prevent the host from being deleted.
|
26
|
*
|
27
|
* @see org.eclipse.gef.editpolicies.ComponentEditPolicy#createDeleteCommand(GroupRequest)
|
28
|
*/
|
29
|
protected Command createDeleteCommand(GroupRequest request) {
|
30
|
return UnexecutableCommand.INSTANCE;
|
31
|
}
|
32
|
|
33
|
}
|