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