1 package org.enhydra.kelp.jbuilder.actions; 2 3 import com.borland.primetime.ide.Browser; 4 import com.borland.primetime.ide.BrowserAction; 5 import javax.swing.AbstractAction ; 6 import org.enhydra.kelp.ant.xmlc.AntXMLCTool; 7 import javax.swing.JOptionPane ; 8 import com.borland.primetime.node.Project; 9 import com.borland.primetime.vfs.Url; 10 import java.io.File ; 11 import com.borland.jbuilder.node.JBProject; 12 13 public class XMLCAction extends BrowserAction 14 { 15 16 public XMLCAction(String s, char c) { 17 super(s, c); 18 } 19 20 public void actionPerformed(Browser browser) { 21 String prjPath = null; 22 JBProject project = (JBProject)browser.getActiveProject(); 23 if (project != null) { 24 prjPath = project.getProjectPath().getFullName(); 25 AntXMLCTool.main(new String [] {prjPath}); 26 project.refresh(); 27 } 28 } 29 30 36 public void update(Browser browser) { 37 JBProject project; 38 if (browser.getActiveProject() != null) { 39 project = (JBProject)browser.getActiveProject(); 40 setEnabled( (project instanceof JBProject) && 41 (project.getProperty("enhydra.project", "false") 42 .equalsIgnoreCase("true")) ); 43 } else { 44 setEnabled(false); 45 } 46 } 47 48 } | Popular Tags |