tmf: Clean up tmf.ui.project.model
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / project / model / ITmfProjectModelElement.java
1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 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.tracecompass.tmf.ui.project.model;
14
15 import java.net.URI;
16 import java.util.List;
17
18 import org.eclipse.core.resources.IResource;
19 import org.eclipse.core.runtime.IPath;
20
21 /**
22 * The TMF project model interface.
23 *
24 * The TMF tracing project is integrated in the Common Navigator framework.
25 * Each tracing tree element has to implement this interface to be visible in the
26 * Project Explorer.
27 *
28 * @version 1.0
29 * @author Francois Chouinard
30 */
31 public interface ITmfProjectModelElement {
32
33 /**
34 * Returns the name of the project model element.
35 *
36 * @return the name of the project element.
37 */
38 String getName();
39
40 /**
41 * Returns the resource associated with the project model element.
42 *
43 * @return the model resource.
44 */
45 IResource getResource();
46
47 /**
48 * Returns the path of the project model resource.
49 *
50 * @return the resource path.
51 */
52 IPath getPath();
53
54 /**
55 * Returns the URI (location) of the resource.
56 *
57 * @return the resource URI.
58 */
59 URI getLocation();
60
61 /**
62 * Returns the project model element.
63 *
64 * @return the project model element.
65 */
66 TmfProjectElement getProject();
67
68 /**
69 * Returns the parent of this model element.
70 *
71 * @return the parent of this model element.
72 */
73 ITmfProjectModelElement getParent();
74
75 /**
76 * Returns a list of children model elements.
77 *
78 * @return a list of children model elements.
79 */
80 List<ITmfProjectModelElement> getChildren();
81
82 /**
83 * Method to request to refresh the project.
84 */
85 void refresh();
86
87 /**
88 * Returns whether this model element has children or not.
89 *
90 * @return <code>true</code> if this model element has children else
91 * <code>false</code>
92 */
93 default boolean hasChildren() {
94 return !getChildren().isEmpty();
95 }
96 }
This page took 0.033973 seconds and 6 git commands to generate.