1 /*******************************************************************************
\r
2 * Copyright (c) 2012 Association for Decentralized Information Management in
\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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.diagram.handler;
\r
14 import java.util.Map;
\r
16 import org.simantics.db.RequestProcessor;
\r
17 import org.simantics.db.layer0.util.SimanticsClipboard.Representation;
\r
18 import org.simantics.utils.datastructures.hints.IHintContext.Key;
\r
19 import org.simantics.utils.datastructures.hints.IHintContext.KeyOf;
\r
22 * @author Tuukka Lehtonen
\r
24 public class DiagramSelectionRepresentation implements Representation {
\r
27 * A key for describing a DiagramSelection representation for the Simantics
\r
30 public static final Key KEY_DIAGRAM_SELECTION = new KeyOf(DiagramSelection.class);
\r
32 private DiagramSelection selection;
\r
34 public DiagramSelectionRepresentation(DiagramSelection selection) {
\r
35 this.selection = selection;
\r
39 public Key getKey() {
\r
40 return KEY_DIAGRAM_SELECTION;
\r
43 @SuppressWarnings("unchecked")
\r
45 public <T> T getValue(RequestProcessor processor, Map<String,Object> hints) {
\r
46 return (T) selection;
\r