| /******************************************************************************* |
| * Copyright (c) 2009, 2014 Xored Software Inc and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.extensions.ecl.internal; |
| |
| import org.eclipse.core.resources.IMarker; |
| import org.eclipse.core.resources.IResource; |
| import org.eclipse.core.resources.ResourcesPlugin; |
| import org.eclipse.core.runtime.CoreException; |
| import org.eclipse.core.runtime.IStatus; |
| import org.eclipse.core.runtime.Status; |
| import org.eclipse.rcptt.ecl.core.Command; |
| import org.eclipse.rcptt.ecl.runtime.ICommandService; |
| import org.eclipse.rcptt.ecl.runtime.IProcess; |
| |
| public class GetProblemMessagesService implements ICommandService { |
| |
| @Override |
| public IStatus service(Command command, IProcess context) throws InterruptedException, CoreException { |
| for (IMarker marker : ResourcesPlugin.getWorkspace().getRoot() |
| .findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)) { |
| context.getOutput().write(marker.getAttribute(IMarker.MESSAGE)); |
| } |
| return Status.OK_STATUS; |
| } |
| |
| } |