Commit | Line | Data |
---|---|---|
291cbdbf BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2012 Ericsson | |
cfdb727a | 3 | * |
291cbdbf BH |
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 | |
cfdb727a AM |
8 | * |
9 | * Contributors: | |
291cbdbf BH |
10 | * Bernd Hufmann - Initial API and implementation |
11 | **********************************************************************/ | |
12 | package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs; | |
13 | ||
14 | import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; | |
15 | ||
16 | /** | |
291cbdbf BH |
17 | * <p> |
18 | * Helper class for storing information about a remote file to import. | |
19 | * </p> | |
cfdb727a | 20 | * |
dbd4432d | 21 | * @author Bernd Hufmann |
291cbdbf BH |
22 | */ |
23 | public class ImportFileInfo { | |
24 | ||
25 | // ------------------------------------------------------------------------ | |
26 | // Attributes | |
27 | // ------------------------------------------------------------------------ | |
dbd4432d BH |
28 | /** |
29 | * Remote file reference | |
30 | */ | |
291cbdbf | 31 | private IRemoteFile fRemoteFile; |
dbd4432d BH |
32 | /** |
33 | * Local Trace Name | |
34 | */ | |
291cbdbf | 35 | private String fLocalTraceName; |
dbd4432d BH |
36 | /** |
37 | * Global overwrite flag | |
38 | */ | |
291cbdbf BH |
39 | private boolean fIsOverwrite; |
40 | ||
cd9821de BH |
41 | private boolean fIsKernel; |
42 | ||
291cbdbf BH |
43 | // ------------------------------------------------------------------------ |
44 | // Constructors | |
45 | // ------------------------------------------------------------------------ | |
dbd4432d BH |
46 | /** |
47 | * Standard constructor | |
cd9821de BH |
48 | * |
49 | * @param file | |
50 | * A remote file reference | |
51 | * @param traceName | |
52 | * A trace name | |
53 | * @param isOverwrite | |
54 | * global overwrite flag | |
55 | * @param isKernel | |
56 | * <code>true</code> if it is a kernel trace else | |
57 | * <code>false</code> | |
dbd4432d | 58 | */ |
cd9821de | 59 | public ImportFileInfo(IRemoteFile file, String traceName, boolean isOverwrite, boolean isKernel) { |
291cbdbf BH |
60 | fRemoteFile = file; |
61 | fLocalTraceName = traceName; | |
62 | fIsOverwrite = isOverwrite; | |
cd9821de | 63 | fIsKernel = isKernel; |
291cbdbf BH |
64 | } |
65 | ||
66 | // ------------------------------------------------------------------------ | |
67 | // Accessors | |
68 | // ------------------------------------------------------------------------ | |
69 | /** | |
70 | * @return name of traces after importing | |
71 | */ | |
72 | public String getLocalTraceName() { | |
73 | return fLocalTraceName; | |
74 | } | |
cd9821de | 75 | |
291cbdbf BH |
76 | /** |
77 | * Sets the local trace name | |
cd9821de BH |
78 | * |
79 | * @param importTraceName | |
80 | * - local name of trace to set (name after importing) | |
291cbdbf BH |
81 | */ |
82 | public void setLocalTraceName(String importTraceName) { | |
83 | this.fLocalTraceName = importTraceName; | |
84 | } | |
85 | /** | |
86 | * @return true if local trace should be overwritten if a trace with the same name already exists. | |
87 | */ | |
88 | public boolean isOverwrite() { | |
89 | return fIsOverwrite; | |
90 | } | |
91 | /** | |
92 | * Sets the overwrite flag. | |
cfdb727a | 93 | * @param isOverwrite If the Overwrite checkbox is checked or not |
291cbdbf BH |
94 | */ |
95 | public void setOverwrite(boolean isOverwrite) { | |
96 | this.fIsOverwrite = isOverwrite; | |
97 | } | |
cd9821de | 98 | |
291cbdbf BH |
99 | /** |
100 | * @return the remote file implementation. | |
101 | */ | |
102 | public IRemoteFile getImportFile() { | |
103 | return fRemoteFile; | |
104 | } | |
cd9821de | 105 | |
291cbdbf BH |
106 | /** |
107 | * Sets the remote file implementation | |
cd9821de BH |
108 | * |
109 | * @param remoteFile | |
110 | * The remote file implementation. | |
291cbdbf BH |
111 | */ |
112 | public void setRemoteFile(IRemoteFile remoteFile) { | |
113 | fRemoteFile = remoteFile; | |
114 | } | |
cd9821de BH |
115 | |
116 | /** | |
117 | * Returns whether it is a kernel trace or not | |
118 | * | |
119 | * @return <code>true</code> if it is a kernel trace else <code>false</code> | |
120 | */ | |
121 | public boolean isKernel() { | |
122 | return fIsKernel; | |
123 | } | |
124 | ||
125 | /** | |
126 | * Sets whether it is a kernel trace or not | |
127 | * | |
128 | * @param isKernel | |
129 | * <code>true</code> for kernel trace else <code>false</code> | |
130 | */ | |
131 | public void setKernel(boolean isKernel) { | |
132 | fIsKernel = isKernel; | |
133 | } | |
291cbdbf BH |
134 | } |
135 |