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.palette;
|
12
|
|
13
|
import org.eclipse.jface.resource.ImageDescriptor;
|
14
|
|
15
|
/**
|
16
|
* @author Eric Bordeau
|
17
|
*/
|
18
|
public class PaletteTemplateEntry extends PaletteEntry {
|
19
|
|
20
|
private Object template;
|
21
|
|
22
|
/** Type identifier **/
|
23
|
public static final String PALETTE_TYPE_TEMPLATE = "$Palette Template"; //$NON-NLS-1$
|
24
|
|
25
|
/**
|
26
|
* Creates a new PaletteTemplateEntry with the given template.
|
27
|
*
|
28
|
* @param label
|
29
|
* the entry's name
|
30
|
* @param shortDesc
|
31
|
* the entry's description
|
32
|
* @param template
|
33
|
* the template for this entry
|
34
|
* @param iconSmall
|
35
|
* an ImageDescriptor for the entry's small icon
|
36
|
* @param iconLarge
|
37
|
* an ImageDescriptor for the entry's large icon
|
38
|
* @see PaletteEntry#PaletteEntry(String, String, ImageDescriptor,
|
39
|
* ImageDescriptor, Object)
|
40
|
*/
|
41
|
public PaletteTemplateEntry(String label, String shortDesc,
|
42
|
Object template, ImageDescriptor iconSmall,
|
43
|
ImageDescriptor iconLarge) {
|
44
|
super(label, shortDesc, iconSmall, iconLarge, PALETTE_TYPE_TEMPLATE);
|
45
|
setTemplate(template);
|
46
|
}
|
47
|
|
48
|
/**
|
49
|
* @return the user-defined template object
|
50
|
*/
|
51
|
public Object getTemplate() {
|
52
|
return template;
|
53
|
}
|
54
|
|
55
|
/**
|
56
|
* Sets the template object to the given value
|
57
|
*
|
58
|
* @param template
|
59
|
* the template object
|
60
|
*/
|
61
|
public void setTemplate(Object template) {
|
62
|
this.template = template;
|
63
|
}
|
64
|
|
65
|
}
|