1 11 12 package org.eclipse.ant.internal.ui.editor.outline; 13 14 30 31 import java.util.Enumeration ; 32 import java.util.Hashtable ; 33 34 import org.apache.tools.ant.BuildException; 35 import org.apache.tools.ant.BuildListener; 36 import org.apache.tools.ant.Project; 37 38 45 public class AntModelProject extends Project { 46 47 private Hashtable fBaseProperties; 48 private Hashtable fCurrentProperties= new Hashtable (); 49 50 53 public void setNewProperty(String name, String value) { 54 55 if (fCurrentProperties.get(name) != null) { 56 return; 57 } 58 fCurrentProperties.put(name, value); 62 super.setProperty(name, value); 63 } 64 65 68 public void fireBuildFinished(Throwable exception) { 69 super.fireBuildFinished(exception); 70 Enumeration e= getBuildListeners().elements(); 71 while (e.hasMoreElements()) { 72 BuildListener listener = (BuildListener) e.nextElement(); 73 removeBuildListener(listener); 74 } 75 } 76 77 public void reset() { 78 getTargets().clear(); 79 setDefault(null); 80 setDescription(null); 81 setName(""); fCurrentProperties= new Hashtable (); 84 Enumeration e = fBaseProperties.keys(); 85 while (e.hasMoreElements()) { 86 Object name = e.nextElement(); 87 Object value = fBaseProperties.get(name); 88 fCurrentProperties.put(name, value); 89 } 90 } 91 92 95 public String getProperty(String name) { 96 return (String )fCurrentProperties.get(name); 98 } 99 100 103 public Hashtable getProperties() { 104 return fCurrentProperties; 106 } 107 110 public void init() throws BuildException { 111 super.init(); 112 fBaseProperties= super.getProperties(); 113 fCurrentProperties= super.getProperties(); 114 } 115 } | Popular Tags |