Examples of IStatus


Examples of org.eclipse.core.runtime.IStatus

      // simple name
      scannedID = scannedIdentifier(name, sourceLevel, complianceLevel);
    } else {
      // qualified name
      String pkg = name.substring(0, index).trim();
      IStatus status = validatePackageName(pkg, sourceLevel, complianceLevel);
      if (!status.isOK()) {
        return status;
      }
      String type = name.substring(index + 1).trim();
      scannedID = scannedIdentifier(type, sourceLevel, complianceLevel);
    }
 
    if (scannedID != null) {
      IStatus status = ResourcesPlugin.getWorkspace().validateName(new String(scannedID), IResource.FILE);
      if (!status.isOK()) {
        return status;
      }
      if (CharOperation.contains('$', scannedID)) {
        return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Messages.convention_type_dollarName, null);
      }
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

        }
    }
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    StringTokenizer st = new StringTokenizer(name, "."); //$NON-NLS-1$
    boolean firstToken = true;
    IStatus warningStatus = null;
    while (st.hasMoreTokens()) {
      String typeName = st.nextToken();
      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) {
          warningStatus = new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Messages.convention_package_uppercaseName, null);
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

* Equivalent to <code>(IJavaModelStatus) getStatus()</code>.
*
* @return a status object
*/
public IJavaModelStatus getJavaModelStatus() {
  IStatus status = this.getStatus();
  if (status instanceof IJavaModelStatus) {
    return (IJavaModelStatus)status;
  } else {
    // A regular IStatus is created only in the case of a CoreException.
    // See bug 13492 Should handle JavaModelExceptions that contains CoreException more gracefully 
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

* @see Openable
* @see Signature
*/
protected boolean buildStructure(OpenableElementInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws JavaModelException {
  // check whether the class file can be opened
  IStatus status = validateClassFile();
  if (!status.isOK()) throw newJavaModelException(status);
  if (underlyingResource != null && !underlyingResource.isAccessible()) throw newNotPresentException();

  IBinaryType typeInfo = getBinaryTypeInfo((IFile) underlyingResource);
  if (typeInfo == null) {
    // The structure of a class file is unknown if a class file format errors occurred
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

    JavaModelManager.getJavaModelManager().closeZipFile(zip);
  }
  return null;
}
public IBuffer getBuffer() throws JavaModelException {
  IStatus status = validateClassFile();
  if (status.isOK()) {
    return super.getBuffer();
  } else {
    // .class file not on classpath, create a new buffer to be nice (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=41444)
    Object info = ((ClassFile) getClassFile()).getBinaryTypeInfo((IFile) getResource());
    IBuffer buffer = openBuffer(null, info);
    if (buffer != null && !(buffer instanceof NullBuffer))
      return buffer;
    if (status.getCode() == IJavaModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH)
      return null; // don't throw a JavaModelException to be able to open .class file outside the classpath (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=138507)
    throw new JavaModelException((IJavaModelStatus) status);
  }
}
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

              if (!firstLevelPackageNames.contains(firstLevelPackageName)) {
                if (sourceLevel == null) {
                  sourceLevel = project.getOption(JavaCore.COMPILER_SOURCE, true);
                  complianceLevel = project.getOption(JavaCore.COMPILER_COMPLIANCE, true);
                }
                IStatus status = JavaConventions.validatePackageName(firstLevelPackageName, sourceLevel, complianceLevel);
                if (status.isOK() || status.getSeverity() == IStatus.WARNING) {
                  firstLevelPackageNames.add(firstLevelPackageName);
                }
              }
            } else if (Util.isClassFileName(entryName)) {
              containsADefaultPackage = true;
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

                    oscSharedReferenceCopies.remove( originalEntry );
                    oscSharedWorkingCopies.remove( originalEntry );
                    // save by executing the LDIF
                    UpdateEntryRunnable runnable = new UpdateEntryRunnable( originalEntry, diff
                        .toFormattedString( LdifFormatParameters.DEFAULT ) );
                    IStatus status = RunnableContextRunner.execute( runnable, null, handleError );
                    // put entry back to map
                    oscSharedReferenceCopies.put( originalEntry, referenceCopy );
                    oscSharedWorkingCopies.put( originalEntry, workingCopy );
                    if ( status.isOK() )
                    {
                        updateOscSharedReferenceCopy( originalEntry );
                        updateOscSharedWorkingCopy( originalEntry );
                    }
                    return status;
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

     *
     * @return the status or null if there was nothing to save
     */
    public IStatus saveSharedWorkingCopy( boolean handleError, IEntryEditor editor )
    {
        IStatus status = BrowserUIPlugin.getDefault().getEntryEditorManager().saveSharedWorkingCopy(
            getResolvedEntry(), handleError, editor );
        return status;
    }
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

            {
                Connection connection = getTestConnection();
                IBrowserConnection browserConnection = new BrowserConnection( connection );

                FetchBaseDNsRunnable runnable = new FetchBaseDNsRunnable( browserConnection );
                IStatus status = RunnableContextRunner.execute( runnable, runnableContext, true );
                if ( status.isOK() )
                {
                    if ( !runnable.getBaseDNs().isEmpty() )
                    {
                        List<String> baseDNs = runnable.getBaseDNs();
                        baseDNCombo.setItems( baseDNs.toArray( new String[baseDNs.size()] ) );
View Full Code Here

Examples of org.eclipse.core.runtime.IStatus

            connection.getConnectionParameter().setBindPrincipal( entry.getDn().getUpName() );
            connection.getConnectionParameter().setBindPassword( testPasswordText.getText() );
            connection.getConnectionParameter().setAuthMethod( AuthenticationMethod.SIMPLE );

            CheckBindRunnable runnable = new CheckBindRunnable( connection );
            IStatus status = RunnableContextRunner.execute( runnable, null, true );
            if ( status.isOK() )
            {
                MessageDialog.openInformation( Display.getDefault().getActiveShell(), Messages
                    .getString( "PasswordDialog.CheckAuthentication" ), //$NON-NLS-1$
                    Messages.getString( "PasswordDialog.AuthenticationSuccessful" ) ); //$NON-NLS-1$
            }
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.