]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.debug.browser/src/org/simantics/debug/browser/internal/rewriters/ResourceLookupCreator.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.debug.browser / src / org / simantics / debug / browser / internal / rewriters / ResourceLookupCreator.java
1 /*******************************************************************************\r
2  * Copyright (c) 2016 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  *     THTH ry - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.debug.browser.internal.rewriters;\r
13 \r
14 import org.simantics.db.ReadGraph;\r
15 import org.simantics.db.exception.DatabaseException;\r
16 import org.simantics.debug.browser.content.ResourceBrowserContent;\r
17 import org.simantics.debug.browser.content.ResourceBrowserRewriter;\r
18 import org.simantics.debug.browser.sections.ResourceLookupSection;\r
19 \r
20 /**\r
21  * @author Jani Simomaa / Semantum Oy\r
22  * @since 1.22\r
23  */\r
24 public enum ResourceLookupCreator implements ResourceBrowserRewriter {\r
25     INSTANCE;\r
26 \r
27     private ResourceLookupSection lookupSection;\r
28     \r
29     ResourceLookupCreator() {\r
30         lookupSection = new ResourceLookupSection();\r
31     }\r
32     \r
33     @Override\r
34     public double getPriority() {\r
35         return lookupSection.getPriority();\r
36     }\r
37 \r
38     @Override\r
39     public void rewrite(ReadGraph graph, ResourceBrowserContent content) throws DatabaseException {\r
40         content.putSection(ResourceLookupSection.class, lookupSection);\r
41     }\r
42 }\r