Search in sources :

Example 6 with IStatus

use of org.eclipse.core.runtime.IStatus in project che by eclipse.

the class ValidateEditChecker method check.

/**
	 * {@inheritDoc}
	 */
public RefactoringStatus check(IProgressMonitor monitor) throws CoreException {
    IResource[] resources = (IResource[]) fFiles.toArray(new IResource[fFiles.size()]);
    RefactoringStatus result = new RefactoringStatus();
    IStatus status = Resources.checkInSync(resources);
    if (!status.isOK())
        result.merge(RefactoringStatus.create(status));
    status = Resources.makeCommittable(resources, fContext);
    if (!status.isOK()) {
        result.merge(RefactoringStatus.create(status));
        if (!result.hasFatalError()) {
            result.addFatalError(RefactoringCoreMessages.ValidateEditChecker_failed);
        }
    }
    return result;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) RefactoringStatus(org.eclipse.ltk.core.refactoring.RefactoringStatus) IResource(org.eclipse.core.resources.IResource)

Example 7 with IStatus

use of org.eclipse.core.runtime.IStatus in project che by eclipse.

the class Changes method validateModifiesFiles.

public static RefactoringStatus validateModifiesFiles(IFile[] filesToModify) {
    RefactoringStatus result = new RefactoringStatus();
    IStatus status = Resources.checkInSync(filesToModify);
    if (!status.isOK())
        result.merge(RefactoringStatus.create(status));
    status = Resources.makeCommittable(filesToModify, null);
    if (!status.isOK()) {
        result.merge(RefactoringStatus.create(status));
        if (!result.hasFatalError()) {
            result.addFatalError(RefactoringCoreMessages.Changes_validateEdit);
        }
    }
    return result;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) RefactoringStatus(org.eclipse.ltk.core.refactoring.RefactoringStatus)

Example 8 with IStatus

use of org.eclipse.core.runtime.IStatus in project che by eclipse.

the class RefactoringCorePlugin method logRemovedListener.

public static void logRemovedListener(Throwable t) {
    IStatus status = new Status(IStatus.ERROR, getPluginId(), IRefactoringCoreStatusCodes.INTERNAL_ERROR, RefactoringCoreMessages.RefactoringCorePlugin_listener_removed, t);
    log(status);
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IStatus(org.eclipse.core.runtime.IStatus)

Example 9 with IStatus

use of org.eclipse.core.runtime.IStatus in project che by eclipse.

the class RefactoringCorePlugin method logRemovedParticipant.

public static void logRemovedParticipant(ParticipantDescriptor descriptor, Throwable t) {
    IStatus status = new Status(IStatus.ERROR, getPluginId(), IRefactoringCoreStatusCodes.PARTICIPANT_DISABLED, Messages.format(RefactoringCoreMessages.RefactoringCorePlugin_participant_removed, descriptor.getId()), t);
    log(status);
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IStatus(org.eclipse.core.runtime.IStatus)

Example 10 with IStatus

use of org.eclipse.core.runtime.IStatus in project che by eclipse.

the class JavaConventions method validateClassFileName.

/**
     * Validate the given .class file name for the given source and compliance levels.
     * <p>
     * A .class file name must obey the following rules:
     * <ul>
     * <li> it must not be null
     * <li> it must include the <code>".class"</code> suffix
     * <li> its prefix must be a valid identifier
     * <li> it must not contain any characters or substrings that are not valid
     *		   on the file system on which workspace root is located.
     * </ul>
     * </p>
     * @param name the name of a .class file
     * @param sourceLevel the source level
     * @param complianceLevel the compliance level
     * @return a status object with code <code>IStatus.OK</code> if
     *		the given name is valid as a .class file name, otherwise a status
     *		object indicating what is wrong with the name
     * @since 3.3
     */
public static IStatus validateClassFileName(String name, String sourceLevel, String complianceLevel) {
    if (name == null) {
        return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.convention_classFile_nullName, null);
    }
    if (!org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(name)) {
        return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.convention_classFile_notClassFileName, null);
    }
    String identifier;
    int index;
    index = name.lastIndexOf('.');
    if (index == -1) {
        return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.convention_classFile_notClassFileName, null);
    }
    identifier = name.substring(0, index);
    // the package-level spec (replaces package.html)
    if (!identifier.equals(PACKAGE_INFO)) {
        IStatus status = validateIdentifier(identifier, sourceLevel, complianceLevel);
        if (!status.isOK()) {
            return status;
        }
    }
    //        }
    return JavaModelStatus.VERIFIED_OK;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) JavaModelStatus(org.eclipse.jdt.internal.core.JavaModelStatus) Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus)

Aggregations

IStatus (org.eclipse.core.runtime.IStatus)270 Status (org.eclipse.core.runtime.Status)118 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)62 CoreException (org.eclipse.core.runtime.CoreException)49 ArrayList (java.util.ArrayList)40 ITask (com.cubrid.common.core.task.ITask)37 TaskJobExecutor (com.cubrid.common.ui.spi.progress.TaskJobExecutor)29 File (java.io.File)27 InvocationTargetException (java.lang.reflect.InvocationTargetException)25 IOException (java.io.IOException)24 List (java.util.List)21 IFile (org.eclipse.core.resources.IFile)20 Job (org.eclipse.core.runtime.jobs.Job)20 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)19 IResource (org.eclipse.core.resources.IResource)18 IPath (org.eclipse.core.runtime.IPath)18 IJobChangeEvent (org.eclipse.core.runtime.jobs.IJobChangeEvent)17 CommonTaskJobExec (com.cubrid.common.ui.spi.progress.CommonTaskJobExec)14 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)14 GridLayout (org.eclipse.swt.layout.GridLayout)14