/** * Returns a boolean indicating whether the passed File handle is is valid and available for * use. * * @param antScriptFile the ant script * @return boolean */ private boolean ensureAntScriptFileIsValid(File antScriptFile) { if (antScriptFile.exists() && antScriptFile.isDirectory() && fAntScriptNamesCombo.getText().length() > 0) { setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationIsDir); fAntScriptNamesCombo.setFocus(); return false; } if (antScriptFile.exists()) { if (!antScriptFile.canWrite()) { setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationUnwritable); fAntScriptNamesCombo.setFocus(); return false; } } return true; }
/** * Returns a boolean indicating whether the passed File handle is is valid and available for * use. * * @param antScriptFile the ant script * @return boolean */ private boolean ensureAntScriptFileIsValid(File antScriptFile) { if (antScriptFile.exists() && antScriptFile.isDirectory() && fAntScriptNamesCombo.getText().length() > 0) { setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationIsDir); fAntScriptNamesCombo.setFocus(); return false; } if (antScriptFile.exists()) { if (!antScriptFile.canWrite()) { setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationUnwritable); fAntScriptNamesCombo.setFocus(); return false; } } return true; }
private boolean validateAntScriptGroup() { if (!fAntScriptSaveCheckbox.getSelection()) // save as ant not selected return true; if (fAntScriptNamesCombo.getText().length() == 0) { setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationMissing); return false; } if (fAntScriptLocation.toString().endsWith("/")) { //$NON-NLS-1$ setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationIsDir); fAntScriptNamesCombo.setFocus(); return false; } // Inform user about relative directory if (!(new File(fAntScriptNamesCombo.getText()).isAbsolute())) setInfoMessage(FatJarPackagerMessages.FatJarPackageWizardPage_info_antScriptLocationRelative); return ensureAntScriptFileIsValid(fAntScriptLocation.toFile()); }
private boolean validateAntScriptGroup() { if (!fAntScriptSaveCheckbox.getSelection()) // save as ant not selected return true; if (fAntScriptNamesCombo.getText().length() == 0) { setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationMissing); return false; } if (fAntScriptLocation.toString().endsWith("/")) { //$NON-NLS-1$ setErrorMessage(FatJarPackagerMessages.FatJarPackageWizardPage_error_antScriptLocationIsDir); fAntScriptNamesCombo.setFocus(); return false; } // Inform user about relative directory if (!(new File(fAntScriptNamesCombo.getText()).isAbsolute())) setInfoMessage(FatJarPackagerMessages.FatJarPackageWizardPage_info_antScriptLocationRelative); return ensureAntScriptFileIsValid(fAntScriptLocation.toFile()); }
/** * clear all previously set messages and error-messages */ private void clearMessages() { if (getErrorMessage() != null) setErrorMessage(null); if (getMessage() != null) setMessage(null); }
/** * clear all previously set messages and error-messages */ private void clearMessages() { if (getErrorMessage() != null) setErrorMessage(null); if (getMessage() != null) setMessage(null); }