/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 *//*
 * CheckForJFreeChart.java
 *
 * Created on October 5, 2002, 2:14 AM
 */

package org.netbeans.performance.antext;

import org.apache.tools.ant.*;
import org.apache.tools.ant.types.*;

/**
 * @author Tim Boudreau
 */
public class CheckForJFreeChart extends Task {

    public void execute() throws BuildException {
        boolean foundit = false;
        try {
            Class c = Class.forName("org.jrefactory.chart.ChartFactory"); //NOI18N
            foundit = true;
        } catch (ClassNotFoundException cnfe) {
            //do nothing
        }
        //XXX Could be really clever and download it for them...
        StringBuffer sb = new StringBuffer ("Drawing charts requires that you have JFreeChart installed\n");
        sb.append ("It is not distributed with this package due to license incompatibility (it can't be\n");
        sb.append("hosted on netbeans.org).  Download it from \nhttp://prdownloads.sourceforge.net/jfreechart/jfreechart-0.9.3.tar.gz?download\n");
        sb.append("And put the chart and common jars in the lib/ext directory below this build script.\n");
        throw new BuildException (sb.toString());
    }
    
}
