View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: SchemaVisualResourceProvider.java
13   * Created: 2009-07-31
14   * Author: czerwin
15   * $Id$
16   */
17  
18  package pl.edu.agh.cast.data.model.resource;
19  
20  import java.util.Arrays;
21  import java.util.List;
22  
23  import pl.edu.agh.cast.Activator;
24  import pl.edu.agh.cast.data.model.domain.IDomainElement;
25  import pl.edu.agh.cast.data.model.presentation.IPresentationElement;
26  import pl.edu.agh.cast.resource.AbstractVisualResourcesProvider;
27  import pl.edu.agh.cast.resource.ImageVariants;
28  import pl.edu.agh.cast.resource.VisualResourceEntry;
29  import pl.edu.agh.cast.util.Messages;
30  
31  /**
32   * Visual resource provider for data-model plug-in.
33   * 
34   * @author AGH CAST Team
35   */
36  public class DataModelVisualResourcesProvider extends AbstractVisualResourcesProvider {
37  
38  	private static final String RESOURCES_PATH_DATA_MODEL_ICON = "data/model/icon"; //$NON-NLS-1$
39  
40  	/**
41  	 * Default group ID.
42  	 */
43  	public static final String DEFAULT_GROUP_ID = "pl.edu.agh.cast.data.model.defaultgroup"; //$NON-NLS-1$
44  
45  	/**
46  	 * Default resource ID.
47  	 */
48  	public static final String DEFAULT_RESOURCE_ID = "pl.edu.agh.cast.data.model.default"; //$NON-NLS-1$
49  
50  	/**
51  	 * ID of opened folder icon resource.
52  	 */
53  	public static final String RESOURCE_OPENED_FOLDER_ID = "pl.edu.agh.cast.data.model.folder.opened"; //$NON-NLS-1$
54  
55  	/**
56  	 * ID of domain data set icon resource.
57  	 */
58  	public static final String RESOURCE_DOMAIN_DATASET_DESCRIPTOR_ID = "pl.edu.agh.cast.data.model.domain.IDomainDataSet"; //$NON-NLS-1$
59  
60  	/**
61  	 * ID of presentation data set icon resource.
62  	 */
63  	public static final String RESOURCE_PRESENTATION_DATASET_DESCRIPTOR_ID = "pl.edu.agh.cast.data.model.presentation.IPresentationDataSet"; //$NON-NLS-1$
64  
65  	private List<VisualResourceEntry> entries = Arrays
66  	        .asList(
67  	        //
68  	                new VisualResourceEntry(
69  	                        DEFAULT_RESOURCE_ID,
70  	                        Arrays.asList(Activator.RESOURCE_TAG_DATA_MODEL),
71  	                        DEFAULT_GROUP_ID,
72  	                        null,
73  	                        Messages.DataModelVisualResourcesProvider_6,
74  	                        Messages.DataModelVisualResourcesProvider_7, RESOURCES_PATH_DATA_MODEL_ICON, "default", //$NON-NLS-1$
75  	                        VisualResourceEntry.RESOURCE_EXTENSION_GIF, Arrays.asList(ImageVariants.VARIANT_OPENED)), //
76  	                new VisualResourceEntry(RESOURCE_OPENED_FOLDER_ID,
77  	                        Arrays.asList(Activator.RESOURCE_TAG_DATA_MODEL), DEFAULT_GROUP_ID, null,
78  	                        Messages.DataModelVisualResourcesProvider_0, Messages.DataModelVisualResourcesProvider_1,
79  	                        RESOURCES_PATH_DATA_MODEL_ICON, "folder", //$NON-NLS-1$
80  	                        VisualResourceEntry.RESOURCE_EXTENSION_GIF, Arrays.asList(ImageVariants.VARIANT_OPENED)), //
81  	                new VisualResourceEntry(RESOURCE_DOMAIN_DATASET_DESCRIPTOR_ID, Arrays
82  	                        .asList(Activator.RESOURCE_TAG_DATA_MODEL), DEFAULT_GROUP_ID, IDomainElement.TYPE,
83  	                        Messages.DataModelVisualResourcesProvider_2, Messages.DataModelVisualResourcesProvider_3,
84  	                        RESOURCES_PATH_DATA_MODEL_ICON, "domain_dataset", //$NON-NLS-1$
85  	                        VisualResourceEntry.RESOURCE_EXTENSION_GIF, null), //
86  	                new VisualResourceEntry(RESOURCE_PRESENTATION_DATASET_DESCRIPTOR_ID, Arrays
87  	                        .asList(Activator.RESOURCE_TAG_DATA_MODEL), DEFAULT_GROUP_ID, IPresentationElement.TYPE,
88  	                        Messages.DataModelVisualResourcesProvider_4, Messages.DataModelVisualResourcesProvider_5,
89  	                        RESOURCES_PATH_DATA_MODEL_ICON, "presentation_dataset", //$NON-NLS-1$
90  	                        VisualResourceEntry.RESOURCE_EXTENSION_GIF, null));
91  
92  	/**
93  	 * Constructor.
94  	 */
95  	public DataModelVisualResourcesProvider() {
96  		initialize(Activator.class, entries);
97  	}
98  
99  }