|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 * TraceBuilder project file properties |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracebuilder.engine.project; |
|
20 |
|
21 import com.nokia.tracebuilder.file.FileUtils; |
|
22 import com.nokia.tracebuilder.project.TraceProjectFile; |
|
23 import com.nokia.tracebuilder.source.SourceConstants; |
|
24 |
|
25 /** |
|
26 * TraceBuilder project file properties |
|
27 * |
|
28 */ |
|
29 final class TraceBuilderProject extends TraceProjectFile { |
|
30 |
|
31 /** |
|
32 * Title shown in UI |
|
33 */ |
|
34 private static final String TITLE = Messages |
|
35 .getString("TraceBuilderProject.Title"); //$NON-NLS-1$ |
|
36 |
|
37 /** |
|
38 * Constructor |
|
39 * |
|
40 * @param absolutePath |
|
41 * the path to the file, including file name |
|
42 */ |
|
43 TraceBuilderProject(String absolutePath) { |
|
44 super(absolutePath, true); |
|
45 } |
|
46 |
|
47 /** |
|
48 * Constructor |
|
49 * |
|
50 * @param path |
|
51 * the path to the file |
|
52 * @param name |
|
53 * the file name |
|
54 */ |
|
55 TraceBuilderProject(String path, String name) { |
|
56 super(path, name); |
|
57 } |
|
58 |
|
59 /* |
|
60 * (non-Javadoc) |
|
61 * |
|
62 * @see com.nokia.tracebuilder.project.TraceProjectFile#getFileExtension() |
|
63 */ |
|
64 @Override |
|
65 protected String getFileExtension() { |
|
66 return null; |
|
67 } |
|
68 |
|
69 /** |
|
70 * Creates a project file path from path and name |
|
71 * |
|
72 * @param path |
|
73 * the path |
|
74 * @param name |
|
75 * the file name |
|
76 * @return the absolute path |
|
77 */ |
|
78 static String createAbsolutePath(String path, String name) { |
|
79 StringBuffer sb = new StringBuffer(); |
|
80 sb.append(FileUtils.convertSeparators( |
|
81 SourceConstants.FORWARD_SLASH_CHAR, path, true)); |
|
82 sb.append(name); |
|
83 return sb.toString(); |
|
84 } |
|
85 |
|
86 |
|
87 /* |
|
88 * (non-Javadoc) |
|
89 * |
|
90 * @see com.nokia.tracebuilder.project.TraceProjectFile#getTitle() |
|
91 */ |
|
92 @Override |
|
93 public String getTitle() { |
|
94 return TITLE; |
|
95 } |
|
96 |
|
97 } |