/*******************************************************************************
* Copyright (c) 2010 Chris Aniszczyk 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:
* Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
*******************************************************************************/
package org.eclipse.swtbot.forms.finder.widgets;
import org.eclipse.swt.SWT;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.results.BoolResult;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
import org.eclipse.ui.forms.widgets.ToggleHyperlink;
import org.hamcrest.SelfDescribing;
/**
* This represents a {@link ToggleHyperlink} widget.
*
* @author Chris Aniszczyk <caniszczyk [at] gmail [dot] com>
* @version $Id$
*/
public abstract class SWTBotToggleHyperlink extends AbstractSWTBotControl<ToggleHyperlink> {
/**
* Constructs a new instance with the given widget.
*
* @param w the widget.
* @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
*/
public SWTBotToggleHyperlink(ToggleHyperlink w) throws WidgetNotFoundException {
super(w);
}
/**
* Constructs a new instance with the given widget.
*
* @param w the widget.
* @param description the description of the widget, this will be reported by {@link #toString()}
* @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
*/
public SWTBotToggleHyperlink(ToggleHyperlink w, SelfDescribing description) throws WidgetNotFoundException {
super(w, description);
}
/**
* Click on the hyperlink.
*
* @since 1.0
*/
public abstract SWTBotToggleHyperlink click();
protected void sendNotifications() {
notify(SWT.MouseEnter);
notify(SWT.MouseMove);
notify(SWT.Activate);
notify(SWT.MouseDown);
notify(SWT.MouseUp);
notify(SWT.Selection);
notify(SWT.MouseHover);
notify(SWT.MouseMove);
notify(SWT.MouseExit);
notify(SWT.Deactivate);
notify(SWT.FocusOut);
}
public boolean isExpanded() {
return syncExec(new BoolResult() {
public Boolean run() {
return widget.isExpanded();
}
});
}
}