diff --git a/res/menu/editormenu.xml b/res/menu/editormenu.xml
index 3bda40d..7d94f0f 100644
--- a/res/menu/editormenu.xml
+++ b/res/menu/editormenu.xml
@@ -1,6 +1,7 @@
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9870fb6..7bd3533 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -18,4 +18,5 @@
Filetype
Location to Put File
Create
+ Remove Opened File
diff --git a/src/com/eyecreate/AndroidProject.java b/src/com/eyecreate/AndroidProject.java
index 64f1d42..e40790c 100644
--- a/src/com/eyecreate/AndroidProject.java
+++ b/src/com/eyecreate/AndroidProject.java
@@ -314,6 +314,11 @@ public void addNewFileToProject(File file)
triggerProjectStateSave();
}
+ public void removeFileFromProject(File file)
+ {
+ if(!projectFiles.remove(file)) triggerProjectStateSave();
+ }
+
public File getMainProjectFile()
{
return mainProjectFile;
diff --git a/src/com/eyecreate/DroiddeActivity.java b/src/com/eyecreate/DroiddeActivity.java
index 5869e4f..c40256b 100644
--- a/src/com/eyecreate/DroiddeActivity.java
+++ b/src/com/eyecreate/DroiddeActivity.java
@@ -186,6 +186,13 @@ public void openFileInEditor(File f)
EditorFragment edFragment = (EditorFragment) fragman.findFragmentById(R.id.fileeditor);
edFragment.openFile(f);
}
+
+ public void removeFileFromProject(File f)
+ {
+ ProjectFilesFragment projectFiles = (ProjectFilesFragment) fragman.findFragmentById(R.id.filelist);
+ loadedProject.removeFileFromProject(f);
+ projectFiles.AddFilesToList(loadedProject.getProjectFiles());
+ }
private boolean checkFileForProject(String path) {
DocumentBuilder builder;
diff --git a/src/com/eyecreate/EditorFragment.java b/src/com/eyecreate/EditorFragment.java
index 5ea0b4b..80f331a 100644
--- a/src/com/eyecreate/EditorFragment.java
+++ b/src/com/eyecreate/EditorFragment.java
@@ -50,6 +50,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
case R.id.savefile:
if(openedFile != null) saveFile(openedFile);
return true;
+ case R.id.removefile:
+ if(openedFile != null) removeFile(openedFile);
+ return true;
default:
return super.onOptionsItemSelected(item);
}
@@ -110,6 +113,11 @@ public void openFile(File f)
}
+ public void removeFile(File f)
+ {
+ ((DroiddeActivity)this.getActivity()).removeFileFromProject(f);
+ }
+
public void saveFile(File f)
{
RichEditText ret = (RichEditText) getActivity().findViewById(R.id.editorcontent);
diff --git a/src/com/eyecreate/Project.java b/src/com/eyecreate/Project.java
index a593052..caab8b6 100644
--- a/src/com/eyecreate/Project.java
+++ b/src/com/eyecreate/Project.java
@@ -32,5 +32,7 @@ public interface Project {
public abstract void setMainProjectFile(File f);
public abstract void addNewFileToProject(File f);
+
+ public abstract void removeFileFromProject(File f);
}
\ No newline at end of file