1 2 25 26 27 package org.aspectj.tools.ajbrowser; 28 29 import java.util.*; 30 import java.io.*; 31 import org.aspectj.ajde.*; 32 import org.aspectj.ajde.ui.*; 33 34 public class BrowserProperties implements ProjectPropertiesAdapter { 35 36 UserPreferencesAdapter preferencesAdapter = null; 37 38 public BrowserProperties(UserPreferencesAdapter preferencesAdapter) { 39 this.preferencesAdapter = preferencesAdapter; 40 } 41 42 public String getLastOpenSourceFilePath() { 43 return preferencesAdapter.getProjectPreference("editor.lastOpenFile"); 44 } 45 46 public void setLastOpenSourceFilePath(String value) { 47 preferencesAdapter.setProjectPreference("editor.lastOpenFile",value); 48 } 49 50 public String getLastOpenSourceLineNumber() { 51 return preferencesAdapter.getProjectPreference("editor.lastOpenLineNumber"); 52 } 53 54 public void setLastOpenSourceLineNumber(String value) { 55 preferencesAdapter.setProjectPreference("editor.lastOpenLineNumber",value); 56 } 57 58 public List getBuildConfigFiles() { 59 return BrowserManager.getDefault().getConfigFiles(); 60 } 61 62 public String getDefaultBuildConfigFile() { 63 return null; 64 } 65 66 public String getLastActiveBuildConfigFile() { 67 return null; 68 } 69 70 public String getProjectName() { 71 return null; 72 } 73 74 public String getClassToExecute() { 75 return preferencesAdapter.getProjectPreference("runtime.mainClass"); 76 } 77 78 public void setClassToExecute(String mainClass) { 79 preferencesAdapter.setProjectPreference("runtime.mainClass", mainClass); 80 } 81 82 public String getRootProjectDir() { 83 return new File(Ajde.getDefault().getConfigurationManager().getActiveConfigFile()).getParent(); 84 } 85 86 public String getExecutionArgs() { 87 return null; 88 } 89 90 public List getProjectSourceFiles() { 91 return null; 92 } 93 94 public String getVmArgs() { 95 return null; 96 } 97 98 public String getProjectSourcePath() { 99 return null; 100 } 101 102 public String getBootClasspath() { 103 return null; 104 } 105 106 public void setAjcOptions(String flags) { 107 preferencesAdapter.setProjectPreference("build.flags", flags); 108 } 109 110 public String getAjcOptions() { 111 return preferencesAdapter.getProjectPreference("build.flags"); 112 } 113 114 public String getOutputPath() { 115 String outputPath = preferencesAdapter.getProjectPreference("build.outputpath"); 116 if (outputPath == null) { 117 return "."; 118 } else { 119 return outputPath; 120 } 121 } 122 123 public void setOutputPath(String path) { 124 preferencesAdapter.setProjectPreference("build.outputpath", path); 125 } 126 127 public String getUserClasspath() { 128 return preferencesAdapter.getProjectPreference("build.classpath"); 129 } 130 131 public String getClasspath() { 132 String systemPath = System.getProperty("java.class.path", "."); 133 String userPath = preferencesAdapter.getProjectPreference("build.classpath"); 134 return userPath + File.pathSeparator + systemPath; 135 } 136 137 public void setClasspath(String path) { 138 preferencesAdapter.setProjectPreference("build.classpath", path); 139 } 140 141 public String getAjcWorkingDir() { 142 String workingDir = preferencesAdapter.getProjectPreference("build.workingdir"); 143 if (workingDir == null || workingDir.equals(getOutputPath())) { 144 return getOutputPath() + "./ajworkingdir"; 145 } else { 146 return workingDir; 147 } 148 } 149 150 public void setAjcWorkingDir(String path) { 151 preferencesAdapter.setProjectPreference("build.workingdir", path); 152 } 153 } 154 | Popular Tags |