Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d8c76b9bd61ffd9a3b33837ffb11d8e2eb82b922 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*******************************************************************************
 * Copyright (c) 2010 Alena Laskavaia 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:
 *     Alena Laskavaia - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.codan.examples.uicontrib;

import org.eclipse.cdt.codan.internal.core.model.CodanProblemMarker;
import org.eclipse.cdt.codan.ui.AbstractCodanProblemDetailsProvider;

/**
 * Example of codan problem details provider for string search integration
 */
public class GrepCheckerHelpLink extends AbstractCodanProblemDetailsProvider {
	@Override
	public boolean isApplicable(String id) {
		return id.startsWith("org.eclipse.cdt.codan.examples.checkers.GrepCheckerProblem");
	}
	

	@Override
	public String getStyledProblemDescription() {
		String arg = CodanProblemMarker.getProblemArgument(marker, 0);
		String url = "http://www.google.ca/search?q=" + arg;
		return "Google " + "<a href=\"" + url + "\">"  + arg + "</a>";
	}
}

Back to the top