Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 33965 invoked from network); 27 Oct 2007 13:22:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Oct 2007 13:22:49 -0000 Received: (qmail 87419 invoked by uid 500); 27 Oct 2007 13:22:37 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 87368 invoked by uid 500); 27 Oct 2007 13:22:37 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 87357 invoked by uid 99); 27 Oct 2007 13:22:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Oct 2007 06:22:37 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Oct 2007 13:22:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7A9931A983A; Sat, 27 Oct 2007 06:22:28 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r589094 [2/2] - in /directory/studio/trunk: studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/searc... Date: Sat, 27 Oct 2007 13:22:26 -0000 To: commits@directory.apache.org From: seelmann@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071027132228.7A9931A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java?rev=589094&r1=589093&r2=589094&view=diff ============================================================================== --- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java (original) +++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java Sat Oct 27 06:22:25 2007 @@ -182,7 +182,7 @@ */ private void fireSearchUpdated( SearchUpdateEvent.EventDetail detail ) { - if ( this.getName() != null && !"".equals( this.getName() ) ) { //$NON-NLS-1$ + if ( getName() != null && !"".equals( getName() ) ) { //$NON-NLS-1$ EventRegistry.fireSearchUpdated( new SearchUpdateEvent( this, detail ), this ); } } @@ -193,7 +193,7 @@ */ public boolean isInitHasChildrenFlag() { - return this.searchParameter.isInitHasChildrenFlag(); + return searchParameter.isInitHasChildrenFlag(); } @@ -202,7 +202,7 @@ */ public boolean isInitAliasAndReferralFlag() { - return this.searchParameter.isInitAliasAndReferralFlag(); + return searchParameter.isInitAliasAndReferralFlag(); } @@ -211,7 +211,7 @@ */ public Control[] getControls() { - return this.searchParameter.getControls(); + return searchParameter.getControls(); } @@ -220,7 +220,7 @@ */ public int getCountLimit() { - return this.searchParameter.getCountLimit(); + return searchParameter.getCountLimit(); } @@ -229,8 +229,8 @@ */ public void setCountLimit( int countLimit ) { - this.searchParameter.setCountLimit( countLimit ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setCountLimit( countLimit ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -239,7 +239,7 @@ */ public String getFilter() { - return this.searchParameter.getFilter(); + return searchParameter.getFilter(); } @@ -248,8 +248,8 @@ */ public void setFilter( String filter ) { - this.searchParameter.setFilter( filter ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setFilter( filter ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -258,7 +258,7 @@ */ public String[] getReturningAttributes() { - return this.searchParameter.getReturningAttributes(); + return searchParameter.getReturningAttributes(); } @@ -267,8 +267,8 @@ */ public void setReturningAttributes( String[] returningAttributes ) { - this.searchParameter.setReturningAttributes( returningAttributes ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setReturningAttributes( returningAttributes ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -277,7 +277,7 @@ */ public SearchScope getScope() { - return this.searchParameter.getScope(); + return searchParameter.getScope(); } @@ -286,8 +286,8 @@ */ public void setScope( SearchScope scope ) { - this.searchParameter.setScope( scope ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setScope( scope ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -296,7 +296,7 @@ */ public AliasDereferencingMethod getAliasesDereferencingMethod() { - return this.searchParameter.getAliasesDereferencingMethod(); + return searchParameter.getAliasesDereferencingMethod(); } @@ -305,8 +305,8 @@ */ public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod ) { - this.searchParameter.setAliasesDereferencingMethod( aliasesDereferencingMethod ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setAliasesDereferencingMethod( aliasesDereferencingMethod ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -315,7 +315,7 @@ */ public ReferralHandlingMethod getReferralsHandlingMethod() { - return this.searchParameter.getReferralsHandlingMethod(); + return searchParameter.getReferralsHandlingMethod(); } @@ -324,8 +324,8 @@ */ public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod ) { - this.searchParameter.setReferralsHandlingMethod( referralsHandlingMethod ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setReferralsHandlingMethod( referralsHandlingMethod ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -334,7 +334,7 @@ */ public DN getSearchBase() { - return this.searchParameter.getSearchBase(); + return searchParameter.getSearchBase(); } @@ -343,8 +343,8 @@ */ public void setSearchBase( DN searchBase ) { - this.searchParameter.setSearchBase( searchBase ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setSearchBase( searchBase ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -353,7 +353,7 @@ */ public int getTimeLimit() { - return this.searchParameter.getTimeLimit(); + return searchParameter.getTimeLimit(); } @@ -362,8 +362,8 @@ */ public void setTimeLimit( int timeLimit ) { - this.searchParameter.setTimeLimit( timeLimit ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setTimeLimit( timeLimit ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -372,7 +372,7 @@ */ public String getName() { - return this.searchParameter.getName(); + return searchParameter.getName(); } @@ -381,8 +381,8 @@ */ public void setName( String searchName ) { - this.searchParameter.setName( searchName ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_RENAMED ); + searchParameter.setName( searchName ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_RENAMED ); } @@ -403,7 +403,7 @@ this.searchResults = searchResults; if ( searchResults != null ) { - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ); } } @@ -413,7 +413,7 @@ */ public boolean isCountLimitExceeded() { - return this.countLimitExceeded; + return countLimitExceeded; } @@ -423,7 +423,7 @@ public void setCountLimitExceeded( boolean countLimitExceeded ) { this.countLimitExceeded = countLimitExceeded; - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PERFORMED ); } @@ -439,14 +439,14 @@ /** * {@inheritDoc} */ - public void setConnection( IBrowserConnection connection ) + public void setBrowserConnection( IBrowserConnection connection ) { this.connection = connection; - this.searchParameter.setCountLimit( connection.getCountLimit() ); - this.searchParameter.setTimeLimit( connection.getTimeLimit() ); - this.searchParameter.setAliasesDereferencingMethod( connection.getAliasesDereferencingMethod() ); - this.searchParameter.setReferralsHandlingMethod( connection.getReferralsHandlingMethod() ); - this.fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); + searchParameter.setCountLimit( connection.getCountLimit() ); + searchParameter.setTimeLimit( connection.getTimeLimit() ); + searchParameter.setAliasesDereferencingMethod( connection.getAliasesDereferencingMethod() ); + searchParameter.setReferralsHandlingMethod( connection.getReferralsHandlingMethod() ); + fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED ); } @@ -455,7 +455,7 @@ */ public String toString() { - return this.getName() + " (" + this.connection + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + return getName() + " (" + getBrowserConnection() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } @@ -464,10 +464,9 @@ */ public Object clone() { - return new Search( this.getName(), this.getBrowserConnection(), this.getSearchBase(), this.getFilter(), this - .getReturningAttributes(), this.getScope(), this.getCountLimit(), this.getTimeLimit(), this - .getAliasesDereferencingMethod(), this.getReferralsHandlingMethod(), this.isInitHasChildrenFlag(), this - .isInitAliasAndReferralFlag(), this.getControls() ); + return new Search( getName(), getBrowserConnection(), getSearchBase(), getFilter(), getReturningAttributes(), + getScope(), getCountLimit(), getTimeLimit(), getAliasesDereferencingMethod(), getReferralsHandlingMethod(), + isInitHasChildrenFlag(), isInitAliasAndReferralFlag(), getControls() ); } @@ -492,6 +491,7 @@ /** * {@inheritDoc} */ + @SuppressWarnings("unchecked") public Object getAdapter( Class adapter ) { Class clazz = ( Class ) adapter; Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java?rev=589094&r1=589093&r2=589094&view=diff ============================================================================== --- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java (original) +++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java Sat Oct 27 06:22:25 2007 @@ -35,13 +35,21 @@ import org.eclipse.search.ui.ISearchPageScoreComputer; +/** + * Default implementation of ISearchResult. + * + * @author Apache Directory Project + * @version $Rev$, $Date$ + */ public class SearchResult implements ISearchResult { private static final long serialVersionUID = -5658803569872619432L; + /** The search. */ private ISearch search; + /** The entry. */ private IEntry entry; @@ -50,6 +58,12 @@ } + /** + * Creates a new instance of SearchResult. + * + * @param entry the entry + * @param search the search + */ public SearchResult( IEntry entry, ISearch search ) { this.entry = entry; @@ -57,44 +71,63 @@ } + /** + * {@inheritDoc} + */ public DN getDn() { - return this.entry.getDn(); + return entry.getDn(); } + /** + * {@inheritDoc} + */ public IAttribute[] getAttributes() { - ArrayList attributeList = new ArrayList(); - for ( int i = 0; i < this.search.getReturningAttributes().length; i++ ) + ArrayList attributeList = new ArrayList(); + for ( int i = 0; i < search.getReturningAttributes().length; i++ ) { - if ( this.entry.getAttribute( this.search.getReturningAttributes()[i] ) != null ) + if ( entry.getAttribute( search.getReturningAttributes()[i] ) != null ) { - attributeList.add( this.entry.getAttribute( this.search.getReturningAttributes()[i] ) ); + attributeList.add( entry.getAttribute( search.getReturningAttributes()[i] ) ); } } - return ( IAttribute[] ) attributeList.toArray( new IAttribute[attributeList.size()] ); + return attributeList.toArray( new IAttribute[attributeList.size()] ); } + /** + * {@inheritDoc} + */ public IAttribute getAttribute( String attributeDescription ) { - return this.entry.getAttribute( attributeDescription ); + return entry.getAttribute( attributeDescription ); } + /** + * {@inheritDoc} + */ public AttributeHierarchy getAttributeWithSubtypes( String attributeDescription ) { - return this.entry.getAttributeWithSubtypes( attributeDescription ); + return entry.getAttributeWithSubtypes( attributeDescription ); } + /** + * {@inheritDoc} + */ public IEntry getEntry() { - return this.entry; + return entry; } + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") public Object getAdapter( Class adapter ) { Class clazz = ( Class ) adapter; @@ -104,11 +137,11 @@ } if ( clazz.isAssignableFrom( Connection.class ) ) { - return getConnection().getConnection(); + return search.getBrowserConnection().getConnection(); } if ( clazz.isAssignableFrom( IBrowserConnection.class ) ) { - return getConnection(); + return search.getBrowserConnection(); } if ( clazz.isAssignableFrom( IEntry.class ) ) { @@ -118,18 +151,18 @@ } - public IBrowserConnection getConnection() - { - return this.search.getBrowserConnection(); - } - - + /** + * {@inheritDoc} + */ public ISearch getSearch() { - return this.search; + return search; } + /** + * {@inheritDoc} + */ public void setSearch( ISearch search ) { this.search = search; Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java?rev=589094&r1=589093&r2=589094&view=diff ============================================================================== --- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java (original) +++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java Sat Oct 27 06:22:25 2007 @@ -111,7 +111,7 @@ */ public IAttribute getAttribute() { - return this.attribute; + return attribute; } @@ -120,7 +120,7 @@ */ public Object getRawValue() { - return this.rawValue; + return rawValue; } @@ -130,21 +130,21 @@ public String getStringValue() { - if ( this.rawValue == EMPTY_STRING_VALUE ) + if ( rawValue == EMPTY_STRING_VALUE ) { return EMPTY_STRING_VALUE.getStringValue(); } - else if ( this.rawValue == EMPTY_BINARY_VALUE ) + else if ( rawValue == EMPTY_BINARY_VALUE ) { return EMPTY_BINARY_VALUE.getStringValue(); } - else if ( this.rawValue instanceof String ) + else if ( rawValue instanceof String ) { - return ( String ) this.rawValue; + return ( String ) rawValue; } - else if ( this.rawValue instanceof byte[] ) + else if ( rawValue instanceof byte[] ) { - return LdifUtils.utf8decode( ( byte[] ) this.rawValue ); + return LdifUtils.utf8decode( ( byte[] ) rawValue ); } else { @@ -158,21 +158,21 @@ */ public byte[] getBinaryValue() { - if ( this.rawValue == EMPTY_STRING_VALUE ) + if ( rawValue == EMPTY_STRING_VALUE ) { return EMPTY_STRING_VALUE.getBinaryValue(); } - else if ( this.rawValue == EMPTY_BINARY_VALUE ) + else if ( rawValue == EMPTY_BINARY_VALUE ) { return EMPTY_BINARY_VALUE.getBinaryValue(); } - else if ( this.rawValue instanceof byte[] ) + else if ( rawValue instanceof byte[] ) { - return ( byte[] ) this.rawValue; + return ( byte[] ) rawValue; } - else if ( this.rawValue instanceof String ) + else if ( rawValue instanceof String ) { - return LdifUtils.utf8encode( ( String ) this.rawValue ); + return LdifUtils.utf8encode( ( String ) rawValue ); } else { @@ -186,7 +186,7 @@ */ public boolean isString() { - return this.rawValue == EMPTY_STRING_VALUE || this.attribute.isString(); + return rawValue == EMPTY_STRING_VALUE || attribute.isString(); } @@ -195,7 +195,7 @@ */ public boolean isBinary() { - return this.rawValue == EMPTY_BINARY_VALUE || this.attribute.isBinary(); + return rawValue == EMPTY_BINARY_VALUE || attribute.isBinary(); } @@ -204,7 +204,7 @@ */ public boolean isEmpty() { - return this.rawValue == EMPTY_STRING_VALUE || this.rawValue == EMPTY_BINARY_VALUE; + return rawValue == EMPTY_STRING_VALUE || rawValue == EMPTY_BINARY_VALUE; } @@ -260,13 +260,14 @@ */ public String toString() { - return attribute + ":" + ( this.isString() ? this.getStringValue() : "BINARY" ); //$NON-NLS-1$ //$NON-NLS-2$ + return attribute + ":" + ( isString() ? getStringValue() : "BINARY" ); //$NON-NLS-1$ //$NON-NLS-2$ } /** * {@inheritDoc} */ + @SuppressWarnings("unchecked") public Object getAdapter( Class adapter ) { Class clazz = ( Class ) adapter;