Search in sources :

Example 36 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 37 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 38 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 39 with IStatus

use of org.eclipse.core.runtime.IStatus in project tdi-studio-se by Talend.

the class ThreadDumpEditor method parseDumpFile.

/**
     * Parses the dump file.
     * 
     * @param filePath The file path
     */
private void parseDumpFile(final String filePath) {
    Job job = new Job(Messages.parseThreadDumpFileJobLabel) {

        @Override
        protected IStatus run(IProgressMonitor monitor) {
            final ThreadDumpParser parser = new ThreadDumpParser(new File(filePath), threadListElements, monitor);
            try {
                parser.parse();
            } catch (ParserConfigurationException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
            } catch (SAXException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
            } catch (IOException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load thread dump file.", e);
            }
            setProfileInfo(parser.getProfileInfo());
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    if (threadSashForm != null) {
                        threadSashForm.refresh();
                    }
                }
            });
            return Status.OK_STATUS;
        }
    };
    job.schedule();
}
Also used : ThreadDumpParser(org.talend.designer.runtime.visualization.core.dump.ThreadDumpParser) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) Job(org.eclipse.core.runtime.jobs.Job) File(java.io.File) SAXException(org.xml.sax.SAXException)

Example 40 with IStatus

use of org.eclipse.core.runtime.IStatus in project tdi-studio-se by Talend.

the class HeapDumpEditor method parseDumpFile.

/**
     * Parses the dump file.
     * 
     * @param filePath The file path
     */
private void parseDumpFile(final String filePath) {
    Job job = new Job(Messages.parseHeapDumpFileJobLabel) {

        @Override
        protected IStatus run(IProgressMonitor monitor) {
            HeapDumpParser parser = new HeapDumpParser(new File(filePath), heapListElements, monitor);
            try {
                parser.parse();
            } catch (ParserConfigurationException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load heap dump file.", e);
            } catch (SAXException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load heap dump file.", e);
            } catch (IOException e) {
                //$NON-NLS-1$
                return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not load heap dump file.", e);
            }
            setProfileInfo(parser.getProfileInfo());
            Display.getDefault().asyncExec(new Runnable() {

                @Override
                public void run() {
                    if (heapHistogramPage != null) {
                        heapHistogramPage.refresh();
                    }
                }
            });
            return Status.OK_STATUS;
        }
    };
    job.schedule();
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) Job(org.eclipse.core.runtime.jobs.Job) HeapDumpParser(org.talend.designer.runtime.visualization.core.dump.HeapDumpParser) File(java.io.File) SAXException(org.xml.sax.SAXException)

Aggregations

IStatus (org.eclipse.core.runtime.IStatus)417 Status (org.eclipse.core.runtime.Status)195 CoreException (org.eclipse.core.runtime.CoreException)103 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)81 IOException (java.io.IOException)48 ArrayList (java.util.ArrayList)46 File (java.io.File)40 InvocationTargetException (java.lang.reflect.InvocationTargetException)39 ITask (com.cubrid.common.core.task.ITask)37 Job (org.eclipse.core.runtime.jobs.Job)32 IFile (org.eclipse.core.resources.IFile)31 TaskJobExecutor (com.cubrid.common.ui.spi.progress.TaskJobExecutor)29 IPath (org.eclipse.core.runtime.IPath)29 List (java.util.List)23 IResource (org.eclipse.core.resources.IResource)22 MultiStatus (org.eclipse.core.runtime.MultiStatus)22 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)19 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)19 IJobChangeEvent (org.eclipse.core.runtime.jobs.IJobChangeEvent)18 InputStream (java.io.InputStream)17