List of usage examples for org.eclipse.jdt.core JavaConventions validateClassFileName
public static IStatus validateClassFileName(String name)
From source file:org.universaal.tools.newwizard.plugin.wizards.NewItemWizardPage.java
License:Apache License
private void validateInput() { //Check selectors not null if (textClass == null || dropClass == null) { setMessage(Messages.getString("PageI.6")); //$NON-NLS-1$ setPageComplete(false);// w w w. ja v a 2 s .c om return; } //Check class name not empty if (textClass.getText().isEmpty()) { setErrorMessage(Messages.getString("PageI.7")); //$NON-NLS-1$ setPageComplete(false); return; } //Check valid class name String clsName = textClass.getText() + ".class"; //$NON-NLS-1$ if (clsName.trim().length() != 0) { IStatus status = JavaConventions.validateClassFileName(clsName); // TODO: Use new method to check class naming. if (!status.isOK()) { setErrorMessage(status.getMessage()); setPageComplete(false); return; } } else { setErrorMessage(Messages.getString("PageI.8")); //$NON-NLS-1$ setPageComplete(false); return; } //Check selected class if (dropClass.getSelectionIndex() < 0) { setErrorMessage(Messages.getString("PageI.9")); //$NON-NLS-1$ setPageComplete(false); return; } //Check selected MW if (dropMW.getSelectionIndex() < 0) { setMessage(Messages.getString("PageI.10")); //$NON-NLS-1$ setPageComplete(false); return; } setPageComplete(true); setErrorMessage(null); setMessage(null); doStatusUpdate(); }