Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-09-04 14:01:21 +0000
committercletavernie2012-09-04 14:01:21 +0000
commit0ffb6ecd61374bbfd181d3b74a50b8b8249948d5 (patch)
tree8b1cef91c3d54051e3f5de80d3ed43186a35bcef /incoming/org.eclipse.papyrus.eclipse.project.editors/src/org/eclipse/papyrus/eclipse/project/editors/file/BundlePropertiesEditor.java
parent1dc96930ea65272fa24edc3c62b0ccb40dd6e5dd (diff)
downloadorg.eclipse.papyrus-0ffb6ecd61374bbfd181d3b74a50b8b8249948d5.tar.gz
org.eclipse.papyrus-0ffb6ecd61374bbfd181d3b74a50b8b8249948d5.tar.xz
org.eclipse.papyrus-0ffb6ecd61374bbfd181d3b74a50b8b8249948d5.zip
351695: Create a new plugin to edit project files
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351695 Move to Incoming
Diffstat (limited to 'incoming/org.eclipse.papyrus.eclipse.project.editors/src/org/eclipse/papyrus/eclipse/project/editors/file/BundlePropertiesEditor.java')
-rw-r--r--incoming/org.eclipse.papyrus.eclipse.project.editors/src/org/eclipse/papyrus/eclipse/project/editors/file/BundlePropertiesEditor.java67
1 files changed, 67 insertions, 0 deletions
diff --git a/incoming/org.eclipse.papyrus.eclipse.project.editors/src/org/eclipse/papyrus/eclipse/project/editors/file/BundlePropertiesEditor.java b/incoming/org.eclipse.papyrus.eclipse.project.editors/src/org/eclipse/papyrus/eclipse/project/editors/file/BundlePropertiesEditor.java
new file mode 100644
index 00000000000..4cc9a9e7a44
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.eclipse.project.editors/src/org/eclipse/papyrus/eclipse/project/editors/file/BundlePropertiesEditor.java
@@ -0,0 +1,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