temporary re-factoring project
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / project / model / LTTngExperimentFolder.java
1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.lttng.ui.views.project.model;
14
15 import org.eclipse.core.internal.resources.Folder;
16 import org.eclipse.core.resources.IFolder;
17 import org.eclipse.core.resources.IResource;
18 import org.eclipse.core.runtime.CoreException;
19
20 /**
21 * <b><u>LTTngExperimentFolder</u></b>
22 * <p>
23 * TODO: Implement me. Please.
24 */
25 @SuppressWarnings("restriction")
26 public class LTTngExperimentFolder {
27
28 private final Folder fExperimentFolder;
29 private final LTTngProject fProject;
30 private LTTngExperimentEntry[] experiments = new LTTngExperimentEntry[0];
31
32 /**
33 * @param resource
34 */
35 public LTTngExperimentFolder(LTTngProject project, Folder folder) {
36 fExperimentFolder = folder;
37 fProject = project;
38 try {
39 IResource[] resources = folder.members();
40 int nbExperiments = resources.length;
41 experiments = new LTTngExperimentEntry[nbExperiments];
42 for (int i = 0; i < nbExperiments; i++) {
43 if (resources[i] instanceof IFolder) {
44 experiments[i] = new LTTngExperimentEntry(project, (IFolder) resources[i]);
45 }
46 }
47 } catch (CoreException e) {
48 // TODO Auto-generated catch block
49 e.printStackTrace();
50 }
51 }
52
53 /**
54 *
55 */
56 public LTTngProject getProject() {
57 return fProject;
58 }
59
60 /**
61 *
62 */
63 public Folder getFolder() {
64 return fExperimentFolder;
65 }
66
67 /**
68 *
69 */
70 public String getName() {
71 return fExperimentFolder.getName();
72 }
73 /**
74 *
75 */
76 public LTTngExperimentEntry[] getExperiments() {
77 return experiments;
78 }
79
80
81 }
This page took 0.031199 seconds and 5 git commands to generate.