You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2007/10/27 15:22:26 UTC
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...
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 <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @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<IAttribute> attributeList = new ArrayList<IAttribute>();
+ 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;