]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/node/StandardNodes.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.browsing.ui.common / src / org / simantics / browsing / ui / common / node / StandardNodes.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.browsing.ui.common.node;
13
14 import org.simantics.browsing.ui.BuiltinKeys;
15 import org.simantics.browsing.ui.NodeContext;
16 import org.simantics.browsing.ui.NodeContext.ConstantKey;
17 import org.simantics.browsing.ui.common.NodeContextBuilder;
18
19 public class StandardNodes {
20
21     public static final ConstantKey<Object> CONTEXT = new ConstantKey<Object>() {
22         @Override
23         public String toString() {
24             return "Context";
25         }
26     };
27
28     public static final ConstantKey<Object> CONTEXT2 = new ConstantKey<Object>() {
29         @Override
30         public String toString() {
31             return "Context2";
32         }
33     };
34
35     public static final ConstantKey<Object> FUNCTION = new ConstantKey<Object>() {
36         @Override
37         public String toString() {
38             return "Function";
39         }
40     };
41
42     private static ConstantKey<?>[] KEYS3 = { BuiltinKeys.INPUT, CONTEXT, FUNCTION };
43     private static ConstantKey<?>[] KEYS4 = { BuiltinKeys.INPUT, CONTEXT, CONTEXT2, FUNCTION };
44
45     public static <Input, Context, Function> NodeContext build(Input input, Context context, Function function) {
46         return NodeContextBuilder.buildWithData(KEYS3, new Object[] { input, context, function });
47     }
48
49     public static <Input, Context, Context2, Function> NodeContext build(Input input, Context context, Context2 context2, Function function) {
50         return NodeContextBuilder.buildWithData(KEYS4, new Object[] { input, context, context2, function });
51     }
52
53 }