| 1 | /********************************************************************** |
| 2 | * Copyright (c) 2012 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 | * 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 | /** |
| 17 | * <p> |
| 18 | * Helper class for storing information about a remote file to import. |
| 19 | * </p> |
| 20 | * |
| 21 | * @author Bernd Hufmann |
| 22 | */ |
| 23 | public class ImportFileInfo { |
| 24 | |
| 25 | // ------------------------------------------------------------------------ |
| 26 | // Attributes |
| 27 | // ------------------------------------------------------------------------ |
| 28 | /** |
| 29 | * Remote file reference |
| 30 | */ |
| 31 | private IRemoteFile fRemoteFile; |
| 32 | /** |
| 33 | * Local Trace Name |
| 34 | */ |
| 35 | private String fLocalTraceName; |
| 36 | /** |
| 37 | * Global overwrite flag |
| 38 | */ |
| 39 | private boolean fIsOverwrite; |
| 40 | |
| 41 | // ------------------------------------------------------------------------ |
| 42 | // Constructors |
| 43 | // ------------------------------------------------------------------------ |
| 44 | /** |
| 45 | * Standard constructor |
| 46 | * @param file A remote file reference |
| 47 | * @param traceName A trace name |
| 48 | * @param isOverwrite global overwrite flag |
| 49 | */ |
| 50 | public ImportFileInfo(IRemoteFile file, String traceName, boolean isOverwrite) { |
| 51 | fRemoteFile = file; |
| 52 | fLocalTraceName = traceName; |
| 53 | fIsOverwrite = isOverwrite; |
| 54 | } |
| 55 | |
| 56 | // ------------------------------------------------------------------------ |
| 57 | // Accessors |
| 58 | // ------------------------------------------------------------------------ |
| 59 | /** |
| 60 | * @return name of traces after importing |
| 61 | */ |
| 62 | public String getLocalTraceName() { |
| 63 | return fLocalTraceName; |
| 64 | } |
| 65 | /** |
| 66 | * Sets the local trace name |
| 67 | * @param importTraceName - local name of trace to set (name after importing) |
| 68 | */ |
| 69 | public void setLocalTraceName(String importTraceName) { |
| 70 | this.fLocalTraceName = importTraceName; |
| 71 | } |
| 72 | /** |
| 73 | * @return true if local trace should be overwritten if a trace with the same name already exists. |
| 74 | */ |
| 75 | public boolean isOverwrite() { |
| 76 | return fIsOverwrite; |
| 77 | } |
| 78 | /** |
| 79 | * Sets the overwrite flag. |
| 80 | * @param isOverwrite |
| 81 | */ |
| 82 | public void setOverwrite(boolean isOverwrite) { |
| 83 | this.fIsOverwrite = isOverwrite; |
| 84 | } |
| 85 | /** |
| 86 | * @return the remote file implementation. |
| 87 | */ |
| 88 | public IRemoteFile getImportFile() { |
| 89 | return fRemoteFile; |
| 90 | } |
| 91 | /** |
| 92 | * Sets the remote file implementation |
| 93 | * @param the remote file implementation. |
| 94 | */ |
| 95 | public void setRemoteFile(IRemoteFile remoteFile) { |
| 96 | fRemoteFile = remoteFile; |
| 97 | } |
| 98 | } |
| 99 | |