01: package com.bostechcorp.cbesb.ui.variant.utils;
02:
03: import java.util.List;
04:
05: import org.eclipse.swt.widgets.TreeItem;
06:
07: import com.bostechcorp.cbesb.ui.baseformat.editor.models.ModelFactory;
08: import com.bostechcorp.cbesb.ui.util.ProjectUtil;
09: import com.bostechcorp.cbesb.ui.variant.editor.editors.VariantEditor;
10:
11: public class PathRetrieval {
12:
13: private static String file_name = "";
14:
15: public static String receivePath(VariantEditor editor,
16: TreeItem item, int nodetype) {
17: if ((nodetype == ModelFactory.TYPE_VARIANT_SEG)
18: || (nodetype == ModelFactory.TYPE_VARIANT_MES)) {
19:
20: file_name = "";
21: file_name = file_name + editor.getProjectName();
22:
23: file_name = file_name
24: + "::"
25: + editor.getAnalyze().getVersion()
26: + "/"
27: + editor.getAnalyze().getName()
28: + "/"
29: + item.getText().substring(0,
30: item.getText().lastIndexOf("."));
31: if ((nodetype == ModelFactory.TYPE_VARIANT_SEG))
32: file_name = file_name + "/" + "segment";
33: else
34: file_name = file_name + "/" + "message";
35: } else {
36: file_name = "";
37: List list = ProjectUtil.getRelatedProject(editor
38: .getProjectName());
39: file_name = file_name + editor.getProjectName();
40: if (list.size() > 1) {
41: file_name = file_name
42: + "::"
43: + list
44: .get(1)
45: .toString()
46: .substring(
47: list.get(1).toString().indexOf(
48: "/") + 1,
49: list.get(1).toString().length());
50: }
51: file_name = file_name
52: + "::"
53: + editor.getAnalyze().getVersion()
54: + "//"
55: + item.getText().substring(0,
56: item.getText().lastIndexOf("."));
57:
58: if ((nodetype == ModelFactory.TYPE_BASE_SEG))
59: file_name = file_name + "/" + "segment";
60: else
61: file_name = file_name + "/" + "message";
62: }
63:
64: return file_name;
65: }
66:
67: }
|