rowCountLabel.setText( c == 1 ? "1 entry" : c + " entries" );
}
private JComponent buildToolbar()
{
JXToolBar toolbar = UISupport.createToolbar();
clearErrorsButton = UISupport.createToolbarButton( new ClearErrorsAction() );
exportButton = UISupport.createToolbarButton( new ExportLoadTestLogAction( loadTestLog, logTable ) );
toolbar.add( clearErrorsButton );
toolbar.add( exportButton );
toolbar.addGlue();
List<Object> steps = new ArrayList<Object>();
steps.add( "- All -" );
steps.add( "Message" );
for( LoadTestAssertion assertion : loadTestLog.getLoadTest().getAssertionList() )
{
steps.add( assertion.getName() );
}
toolbar.add( new JLabel( "Show Types:" ) );
toolbar.addSeparator();
typesFilterComboBox = new JComboBox( steps.toArray() );
typesFilterComboBox.addItemListener( new ItemListener()
{
public void itemStateChanged( ItemEvent e )
{
int ix = typesFilterComboBox.getSelectedIndex();
if( ix == -1 )
return;
typeFilter.setAcceptNull( ix == 0 );
if( ix == 0 )
typeFilter.setPattern( ".*", 0 );
else
typeFilter.setPattern( typesFilterComboBox.getSelectedItem().toString(), 0 );
updateRowCountLabel();
}
} );
toolbar.add( typesFilterComboBox );
toolbar.addSeparator();
List<Object> types = new ArrayList<Object>();
types.add( "- All -" );
for( TestStep testStep : loadTestLog.getLoadTest().getTestCase().getTestStepList() )
{
types.add( testStep.getName() );
}
toolbar.addFixed( new JLabel( "Show Steps:" ) );
toolbar.addSeparator();
stepsFilterComboBox = new JComboBox( types.toArray() );
stepsFilterComboBox.addItemListener( new ItemListener()
{
public void itemStateChanged( ItemEvent e )
{
int ix = stepsFilterComboBox.getSelectedIndex();
if( ix == -1 )
return;
stepFilter.setAcceptNull( ix == 0 );
if( ix == 0 )
stepFilter.setPattern( ".*", 0 );
else
stepFilter.setPattern( stepsFilterComboBox.getSelectedItem().toString(), 0 );
updateRowCountLabel();
}
} );
toolbar.addFixed( stepsFilterComboBox );
// toolbar.setBorder( BorderFactory.createEmptyBorder( 0, 0, 2, 0 ));
return toolbar; // builder.getPanel();
}