Examples of validateName()


Examples of com.massivecraft.factions.entity.FactionColl.validateName()

      msg("<b>That name is already taken");
      return;
    }

    ArrayList<String> errors = new ArrayList<String>();
    errors.addAll(factionColl.validateName(newName));
    if (errors.size() > 0)
    {
      sendMessage(errors);
      return;
    }
View Full Code Here

Examples of org.eclipse.core.internal.resources.LocationValidator.validateName()

                setErrorMessage("Name must not start with number");
                return false;
            }
            String fileName = textField + ".cls";
            String metaName = textField + ".cls-meta.xml";
            IStatus status = v.validateName(fileName, 0); //type didn't seem to matter, so just used 0
            if (status.getCode() != IStatus.OK) {
                setErrorMessage("Creating a file name of " + fileName + " is invalid because: " + status.getMessage());
                return false;
            }
            status = v.validateName(metaName, 0); //type didn't seem to matter, so just used 0
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

        setMessage(null);

        String name = fProjText.getText().trim();
        if (name.length() > 0) {
            IWorkspace workspace = ResourcesPlugin.getWorkspace();
            IStatus status = workspace.validateName(name, IResource.PROJECT);
            if (status.isOK()) {
                IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
                if (!project.exists()) {
                    setErrorMessage(MessageFormat.format("Project {0} does not exist", new String[] { name}));
                    return false;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

      typeName = typeName.trim(); // grammar allows spaces
      char[] scannedID = scannedIdentifier(typeName, sourceLevel, complianceLevel);
      if (scannedID == null) {
        return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.convention_illegalIdentifier, typeName), null);
      }
      IStatus status = workspace.validateName(new String(scannedID), IResource.FOLDER);
      if (!status.isOK()) {
        return status;
      }
      if (firstToken && scannedID.length > 0 && ScannerHelper.isUpperCase(scannedID[0])) {
        if (warningStatus == null) {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

                return;
            }

            // check whether the project name is valid
            @SuppressWarnings("unused")
            final IStatus nameStatus = workspace.validateName(name, IResource.PROJECT);
            if (!nameStatus.isOK()) {
                setErrorMessage(nameStatus.getMessage());
                setPageComplete(false);
                return;
            }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

                return;
            }

            // check whether the project name is valid
            @SuppressWarnings("unused")
            final IStatus nameStatus = workspace.validateName(name, IResource.PROJECT);
            if (!nameStatus.isOK()) {
                setErrorMessage(nameStatus.getMessage());
                setPageComplete(false);
                return;
            }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

                    String text = ((ITextSelection) selection).getText();
                    if (text != null) {
                        text = text.trim();
                        if (text.length() > 0) {
                            final IWorkspace workspace = ResourcesPlugin.getWorkspace();
                            final IStatus result = workspace.validateName(text,
                                    IResource.FILE);
                            if (result.isOK()) {
                                setInitialPattern(text);
                            }
                        }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

      typeName = typeName.trim(); // grammar allows spaces
      char[] scannedID = scannedIdentifier(typeName, sourceLevel, complianceLevel);
      if (scannedID == null) {
        return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.convention_illegalIdentifier, typeName), null);
      }
      IStatus status = workspace.validateName(new String(scannedID), IResource.FOLDER);
      if (!status.isOK()) {
        return status;
      }
      if (firstToken && scannedID.length > 0 && ScannerHelper.isUpperCase(scannedID[0])) {
        if (warningStatus == null) {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

    setMessage(null);
   
    String name = projectText.getText().trim();
    if (name.length() > 0) {
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      IStatus status = workspace.validateName(name, IResource.PROJECT);
      if (status.isOK()) {
        IProject project= ResourcesPlugin.getWorkspace().getRoot().getProject(name);
        if (!project.exists()) {
          setErrorMessage(MessageFormat.format(BEHAVIOUR_CHOOSING_ERROR, new String[] {name})); //$NON-NLS-1$
          return false;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspace.validateName()

      setErrorMessage(null);
      setMessage("Please enter project name.");
      return false;
    }

    IStatus nameStatus = workspace.validateName(projectName, IResource.PROJECT);
    if (!nameStatus.isOK()) {
      setErrorMessage(nameStatus.getMessage());
      return false;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.