Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 4cc9a9e7a44d8dab02c39b0b0e731e125e6809b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package org.eclipse.papyrus.eclipse.project.editors.file;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

import org.eclipse.core.resources.IProject;
import org.eclipse.papyrus.eclipse.project.editors.Activator;
import org.eclipse.papyrus.infra.widgets.util.FileUtil;


public class BundlePropertiesEditor extends AbstractFileEditor {

	/** the build config */
	private Properties bundleConfig;

	/** the buidl file */
	private File bundleFile;

	private String filePath;

	public BundlePropertiesEditor(IProject project, String filePath) {
		super(project);
		this.filePath = filePath;

	}

	@Override
	public void init() {
		this.bundleFile = getBundleProperties();
		//		if(this.bundleFile != null && this.bundleFile.exists()) {
		try {
			this.bundleConfig.load(new FileInputStream(this.bundleFile));
		} catch (FileNotFoundException e) {
			Activator.log.error(e);
		} catch (IOException e) {
			Activator.log.error(e);
		}
		//		}
	}

	public void createFiles(Set<String> files) {
		// TODO Auto-generated method stub

	}

	public void save() {
		// TODO Auto-generated method stub

	}

	public String getValue(String propertyName) {
		return this.bundleConfig.getProperty(propertyName);

	}





	private File getBundleProperties() {
		return this.bundleFile = FileUtil.getWorkspaceFile("/" + getProject().getName() + "/" + filePath + ".properties"); //$NON-NLS-1$ //$NON-NLS-2$
	}
}

Back to the top