org.assertj.swing.jide.action.CommandBarFixture Maven / Gradle / Ivy
/*
* Licensed 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.
*
* Copyright 2012-2018 the original author or authors.
*/
package org.assertj.swing.jide.action;
import org.assertj.core.util.Strings;
import org.assertj.swing.core.Robot;
import org.assertj.swing.fixture.AbstractContainerFixture;
import org.assertj.swing.jide.action.driver.CommandBarDriver;
import com.jidesoft.action.CommandBar;
/**
* A AssertJ Fixture for the {@link CommandBar}.
*
* @author Peter Murray
*/
public class CommandBarFixture extends AbstractContainerFixture {
/**
* Creates a new {@link CommandBarFixture}
.
*
* @param robot performs simulation of user events on the given {@link CommandBar}.
* @param target the {@link CommandBar} to be managed by this fixture.
* @throws NullPointerException if robot
is null
.
* @throws NullPointerException if target
is null
.
*/
public CommandBarFixture(Robot robot, CommandBar target) {
super(CommandBarFixture.class, robot, target);
}
/**
* Creates a new {@link CommandBarFixture}
.
*
* @param robot performs simulation of user events on a {@link CommandBar}.
* @param commandBarName the name of the {@link CommandBar} to find using the given Robot
.
* @throws NullPointerException if robot
is null
.
* @throws org.assertj.swing.exception.ComponentLookupException if a matching {@link CommandBar} could not be found.
* @throws org.assertj.swing.exception.ComponentLookupException if more than one matching {@link CommandBar} is found.
*/
public CommandBarFixture(Robot robot, String commandBarName) {
super(CommandBarFixture.class, robot, commandBarName, CommandBar.class);
}
@Override
protected CommandBarDriver createDriver(Robot robot) {
return new CommandBarDriver(robot);
}
@Override
public String toString() {
return Strings.concat("name=", target().getName(),
", enabled=", target().isEnabled(),
", visible=", target().isVisible(),
", showing=", target().isShowing());
}
}