[Pydev-cvs] org.python.pydev.debug/src/org/python/pydev/debug/codecoverage NodeNotFoudException.java
Brought to you by:
fabioz
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5079/src/org/python/pydev/debug/codecoverage Modified Files: RunManyDialog.java CoverageCache.java PyCodeCoverageView.java PyCoverage.java Added Files: NodeNotFoudException.java Log Message: Index: PyCodeCoverageView.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage/PyCodeCoverageView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyCodeCoverageView.java 15 Oct 2004 19:53:28 -0000 1.3 --- PyCodeCoverageView.java 18 Oct 2004 19:13:13 -0000 1.4 *************** *** 40,43 **** --- 40,45 ---- import org.python.pydev.tree.FileTreeLabelProvider; import org.python.pydev.tree.FileTreePyFilesProvider; + import org.python.pydev.utils.ProgressAction; + import org.python.pydev.utils.ProgressOperation; /** *************** *** 60,64 **** //layout stuff ! private Composite rComposite; //actions --- 62,66 ---- //layout stuff ! private Composite leftComposite; //actions *************** *** 76,90 **** * choose new dir */ ! private Action chooseAction = new ChooseAction(); /** * clear the results (and erase .coverage file) */ ! protected Action clearAction = new ClearAction();; /** * get the new results from the .coverage file */ ! protected Action refreshAction = new RefreshAction();; //buttons --- 78,92 ---- * choose new dir */ ! private ProgressAction chooseAction = new ChooseAction(); /** * clear the results (and erase .coverage file) */ ! protected ProgressAction clearAction = new ClearAction(); /** * get the new results from the .coverage file */ ! protected RefreshAction refreshAction = new RefreshAction(); //buttons *************** *** 107,111 **** private SashForm s; ! //Actions ------------------------------ /** --- 109,114 ---- private SashForm s; ! ! //Actions ------------------------------ /** *************** *** 115,121 **** * @author Fabio Zadrozny */ ! private final class RefreshAction extends Action { public void run() { ! PyCoverage.getPyCoverage().refreshCoverageInfo(lastChosenFile); viewer.setInput(lastChosenFile); //new files may have been added. text.setText("Refreshed info."); --- 118,125 ---- * @author Fabio Zadrozny */ ! private final class RefreshAction extends ProgressAction { public void run() { ! PyCoverage.getPyCoverage().refreshCoverageInfo(lastChosenFile, this.monitor); ! viewer.setInput(lastChosenFile); //new files may have been added. text.setText("Refreshed info."); *************** *** 127,131 **** * @author Fabio Zadrozny */ ! private final class ClearAction extends Action { public void run() { --- 131,135 ---- * @author Fabio Zadrozny */ ! private final class ClearAction extends ProgressAction { public void run() { *************** *** 173,177 **** * @author Fabio Zadrozny */ ! private final class DoubleClickTreeAction extends Action { public void run() { --- 177,181 ---- * @author Fabio Zadrozny */ ! private final class DoubleClickTreeAction extends ProgressAction { public void run() { *************** *** 192,196 **** File realFile = new File(obj.toString()); if (realFile.exists() && !realFile.isDirectory()) { - System.out.println("opening file:" + obj.toString()); ItemPointer p = new ItemPointer(realFile, new Location(-1, -1), null); PyOpenAction act = new PyOpenAction(); --- 196,199 ---- *************** *** 217,221 **** MarkerAttributeMap map = new MarkerAttributeMap(); int errorLine = ((Integer)it.next()).intValue()-1; - // System.out.println("adding at:"+errorLine); IRegion region = document.getLineInformation(errorLine); --- 220,223 ---- *************** *** 247,251 **** * @author Fabio Zadrozny */ ! private final class ChooseAction extends Action { public void run() { DirectoryDialog dialog = new DirectoryDialog(getSite().getShell()); --- 249,253 ---- * @author Fabio Zadrozny */ ! private final class ChooseAction extends ProgressAction { public void run() { DirectoryDialog dialog = new DirectoryDialog(getSite().getShell()); *************** *** 257,260 **** --- 259,263 ---- File file = new File(string); lastChosenFile = file; + refreshAction.monitor = this.monitor; refreshAction.run(); } *************** *** 298,302 **** parent = s; ! rComposite = new Composite(parent, SWT.MULTI); layout = new GridLayout(); layout.numColumns = 1; --- 301,305 ---- parent = s; ! leftComposite = new Composite(parent, SWT.MULTI); layout = new GridLayout(); layout.numColumns = 1; *************** *** 309,316 **** layoutData.horizontalAlignment = GridData.FILL; layoutData.verticalAlignment = GridData.FILL; ! rComposite.setLayoutData(layoutData); ! rComposite.setLayout(layout); ! text = new Text(parent, SWT.MULTI); try { text.setFont(new Font(null, "Courier new", 10, 0)); --- 312,320 ---- layoutData.horizontalAlignment = GridData.FILL; layoutData.verticalAlignment = GridData.FILL; ! leftComposite.setLayoutData(layoutData); ! leftComposite.setLayout(layout); ! ! text = new Text(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); try { text.setFont(new Font(null, "Courier new", 10, 0)); *************** *** 325,329 **** text.setLayoutData(layoutData); ! parent = rComposite; //choose button --- 329,336 ---- text.setLayoutData(layoutData); ! ! ! ! parent = leftComposite; //choose button *************** *** 367,371 **** * @param string */ ! private void createButton(Composite parent, Button button, String txt, final Action action) { GridData layoutData; button.setText(txt); --- 374,378 ---- * @param string */ ! private void createButton(Composite parent, Button button, String txt, final ProgressAction action) { GridData layoutData; button.setText(txt); *************** *** 373,377 **** public void widgetSelected(SelectionEvent e) { ! action.run(); } --- 380,384 ---- public void widgetSelected(SelectionEvent e) { ! ProgressOperation.startAction(getSite().getShell(),action ); } Index: CoverageCache.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage/CoverageCache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CoverageCache.java 15 Oct 2004 19:53:28 -0000 1.2 --- CoverageCache.java 18 Oct 2004 19:13:13 -0000 1.3 *************** *** 94,98 **** if (folderNode == null){ ! throw new RuntimeException("A file node MUST have a related folder node."); } --- 94,98 ---- if (folderNode == null){ ! throw new RuntimeException("A file node ("+node.toString()+")MUST have a related folder node."); } *************** *** 107,116 **** } ! public List getFiles(Object node){ FolderNode folderNode = (FolderNode) getFolder(node); if (folderNode == null){ FileNode fileNode = (FileNode) getFile(node); if (fileNode == null){ ! throw new RuntimeException("The node has not been found: "+node.toString()); } ArrayList list = new ArrayList(); --- 107,116 ---- } ! public List getFiles(Object node) throws NodeNotFoudException{ FolderNode folderNode = (FolderNode) getFolder(node); if (folderNode == null){ FileNode fileNode = (FileNode) getFile(node); if (fileNode == null){ ! throw new NodeNotFoudException("The node has not been found: "+node.toString()); } ArrayList list = new ArrayList(); *************** *** 160,183 **** - List list = getFiles(node); //array of FileNode - StringBuffer buffer = new StringBuffer(); ! //40 chars for name. ! buffer.append("Name Stmts Exec Cover Missing\n"); ! buffer.append("-----------------------------------------------------------------------------\n"); ! ! int totalExecuted = 0; ! int totalStmts = 0; ! ! for (Iterator it = list.iterator(); it.hasNext();) { ! FileNode element = (FileNode) it.next(); ! buffer.append(element.toString()+"\n"); ! totalExecuted += element.exec; ! totalStmts += element.stmts; } - - buffer.append("-----------------------------------------------------------------------------\n"); - buffer.append(FileNode.toString("TOTAL",totalStmts, totalExecuted, "")+"\n"); - return buffer.toString(); } --- 160,187 ---- StringBuffer buffer = new StringBuffer(); ! try { ! List list = getFiles(node); //array of FileNode ! ! //40 chars for name. ! buffer.append("Name Stmts Exec Cover Missing\n"); ! buffer.append("-----------------------------------------------------------------------------\n"); ! ! int totalExecuted = 0; ! int totalStmts = 0; ! ! for (Iterator it = list.iterator(); it.hasNext();) { ! FileNode element = (FileNode) it.next(); ! buffer.append(element.toString()+"\n"); ! totalExecuted += element.exec; ! totalStmts += element.stmts; ! } ! ! buffer.append("-----------------------------------------------------------------------------\n"); ! buffer.append(FileNode.toString("TOTAL",totalStmts, totalExecuted, "")+"\n"); ! ! } catch (NodeNotFoudException e) { ! buffer.append("File has no statistics."); } return buffer.toString(); } --- NEW FILE: NodeNotFoudException.java --- /* * Created on Oct 18, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.debug.codecoverage; /** * @author Fabio Zadrozny */ public class NodeNotFoudException extends Exception { /** * @param string */ public NodeNotFoudException(String string) { super(string); } } Index: PyCoverage.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage/PyCoverage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyCoverage.java 15 Oct 2004 19:53:28 -0000 1.3 --- PyCoverage.java 18 Oct 2004 19:13:13 -0000 1.4 *************** *** 20,23 **** --- 20,25 ---- import org.eclipse.core.runtime.CoreException; + import org.eclipse.core.runtime.IProgressMonitor; + import org.eclipse.core.runtime.NullProgressMonitor; import org.python.pydev.debug.core.PydevDebugPlugin; import org.python.pydev.debug.ui.launching.PythonRunnerConfig; *************** *** 48,53 **** * @param file should be the root folder from where we want cache info. */ ! public void refreshCoverageInfo(File file) { cache.clear(); try { if(file.isDirectory() == false){ --- 50,58 ---- * @param file should be the root folder from where we want cache info. */ ! public void refreshCoverageInfo(File file, IProgressMonitor monitor) { cache.clear(); + if(file == null){ + return; + } try { if(file.isDirectory() == false){ *************** *** 58,62 **** if (file.exists()) { ! pyFilesBelow = getPyFilesBelow(file); } --- 63,67 ---- if (file.exists()) { ! pyFilesBelow = getPyFilesBelow(file, monitor, true); } *************** *** 99,103 **** cmdLine[2] = "-waitfor"; ! Process p=null; --- 104,109 ---- cmdLine[2] = "-waitfor"; ! monitor.setTaskName("Starting shell to get info..."); ! monitor.worked(1); Process p=null; *************** *** 106,131 **** p = execute(cmdLine); //we have the process... ! int bufsize = 64; // small bufsize so that we can see the progress BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()), bufsize); - BufferedReader eIn = new BufferedReader(new InputStreamReader(p.getErrorStream()), bufsize); String files = ""; for (Iterator iter = pyFilesBelow[0].iterator(); iter.hasNext();) { ! files += iter.next().toString()+" "; } files += "\r"; p.getOutputStream().write(files.getBytes()); p.getOutputStream().close(); String str = ""; ! while ((str = eIn.readLine()) != null) { ! // System.out.println("STDERR: " + str); //ignore this... ! } ! eIn.close(); while ((str = in.readLine()) != null) { // System.out.println("STDOUT: " + str);//get the data... StringTokenizer tokenizer = new StringTokenizer(str); ! if(tokenizer.countTokens() ==5){ String []strings = new String[5]; --- 112,138 ---- p = execute(cmdLine); //we have the process... ! int bufsize = 32; // small bufsize so that we can see the progress BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()), bufsize); String files = ""; for (Iterator iter = pyFilesBelow[0].iterator(); iter.hasNext();) { ! String fStr = iter.next().toString(); ! files += fStr+"|"; } files += "\r"; + monitor.setTaskName("Writing to shell..."); + monitor.worked(1); p.getOutputStream().write(files.getBytes()); p.getOutputStream().close(); String str = ""; ! monitor.setTaskName("Getting coverage info...(please wait, this could take a while)"); ! monitor.worked(1); while ((str = in.readLine()) != null) { // System.out.println("STDOUT: " + str);//get the data... StringTokenizer tokenizer = new StringTokenizer(str); ! int nTokens = tokenizer.countTokens(); ! if(nTokens == 5 || nTokens == 4){ String []strings = new String[5]; *************** *** 136,151 **** } ! if(strings[1].equals("Stmts") == false){ //information in the format: D:\dev_programs\test\test1.py 11 0 0% 1,2,4-23 // System.out.println("VALID: " + str);//get the data... File f = new File(strings[0]); ! cache.addFile(f, f.getParentFile(), Integer.parseInt(strings[1]), Integer.parseInt(strings[2]), strings[4]); } } } in.close(); ! System.out.println("waiting"); p.waitFor(); ! System.out.println("finished"); } catch (Exception e) { if(p!=null){ --- 143,170 ---- } ! if(strings[1].equals("Stmts") == false && strings[0].equals("TOTAL") == false){ //information in the format: D:\dev_programs\test\test1.py 11 0 0% 1,2,4-23 // System.out.println("VALID: " + str);//get the data... File f = new File(strings[0]); ! if(nTokens == 4){ ! cache.addFile(f, f.getParentFile(), Integer.parseInt(strings[1]), Integer.parseInt(strings[2]), ""); ! }else{ ! cache.addFile(f, f.getParentFile(), Integer.parseInt(strings[1]), Integer.parseInt(strings[2]), strings[4]); ! } ! String[] strs = f.toString().replaceAll("/", " ").replaceAll("\\\\"," ").split(" "); ! if (strs.length > 1){ ! monitor.setTaskName("Getting coverage info..."+strs[strs.length -1]); ! }else{ ! monitor.setTaskName("Getting coverage info..."+f.toString()); ! } ! monitor.worked(1); } } } in.close(); ! monitor.setTaskName("Waiting for process to finish..."); ! monitor.worked(1); p.waitFor(); ! monitor.setTaskName("Finished"); } catch (Exception e) { if(p!=null){ *************** *** 205,209 **** * @return tuple with files in pos 0 and folders in pos 1 */ ! public static List[] getPyFilesBelow(File file , FileFilter filter) { List filesToReturn = new ArrayList(); List folders = new ArrayList(); --- 224,231 ---- * @return tuple with files in pos 0 and folders in pos 1 */ ! public static List[] getPyFilesBelow(File file , FileFilter filter, IProgressMonitor monitor) { ! if(monitor == null){ ! monitor = new NullProgressMonitor(); ! } List filesToReturn = new ArrayList(); List folders = new ArrayList(); *************** *** 222,231 **** for (int i = 0; i < files.length; i++) { ! List[] below = getPyFilesBelow(files[i]); filesToReturn.addAll(below[0]); folders.addAll(below[1]); } } else if (file.isFile()) { filesToReturn.add(file); } } --- 244,256 ---- for (int i = 0; i < files.length; i++) { ! List[] below = getPyFilesBelow(files[i], filter, monitor); filesToReturn.addAll(below[0]); folders.addAll(below[1]); + monitor.worked(1); } } else if (file.isFile()) { filesToReturn.add(file); + monitor.worked(1); + monitor.setTaskName("Found:"+file.toString()); } } *************** *** 240,252 **** * @return tuple with files in pos 0 and folders in pos 1 */ ! public static List[] getPyFilesBelow(File file) { FileFilter filter = new FileFilter() { public boolean accept(File pathname) { ! return pathname.isDirectory() || pathname.toString().endsWith(".py"); } }; ! return getPyFilesBelow(file, filter); } --- 265,280 ---- * @return tuple with files in pos 0 and folders in pos 1 */ ! public static List[] getPyFilesBelow(File file, IProgressMonitor monitor, final boolean includeDirs) { FileFilter filter = new FileFilter() { public boolean accept(File pathname) { ! if(includeDirs) ! return pathname.isDirectory() || pathname.toString().endsWith(".py"); ! else ! return pathname.isDirectory() == false || pathname.toString().endsWith(".py"); } }; ! return getPyFilesBelow(file, filter, monitor); } Index: RunManyDialog.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/codecoverage/RunManyDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RunManyDialog.java 15 Oct 2004 19:53:28 -0000 1.1 --- RunManyDialog.java 18 Oct 2004 19:13:12 -0000 1.2 *************** *** 9,33 **** import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; /** * @author Fabio Zadrozny */ ! public class RunManyDialog extends Dialog{ private String root; ! public Text textRootFolder; ! public Text textFilesThatMatch; ! public Text textWorkingDir; ! public Text textInterpreter; public String rootFolder; public String files; public String interpreter; public String working; /** * @param parentShell --- 9,65 ---- import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; + import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; + import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; + import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; + import org.eclipse.swt.widgets.Widget; + import org.python.pydev.plugin.PydevPrefs; /** * @author Fabio Zadrozny */ ! public class RunManyDialog extends Dialog implements Listener { private String root; ! ! private Text textRootFolder; ! ! private Text textFilesThatMatch; ! ! private Text textWorkingDir; ! ! private Text textInterpreter; ! ! private Button check; ! ! private Text textScriptLocation; ! ! private Text textScriptArgs; ! ! //output gotten here. public String rootFolder; + public String files; + public String interpreter; + public String working; + public String scriptArgs; + + public String scriptLocation; + + public boolean scriptSelected; + + private Label labelScript0; + + private Label labelScript1; + + private Label labelFilesThatMatch; + /** * @param parentShell *************** *** 41,47 **** protected Control createDialogArea(Composite parent) { ! // create a composite with standard margins and spacing ! Composite composite = (Composite) super.createDialogArea(parent); ! GridData layoutData = new GridData(); layoutData.grabExcessHorizontalSpace = true; --- 73,79 ---- protected Control createDialogArea(Composite parent) { ! // create a composite with standard margins and spacing ! Composite composite = (Composite) super.createDialogArea(parent); ! GridData layoutData = new GridData(); layoutData.grabExcessHorizontalSpace = true; *************** *** 50,53 **** --- 82,101 ---- layoutData.verticalAlignment = GridData.FILL; + Label label0 = new Label(composite, 0); + label0 + .setText("Two runs can be specified now...\n" + + "If a script is not specified, each file to be executed will have its own shell and output.\n" + + "If a script is specified, it should receive the root folder and the args as parameters,\n" + + "and it should take the responsibility for selecting the files and executing each one.\n" + + "This can be very useful if many tests should be run with a single output (and for instance,\n" + + "you want to execute only unit-tests and see the output in a formated way)."); + label0.setLayoutData(layoutData); + + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + layoutData.verticalAlignment = GridData.FILL; + Label label = new Label(composite, 0); label.setText("Root folder:"); *************** *** 69,75 **** layoutData.horizontalAlignment = GridData.FILL; layoutData.verticalAlignment = GridData.FILL; ! Label label2 = new Label(composite, 0); ! label2.setText("Files that match:"); ! label2.setLayoutData(layoutData); layoutData = new GridData(); --- 117,123 ---- layoutData.horizontalAlignment = GridData.FILL; layoutData.verticalAlignment = GridData.FILL; ! labelFilesThatMatch = new Label(composite, 0); ! labelFilesThatMatch.setText("Files that match (see JAVA regular expression):"); ! labelFilesThatMatch.setLayoutData(layoutData); layoutData = new GridData(); *************** *** 79,83 **** layoutData.verticalAlignment = GridData.FILL; textFilesThatMatch = new Text(composite, SWT.SINGLE); ! textFilesThatMatch.setText("test*.py"); textFilesThatMatch.setLayoutData(layoutData); --- 127,131 ---- layoutData.verticalAlignment = GridData.FILL; textFilesThatMatch = new Text(composite, SWT.SINGLE); ! textFilesThatMatch.setText("test.*\\.py"); textFilesThatMatch.setLayoutData(layoutData); *************** *** 117,137 **** layoutData.verticalAlignment = GridData.FILL; textInterpreter = new Text(composite, SWT.SINGLE); ! textInterpreter.setText("python"); textInterpreter.setLayoutData(layoutData); return composite; ! } ! ! /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ protected void okPressed() { ! rootFolder = textRootFolder.getText(); ! files = textFilesThatMatch.getText(); ! interpreter = textInterpreter.getText(); ! working = textWorkingDir.getText(); // TODO Auto-generated method stub super.okPressed(); } ! } --- 165,265 ---- layoutData.verticalAlignment = GridData.FILL; textInterpreter = new Text(composite, SWT.SINGLE); ! textInterpreter.setText(PydevPrefs.getDefaultInterpreter()); textInterpreter.setLayoutData(layoutData); + //------- + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + layoutData.verticalAlignment = GridData.FILL; + check = new Button(composite, SWT.CHECK); + check.setText("Use script that receives: RootFolder args"); + check.setLayoutData(layoutData); + + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + layoutData.verticalAlignment = GridData.FILL; + labelScript0 = new Label(composite, 0); + labelScript0.setText("Script location (absolute)"); + labelScript0.setLayoutData(layoutData); + + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + layoutData.verticalAlignment = GridData.FILL; + textScriptLocation = new Text(composite, SWT.SINGLE); + textScriptLocation.setText("X:\\coilib30\\tools\\runtests.py"); + textScriptLocation.setLayoutData(layoutData); + + //------- + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + layoutData.verticalAlignment = GridData.FILL; + labelScript1 = new Label(composite, 0); + labelScript1.setText("Aditional args for script."); + labelScript1.setLayoutData(layoutData); + + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.grabExcessVerticalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + layoutData.verticalAlignment = GridData.FILL; + textScriptArgs = new Text(composite, SWT.SINGLE); + textScriptArgs.setLayoutData(layoutData); + + check.addListener(SWT.Selection, this); + check.setSelection(true); + this.showDependingOnCheck(true); + return composite; ! } ! /* ! * (non-Javadoc) ! * * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ protected void okPressed() { ! rootFolder = textRootFolder.getText(); ! files = textFilesThatMatch.getText(); ! interpreter = textInterpreter.getText(); ! working = textWorkingDir.getText(); ! ! scriptArgs = textScriptArgs.getText(); ! scriptLocation = textScriptLocation.getText(); ! scriptSelected = check.getSelection(); // TODO Auto-generated method stub super.okPressed(); } ! ! /* ! * (non-Javadoc) ! * ! * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event) ! */ ! public void handleEvent(Event e) { ! Widget source = e.widget; ! if (source == check) { ! boolean sel = check.getSelection(); ! showDependingOnCheck(sel); ! } ! } ! ! /** ! * @param sel ! */ ! private void showDependingOnCheck(boolean sel) { ! textScriptLocation.setVisible(sel); ! textScriptArgs.setVisible(sel); ! labelScript0.setVisible(sel); ! labelScript1.setVisible(sel); ! labelFilesThatMatch.setVisible(!sel); ! textFilesThatMatch.setVisible(!sel); ! } ! } \ No newline at end of file |