]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.diagram/src/org/simantics/diagram/symbolcontribution/SymbolItem.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / symbolcontribution / SymbolItem.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.diagram.symbolcontribution;\r
13 \r
14 import org.simantics.diagram.symbollibrary.ISymbolGroup;\r
15 import org.simantics.diagram.symbollibrary.ISymbolItem;\r
16 \r
17 /**\r
18  * @author Tuukka Lehtonen\r
19  */\r
20 public abstract class SymbolItem extends NamedObject implements ISymbolItem {\r
21 \r
22     private final ISymbolGroup group;\r
23     private final String description;\r
24 \r
25     public SymbolItem(Object identification, String name, ISymbolGroup group) {\r
26         this(identification, name, name, group);\r
27     }\r
28 \r
29     public SymbolItem(Object identification, String name, String description, ISymbolGroup group) {\r
30         super(identification, name);\r
31         if (description == null)\r
32             throw new NullPointerException("null description");\r
33         if (group == null)\r
34             throw new NullPointerException("null group");\r
35         this.description = description;\r
36         this.group = group;\r
37     }\r
38 \r
39     @Override\r
40     public String getDescription() {\r
41         return description;\r
42     }\r
43 \r
44     @Override\r
45     public ISymbolGroup getGroup() {\r
46         return group;\r
47     }\r
48 \r
49 }