/*******************************************************************************
* Copyright (c) 2010, 2011 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.docs.intent.client.ui.ide.propertytester;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IMarker;
import org.eclipse.ui.views.markers.MarkerItem;
/**
* A {@link PropertyTester} allowing to determine wether a problem from the problem view is an Intent problem.
*
* @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a>
*/
public class IsIntentProblemMarker extends PropertyTester {
/**
* {@inheritDoc}
*
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String,
* java.lang.Object[], java.lang.Object)
*/
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
return receiver instanceof MarkerItem
&& "Intent".equals(((MarkerItem)receiver).getAttributeValue(IMarker.SOURCE_ID, ""));
}
}