001 /*
002 * Created on Aug 1, 2008
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005 * in compliance with the License. You may obtain a copy of the License at
006 *
007 * http://www.apache.org/licenses/LICENSE-2.0
008 *
009 * Unless required by applicable law or agreed to in writing, software distributed under the License
010 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
011 * or implied. See the License for the specific language governing permissions and limitations under
012 * the License.
013 *
014 * Copyright @2008-2010 the original author or authors.
015 */
016 package org.fest.swing.fixture;
017
018 import java.awt.Component;
019 import java.awt.Container;
020
021 import org.fest.swing.core.Robot;
022
023 /**
024 * Understands an "extension method" for implementations of <code>{@link ContainerFixture}</code>. This extension
025 * creates new <code>{@link ComponentFixture}</code>s managing components inside a
026 * <code>{@link ContainerFixture}</code>'s <code>{@link Container}</code>.
027 * @param <C> the type of <code>Component</code> the <code>ComponentFixture</code> to create can handle.
028 * @param <F> the type of <code>ComponentFixture</code> this extension can create.
029 *
030 * @author Alex Ruiz
031 */
032 public abstract class ComponentFixtureExtension<C extends Component, F extends ComponentFixture<C>> {
033
034 /**
035 * Creates a new <code>{@link ComponentFixture}</code>.
036 * @param robot the <code>Robot</code> to pass to the new fixture.
037 * @param root the container where the component to handle by the created fixture is contained.
038 * @return the created <code>ComponentFixture</code>.
039 */
040 public abstract F createFixture(Robot robot, Container root);
041 }