analysis: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.remote.ui / src / org / eclipse / tracecompass / internal / tmf / remote / ui / wizards / fetch / model / RemoteImportTraceGroupElement.java
1 /*******************************************************************************
2 * Copyright (c) 2015 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 * Marc-Andre Laperle - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.internal.tmf.remote.ui.wizards.fetch.model;
14
15 import org.eclipse.swt.graphics.Image;
16 import org.eclipse.tracecompass.internal.tmf.remote.ui.Activator;
17 import org.eclipse.tracecompass.internal.tmf.ui.project.wizards.tracepkg.TracePackageElement;
18
19 /**
20 * An RemoteImportTraceGroupElement representing the a group of traces under a
21 * root path.
22 *
23 * @author Marc-Andre Laperle
24 */
25 public class RemoteImportTraceGroupElement extends TracePackageElement {
26
27 private static final String IMAGE_PATH = "icons/obj/trace_group.gif"; //$NON-NLS-1$
28 private String fRootImportPath;
29 private boolean fRecursive;
30
31 /**
32 * Constructs an instance of RemoteImportTraceGroupElement
33 *
34 * @param parent
35 * the parent of this element, can be set to null
36 * @param rootImportPath
37 * the root path where the traces should be imported from
38 */
39 public RemoteImportTraceGroupElement(TracePackageElement parent,
40 String rootImportPath) {
41 super(parent);
42 fRootImportPath = rootImportPath;
43 fRecursive = false;
44 }
45
46 @Override
47 public String getText() {
48 return fRootImportPath + (isRecursive() ? " (recursive)" : ""); //$NON-NLS-1$ //$NON-NLS-2$
49 }
50
51 /**
52 * Returns whether or not the group of traces should be imported recursively
53 * from the root path.
54 *
55 * @return whether or not the trace group is recursive
56 */
57 public boolean isRecursive() {
58 return fRecursive;
59 }
60
61 /**
62 * Sets whether or not the group of traces should be imported recursively
63 * from the root path.
64 *
65 * @param recursive
66 * if the element should be recursive
67 */
68 public void setRecursive(boolean recursive) {
69 fRecursive = recursive;
70 }
71
72 @Override
73 public Image getImage() {
74 return Activator.getDefault().getImageFromImageRegistry(IMAGE_PATH);
75 }
76
77 /**
78 * Get the root path where the traces should be imported from.
79 *
80 * @return the root import path
81 */
82 public String getRootImportPath() {
83 return fRootImportPath;
84 }
85
86 /**
87 * Set the root path where the traces should be imported from.
88 *
89 * @param rootImportPath
90 * the root import path
91 */
92 public void setRootImportPath(String rootImportPath) {
93 fRootImportPath = rootImportPath;
94 }
95 }
This page took 0.05143 seconds and 5 git commands to generate.