Package org.eclipse.core.resources

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


      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

                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

                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

                    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

      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

    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

      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

        getButton(IDialogConstants.OK_ID).setEnabled(false);
    }

    private void updateButtons() {
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      boolean allowCreation = workspace.validateName(name, IResource.FOLDER).isOK();
      allowCreation &= !((IFolder) definitionFolder.getParent()).getFolder(name).exists();
        getButton(IDialogConstants.OK_ID).setEnabled(allowCreation);
    }

    @Override
View Full Code Here

    //If the file is vaid checks if the prj can be parsed.
   
    String name = this.prj_name.getText();
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IStatus nameStatus = workspace.validateName(name, IResource.PROJECT);
    if (!nameStatus.isOK()) {
      updateStatus(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.