]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/imagers/SingleImageURLs.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.browsing.ui.common / src / org / simantics / browsing / ui / common / imagers / SingleImageURLs.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.imagers;
13
14 import java.net.URL;
15
16 public class SingleImageURLs implements ImageURLs {
17
18         private final String columnKey;
19         private final URL url;
20         
21         public SingleImageURLs(String columnKey, URL url) {
22                 if(url == null) throw new IllegalArgumentException("Null url.");
23                 this.url = url;
24                 if(columnKey == null) throw new IllegalArgumentException("Null columnKey.");
25                 this.columnKey = columnKey;
26         }
27
28         @Override
29         public URL getURL(String columnKey) {
30                 if(this.columnKey.equals(columnKey)) return url;
31                 else return null;
32         }
33         
34 }