X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Futil%2FSimanticsClipboardImpl.java;h=b760d578b62e8990d81c7b605a2f8332cc133638;hp=c4f39290148cea54a5a2a80d9831b7407ffa802c;hb=refs%2Fchanges%2F38%2F238%2F2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/SimanticsClipboardImpl.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/SimanticsClipboardImpl.java index c4f392901..b760d578b 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/SimanticsClipboardImpl.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/SimanticsClipboardImpl.java @@ -1,54 +1,54 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.layer0.util; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Set; - -import org.simantics.utils.datastructures.collections.CollectionUtils; - -final public class SimanticsClipboardImpl implements SimanticsClipboard, SimanticsClipboardBuilder { - - final private ArrayList> objects = new ArrayList>(); - - public SimanticsClipboardImpl() { - } - - public SimanticsClipboardImpl(Representation representation) { - addContent(Collections.singleton(representation)); - } - - public SimanticsClipboardImpl(Representation ... representation) { - addContent(CollectionUtils.toSet(representation)); - } - - @Override - public Collection> getContents() { - return objects; - } - - @Override - public void addContent(Set content) { - objects.add(content); - } - - static SimanticsClipboard single(Representation representation) { - return new SimanticsClipboardImpl(representation); - } - - static SimanticsClipboard make(Representation ... representations) { - return new SimanticsClipboardImpl(representations); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db.layer0.util; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; + +import org.simantics.utils.datastructures.collections.CollectionUtils; + +final public class SimanticsClipboardImpl implements SimanticsClipboard, SimanticsClipboardBuilder { + + final private ArrayList> objects = new ArrayList>(); + + public SimanticsClipboardImpl() { + } + + public SimanticsClipboardImpl(Representation representation) { + addContent(Collections.singleton(representation)); + } + + public SimanticsClipboardImpl(Representation ... representation) { + addContent(CollectionUtils.toSet(representation)); + } + + @Override + public Collection> getContents() { + return objects; + } + + @Override + public void addContent(Set content) { + objects.add(content); + } + + static SimanticsClipboard single(Representation representation) { + return new SimanticsClipboardImpl(representation); + } + + static SimanticsClipboard make(Representation ... representations) { + return new SimanticsClipboardImpl(representations); + } + +}