assertionListPopup.addSeparator();
assertionListPopup.add( new ShowOnlineHelpAction( getHelpUrl()) );
return;
}
TestAssertion assertion = assertionListModel.getAssertionAt( ix );
ActionSupport.addActions( ActionListBuilder.buildActions( assertion ), assertionListPopup );
}
public void popupMenuWillBecomeInvisible( PopupMenuEvent e )
{
}
public void popupMenuCanceled( PopupMenuEvent e )
{
}
} );
assertionList.setComponentPopupMenu( assertionListPopup );
assertionList.addMouseListener( new MouseAdapter()
{
public void mouseClicked( MouseEvent e )
{
if( e.getClickCount() < 2 )
return;
int ix = assertionList.getSelectedIndex();
if( ix == -1 )
return;
Object obj = assertionList.getModel().getElementAt( ix );
if( obj instanceof TestAssertion )
{
TestAssertion assertion = ( TestAssertion )obj;
if( assertion.isConfigurable() )
assertion.configure();
return;
}
if( obj instanceof AssertionError )
{
AssertionError error = ( AssertionError )obj;
if( error.getLineNumber() >= 0 )
{
selectError( error );
}
else
Toolkit.getDefaultToolkit().beep();
}
else
Toolkit.getDefaultToolkit().beep();
}
} );
assertionList.addKeyListener( new KeyAdapter()
{
public void keyPressed( KeyEvent e )
{
int ix = assertionList.getSelectedIndex();
if( ix == -1 )
return;
TestAssertion assertion = assertionListModel.getAssertionAt( ix );
if( e.getKeyChar() == KeyEvent.VK_ENTER )
{
if( assertion.isConfigurable() )
assertion.configure();
}
else
{
ActionList actions = ActionListBuilder.buildActions( assertion );
if( actions != null )