Project

General

Profile

Download (1.91 KB) Statistics
| Branch: | Tag: | Revision:
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;
12

    
13
import org.eclipse.ui.IEditorPart;
14

    
15
/**
16
 * A default implementation of {@link EditDomain}. An {@link IEditorPart} is
17
 * required in the constructor, but it can be <code>null</code>.
18
 * <P>
19
 * A {@link org.eclipse.gef.tools.SelectionTool} will be the active Tool until:
20
 * <UL>
21
 * <LI>A {@link org.eclipse.gef.palette.PaletteRoot} is provided which contains
22
 * a default entry which is a {@link org.eclipse.gef.palette.ToolEntry}. In
23
 * which case that entry's tool is made the active Tool.
24
 * </UL>
25
 * <P>
26
 * DefaultEditDomain can be configured with a
27
 * {@link org.eclipse.gef.ui.palette.PaletteViewer}. When provided, the
28
 * DefaultEditDomain will listen for PaletteEvents, and will switch the active
29
 * Tool automatically in response.
30
 */
31
public class DefaultEditDomain extends EditDomain {
32

    
33
	private IEditorPart editorPart;
34

    
35
	/**
36
	 * Constructs a DefaultEditDomain with the specified IEditorPart
37
	 * 
38
	 * @param editorPart
39
	 *            <code>null</code> or an IEditorPart
40
	 */
41
	public DefaultEditDomain(IEditorPart editorPart) {
42
		setEditorPart(editorPart);
43
	}
44

    
45
	/**
46
	 * @return the IEditorPart for this EditDomain
47
	 */
48
	public IEditorPart getEditorPart() {
49
		return editorPart;
50
	}
51

    
52
	/**
53
	 * Sets the IEditorPart for this EditDomain.
54
	 * 
55
	 * @param editorPart
56
	 *            the editor
57
	 */
58
	protected void setEditorPart(IEditorPart editorPart) {
59
		this.editorPart = editorPart;
60
	}
61

    
62
}
(8-8/44)