String[] values = HistoryUtils.load( VALUE_HISTORY_DIALOGSETTING_KEY );
quickSearchValueCombo.setItems( values );
quickSearchValueCombo.select( 0 );
quickSearchValuePP.setProposals( Arrays.asList( values ) );
IBrowserConnection conn = entry.getBrowserConnection();
QuickSearch quickSearch = new QuickSearch( entry, conn );
quickSearch.getSearchParameter().setName( Messages.getString( "BrowserQuickSearchWidget.QuickSearch" ) ); //$NON-NLS-1$
quickSearch.getSearchParameter().setSearchBase( entry.getDn() );
quickSearch.getSearchParameter().setReturningAttributes( ISearch.NO_ATTRIBUTES );
quickSearch.getSearchParameter().setAliasesDereferencingMethod( conn.getAliasesDereferencingMethod() );
quickSearch.getSearchParameter().setReferralsHandlingMethod( conn.getReferralsHandlingMethod() );
quickSearch.getSearchParameter().setCountLimit( conn.getCountLimit() );
quickSearch.getSearchParameter().setTimeLimit( conn.getTimeLimit() );
quickSearch.getSearchParameter().setScope( quickSearchScopeButton.getSelection() ? SearchScope.SUBTREE : SearchScope.ONELEVEL );
StringBuffer filter = new StringBuffer();
filter.append( "(" );
if ( "!=".equals( quickSearchOperatorCombo.getText() ) )
{
filter.append( "!(" );
}
filter.append( quickSearchAttributeCombo.getText() );
filter.append( "!=".equals( quickSearchOperatorCombo.getText() ) ? "=" : quickSearchOperatorCombo.getText() );
// only escape '\', '(', ')', and '\u0000'
// don't escape '*' to allow substring search
String value = quickSearchValueCombo.getText();
value = value.replaceAll( "\\\\", "\\\\5c" );
value = value.replaceAll( "\u0000", "\\\\00" );
value = value.replaceAll( "\\(", "\\\\28" );
value = value.replaceAll( "\\)", "\\\\29" );
filter.append( value );
if ( "!=".equals( quickSearchOperatorCombo.getText() ) )
{
filter.append( ")" );
}
filter.append( ")" );
quickSearch.getSearchParameter().setFilter( filter.toString() );
// set new quick search
conn.getSearchManager().setQuickSearch( quickSearch );
// execute quick search
new StudioBrowserJob( new SearchRunnable( new ISearch[]
{ quickSearch } ) ).execute();
}