fStyleSheetStatus= new StatusInfo(); fOverviewStatus= new StatusInfo(); fAntStatus= new StatusInfo(); if (fStyleSheetButton.getSelection()) { Path stylePath= new Path(fStyleSheetText.getText()); File file= new File(fStyleSheetText.getText()); if (!stylePath.toFile().exists() || !stylePath.getFileExtension().equalsIgnoreCase("css")) { fStyleSheetStatus.setError("Not a valid stylesheet."); } } if (fOverViewButton.getSelection()) { Path overviewPath= new Path(fOverViewText.getText()); if (!overviewPath.toFile().exists() || !overviewPath.getFileExtension().equalsIgnoreCase("html")) { fOverviewStatus.setError("Not a valid html document."); } } if (fAntButton.getSelection()) { IPath antPath= new Path(fAntText.getText()); String ext= antPath.getFileExtension(); IPath antSeg= antPath.removeLastSegments(1);  if ((!antSeg.isValidPath(antSeg.toOSString())) || (ext == null) || !(ext.equalsIgnoreCase("xml"))) fAntStatus.setError("Not a valid Ant file name."); else if (antPath.toFile().exists()) fAntStatus.setWarning("The generated ant file will overwrite the existing ant file.");
switch (VALIDATE) { case STYLESHEETSTATUS : fStyleSheetStatus = new StatusInfo(); path = new Path(fStyleSheetText.getText()); file = new File(fStyleSheetText.getText()); ext = path.getFileExtension(); if ((file == null) || !file.exists()) { fStyleSheetStatus.setError("Stylesheet path not found."); } else if ((ext == null) || !ext.equalsIgnoreCase("css")) { fStyleSheetStatus.setError("Stylesheet must be a css document."); } break;  case OVERVIEWSTATUS : fOverviewStatus = new StatusInfo(); path = new Path(fOverViewText.getText()); file = path.toFile(); ext = path.getFileExtension(); if ((file == null) || !file.exists()) { fOverviewStatus.setError("Overview path not found."); } else if ((ext == null) || !ext.equalsIgnoreCase("html")) { fOverviewStatus.setError("Overview must be an html document."); } break; case ANTSTATUS : fAntStatus = new StatusInfo(); path = new Path(fAntText.getText()); ext = path.getFileExtension(); IPath antSeg = path.removeLastSegments(1);  if ((!antSeg.isValidPath(antSeg.toOSString())) || (ext == null) || !(ext.equalsIgnoreCase("xml"))) fAntStatus.setError("Not a valid Ant file name."); else if (path.toFile().exists()) fAntStatus.setWarning( "The generated ant file will overwrite the existing ant file."); break;
	private void doValidation() {		fStyleSheetStatus= new StatusInfo();		fOverviewStatus= new StatusInfo();		fAntStatus= new StatusInfo();		if (fStyleSheetButton.getSelection()) {			Path stylePath= new Path(fStyleSheetText.getText());			File file= new File(fStyleSheetText.getText());			if (!stylePath.toFile().exists() || !stylePath.getFileExtension().equalsIgnoreCase("css")) {				fStyleSheetStatus.setError("Not a valid stylesheet.");			}		}		if (fOverViewButton.getSelection()) {			Path overviewPath= new Path(fOverViewText.getText());			if (!overviewPath.toFile().exists() || !overviewPath.getFileExtension().equalsIgnoreCase("html")) {				fOverviewStatus.setError("Not a valid html document.");			}		}		if (fAntButton.getSelection()) {			IPath antPath= new Path(fAntText.getText());			String ext= antPath.getFileExtension();			IPath antSeg= antPath.removeLastSegments(1);						if ((!antSeg.isValidPath(antSeg.toOSString())) || (ext == null) || !(ext.equalsIgnoreCase("xml")))				fAntStatus.setError("Not a valid Ant file name.");			else if (antPath.toFile().exists())				fAntStatus.setWarning("The generated ant file will overwrite the existing ant file.");		}		updateStatus(findMostSevereStatus());	}