summaryrefslogtreecommitdiffstats
path: root/logo/src/xlogo/kernel/userspace/context
diff options
context:
space:
mode:
authorMarko Živković <[email protected]>2014-12-17 00:26:30 +0000
committerMarko Živković <[email protected]>2014-12-17 00:26:30 +0000
commit1fd42f81c4a9884f5b702ab9ff854393b2dc5256 (patch)
tree6dd9d770bded4071dadc51a906e2a77bd36e5abd /logo/src/xlogo/kernel/userspace/context
parentfadba92b2f3a41fa35ccadeb6deba540305ae5e6 (diff)
- Limiting number of empty files to 4
- Fixed small issue, where another new line was appended to files whenever the file was opened - Added translations for previously hard coded dialog messages. git-svn-id: https://svn.code.sf.net/p/xlogo4schools/svn/trunk@13 3b0d7934-f7ef-4143-9606-b51f2e2281fd
Diffstat (limited to 'logo/src/xlogo/kernel/userspace/context')
-rw-r--r--logo/src/xlogo/kernel/userspace/context/LogoContext.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/logo/src/xlogo/kernel/userspace/context/LogoContext.java b/logo/src/xlogo/kernel/userspace/context/LogoContext.java
index 6c93e1e..6c4f979 100644
--- a/logo/src/xlogo/kernel/userspace/context/LogoContext.java
+++ b/logo/src/xlogo/kernel/userspace/context/LogoContext.java
@@ -40,6 +40,7 @@ import xlogo.kernel.userspace.GlobalVariableTable;
import xlogo.kernel.userspace.PropertyListTable;
import xlogo.kernel.userspace.files.LogoFile;
import xlogo.kernel.userspace.procedures.Procedure;
+import xlogo.storage.WSManager;
import xlogo.storage.global.GlobalConfig;
/**
* A LogoContext contains all the symbol tables for execution of Logo programs <p>
@@ -122,6 +123,20 @@ public class LogoContext
return guiMap;
}
+ public boolean hasTooManyEmptyFiles(){
+ int max = WSManager.getWorkspaceConfig().getMaxEmptyFiles();
+ int count = 0;
+ for(LogoFile file: files.values()){
+ if (file.isEmpty()){
+ count++;
+ if(count >= max){
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
/*
* Context dependent operations
*/