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 2008/08/28 16:56:40 UTC
svn commit: r689845 [3/3] - in /directory/studio/trunk:
connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/
connection-ui/src/main/java/org/apache/directory/studio/connection/ui/
ldapbrowser-common/src/main/java/org/apache/d...
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorSorter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorSorter.java?rev=689845&r1=689844&r2=689845&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorSorter.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorSorter.java Thu Aug 28 07:56:37 2008
@@ -40,133 +40,163 @@
import org.eclipse.swt.widgets.TableColumn;
+/**
+ * The SearchResultEditorSorter implements the Sorter for the search result editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class SearchResultEditorSorter extends ViewerSorter implements SelectionListener
{
+ /** The content provider. */
protected SearchResultEditorContentProvider contentProvider;
+ /** The search. */
private ISearch search;
+ /** The columns. */
private TableColumn[] columns;
+ /** The show DN flag. */
private boolean showDn;
+ /** The sort property. */
private int sortBy;
+ /** The sort order. */
private int sortOrder;
- public SearchResultEditorSorter()
- {
- super();
- }
-
-
+ /**
+ * Connects this sorter to the given content provider.
+ *
+ * @param contentProvider the content provider
+ */
public void connect( SearchResultEditorContentProvider contentProvider )
{
-
this.contentProvider = contentProvider;
- this.sortBy = 0;
- this.sortOrder = BrowserCoreConstants.SORT_ORDER_NONE;
+ sortBy = 0;
+ sortOrder = BrowserCoreConstants.SORT_ORDER_NONE;
- this.columns = this.contentProvider.getViewer().getTable().getColumns();
- for ( int i = 0; i < this.columns.length; i++ )
+ columns = contentProvider.getViewer().getTable().getColumns();
+ for ( int i = 0; i < columns.length; i++ )
{
- this.columns[i].addSelectionListener( this );
+ columns[i].addSelectionListener( this );
}
}
+ /**
+ * Called when the input of the viewer has been changed.
+ *
+ * @param newSearch the new search
+ * @param showDn the show DN flag
+ */
public void inputChanged( ISearch newSearch, boolean showDn )
{
-
this.search = newSearch;
this.showDn = showDn;
- for ( int i = 0; this.columns != null && i < this.columns.length; i++ )
+ for ( int i = 0; columns != null && i < columns.length; i++ )
{
- this.columns[i].removeSelectionListener( this );
+ columns[i].removeSelectionListener( this );
}
- this.columns = this.contentProvider.getViewer().getTable().getColumns();
- for ( int i = 0; i < this.columns.length; i++ )
+ columns = contentProvider.getViewer().getTable().getColumns();
+ for ( int i = 0; i < columns.length; i++ )
{
- this.columns[i].addSelectionListener( this );
+ columns[i].addSelectionListener( this );
}
// check sort column
- int visibleColumns = this.search.getReturningAttributes().length;
- if ( this.showDn )
+ int visibleColumns = search.getReturningAttributes().length;
+ if ( showDn )
+ {
visibleColumns++;
- if ( visibleColumns < this.sortBy + 1 )
+ }
+ if ( visibleColumns < sortBy + 1 )
{
- this.setSortColumn( 0 );
- this.setSortColumn( 0 );
- this.setSortColumn( 0 );
+ setSortColumn( 0 );
+ setSortColumn( 0 );
+ setSortColumn( 0 );
}
}
public void dispose()
{
- for ( int i = 0; this.columns != null && i < this.columns.length; i++ )
+ for ( int i = 0; columns != null && i < columns.length; i++ )
{
- if ( !this.columns[i].isDisposed() )
- this.columns[i].removeSelectionListener( this );
+ if ( !columns[i].isDisposed() )
+ {
+ columns[i].removeSelectionListener( this );
+ }
}
- this.columns = null;
- this.search = null;
- this.contentProvider = null;
+ columns = null;
+ search = null;
+ contentProvider = null;
}
+ /**
+ * {@inheritDoc}
+ */
public void widgetDefaultSelected( SelectionEvent e )
{
}
+ /**
+ * {@inheritDoc}
+ */
public void widgetSelected( SelectionEvent e )
{
if ( e.widget instanceof TableColumn )
{
- int index = this.contentProvider.getViewer().getTable().indexOf( ( ( TableColumn ) e.widget ) );
- this.setSortColumn( index );
+ int index = contentProvider.getViewer().getTable().indexOf( ( ( TableColumn ) e.widget ) );
+ setSortColumn( index );
}
}
+ /**
+ * Sets the sort column.
+ *
+ * @param index the new sort column
+ */
private void setSortColumn( int index )
{
- if ( this.sortBy == index )
+ if ( sortBy == index )
{
// toggle sort order
- this.sortOrder = this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? BrowserCoreConstants.SORT_ORDER_DESCENDING
- : this.sortOrder == BrowserCoreConstants.SORT_ORDER_DESCENDING ? BrowserCoreConstants.SORT_ORDER_NONE
+ sortOrder = sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? BrowserCoreConstants.SORT_ORDER_DESCENDING
+ : sortOrder == BrowserCoreConstants.SORT_ORDER_DESCENDING ? BrowserCoreConstants.SORT_ORDER_NONE
: BrowserCoreConstants.SORT_ORDER_ASCENDING;
}
else
{
// set new sort by
- this.sortBy = index;
- this.sortOrder = BrowserCoreConstants.SORT_ORDER_ASCENDING;
+ sortBy = index;
+ sortOrder = BrowserCoreConstants.SORT_ORDER_ASCENDING;
}
- if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_NONE )
+ if ( sortOrder == BrowserCoreConstants.SORT_ORDER_NONE )
{
- this.sortBy = BrowserCoreConstants.SORT_BY_NONE;
+ sortBy = BrowserCoreConstants.SORT_BY_NONE;
}
- TableColumn[] columns = this.contentProvider.getViewer().getTable().getColumns();
+ TableColumn[] columns = contentProvider.getViewer().getTable().getColumns();
for ( int i = 0; i < columns.length; i++ )
{
columns[i].setImage( null );
}
- if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING )
+ if ( sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING )
{
( columns[index] ).setImage( BrowserCommonActivator.getDefault().getImage(
BrowserCommonConstants.IMG_SORT_ASCENDING ) );
}
- else if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_DESCENDING )
+ else if ( sortOrder == BrowserCoreConstants.SORT_ORDER_DESCENDING )
{
( columns[index] ).setImage( BrowserCommonActivator.getDefault().getImage(
BrowserCommonConstants.IMG_SORT_DESCENDING ) );
@@ -176,24 +206,30 @@
( columns[index] ).setImage( null );
}
- this.contentProvider.refresh();
-
+ contentProvider.refresh();
}
+ /**
+ * Checks if is sorted.
+ *
+ * @return true, if is sorted
+ */
public boolean isSorted()
{
- // return this.sortOrder != SORT_ORDER_NONE;
+ // return sortOrder != SORT_ORDER_NONE;
return true;
}
+ /**
+ * {@inheritDoc}
+ */
public void sort( final Viewer viewer, Object[] elements )
{
-
if ( isSorted() )
{
- Arrays.sort( elements, new Comparator()
+ Arrays.sort( elements, new Comparator<Object>()
{
public int compare( Object a, Object b )
{
@@ -205,37 +241,16 @@
}
+ /**
+ * {@inheritDoc}
+ */
public int compare( Viewer viewer, Object o1, Object o2 )
{
-
- if ( this.search == null )
+ if ( search == null )
{
- return this.equal();
+ return equal();
}
- // if(o1 == null && o2 == null) {
- // return this.equal();
- // }
- // else if(o1 == null && o2 != null) {
- // return this.lessThan();
- // }
- // else if(o1 != null && o2 == null) {
- // return this.greaterThan();
- // }
- // else {
- // if(!(o1 instanceof ISearchResult) && !(o2 instanceof ISearchResult))
- // {
- // return this.equal();
- // }
- // else if(!(o1 instanceof ISearchResult) && (o2 instanceof
- // ISearchResult)) {
- // return this.lessThan();
- // }
- // else if((o1 instanceof ISearchResult) && !(o2 instanceof
- // ISearchResult)) {
- // return this.greaterThan();
- // }
- // else {
ISearchResult sr1 = ( ISearchResult ) o1;
ISearchResult sr2 = ( ISearchResult ) o2;
@@ -243,17 +258,17 @@
IEntry entry2 = sr2.getEntry();
String attributeName;
- if ( showDn && this.sortBy == 0 )
+ if ( showDn && sortBy == 0 )
{
attributeName = BrowserUIConstants.DN;
}
- else if ( showDn && this.sortBy > 0 )
+ else if ( showDn && sortBy > 0 )
{
- attributeName = this.search.getReturningAttributes()[this.sortBy - 1];
+ attributeName = search.getReturningAttributes()[sortBy - 1];
}
else
{
- attributeName = this.search.getReturningAttributes()[this.sortBy];
+ attributeName = search.getReturningAttributes()[sortBy];
}
if ( attributeName == BrowserUIConstants.DN )
@@ -267,15 +282,15 @@
AttributeHierarchy ah2 = entry2.getAttributeWithSubtypes( attributeName );
if ( ah1 == null && ah2 == null )
{
- return this.equal();
+ return equal();
}
else if ( ah1 == null && ah2 != null )
{
- return this.lessThan();
+ return lessThan();
}
else if ( ah1 != null && ah2 == null )
{
- return this.greaterThan();
+ return greaterThan();
}
else
{
@@ -287,11 +302,16 @@
return compare( value1, value2 );
}
}
- // }
- // }
}
+ /**
+ * Gets the value.
+ *
+ * @param attribute the attribute
+ *
+ * @return the value
+ */
private String getValue( IAttribute attribute )
{
if ( attribute.getValueSize() > 0 )
@@ -305,27 +325,50 @@
}
+ /**
+ * Gets the less than value.
+ *
+ * @return the less than value
+ */
private int lessThan()
{
- return this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? -1 : 1;
+ return sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? -1 : 1;
}
+ /**
+ * Gets the equal value.
+ *
+ * @return the equal value
+ */
private int equal()
{
return 0;
}
+ /**
+ * Gets the greater than value.
+ *
+ * @return the greater than value
+ */
private int greaterThan()
{
- return this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? 1 : -1;
+ return sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? 1 : -1;
}
+ /**
+ * Compare two strings.
+ *
+ * @param s1 the 1st string
+ * @param s2 the 2nd string
+ *
+ * @return the compare result
+ */
private int compare( String s1, String s2 )
{
- return this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? s1.compareToIgnoreCase( s2 ) : s2
+ return sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? s1.compareToIgnoreCase( s2 ) : s2
.compareToIgnoreCase( s1 );
}
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorUniversalListener.java?rev=689845&r1=689844&r2=689845&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorUniversalListener.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorUniversalListener.java Thu Aug 28 07:56:37 2008
@@ -21,12 +21,6 @@
package org.apache.directory.studio.ldapbrowser.ui.editors.searchresult;
-/**
- * The SearchResultEditorUniversalListener manages all events for the search result editor.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$, $Date$
- */
import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
import org.apache.directory.studio.ldapbrowser.common.actions.BrowserSelectionUtils;
@@ -79,6 +73,12 @@
import org.eclipse.ui.forms.widgets.Hyperlink;
+/**
+ * The SearchResultEditorUniversalListener manages all events for the search result editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class SearchResultEditorUniversalListener implements SearchUpdateListener, EntryUpdateListener
{
@@ -168,8 +168,7 @@
{
IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
IContextService.class );
- contextActivation = contextService
- .activateContext( BrowserCommonConstants.CONTEXT_WINDOWS );
+ contextActivation = contextService.activateContext( BrowserCommonConstants.CONTEXT_WINDOWS );
editor.getActionGroup().activateGlobalActionHandlers();
}
@@ -540,12 +539,11 @@
*/
public void entryUpdated( EntryModificationEvent event )
{
-
if ( event instanceof EmptyValueAddedEvent && !editor.getActionGroup().isEditorActive() )
{
EmptyValueAddedEvent evae = ( EmptyValueAddedEvent ) event;
IAttribute att = evae.getAddedValue().getAttribute();
- AttributeHierarchy ah = cursor.getSelectedAttributeHierarchie();
+ AttributeHierarchy ah = cursor.getSelectedAttributeHierarchy();
if ( ah != null && ah.contains( att ) )
{
viewer.setSelection( null, true );
@@ -583,7 +581,6 @@
*/
void refreshInput()
{
-
// create at least on column
ensureColumnCount( 1 );
@@ -703,7 +700,6 @@
*/
private void checkDnLink( TableItem item )
{
-
if ( dnLink == null || dnLink.isDisposed() || tableEditor == null || viewer.getTable().isDisposed()
|| cursor.isDisposed() )
{
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorWidget.java?rev=689845&r1=689844&r2=689845&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorWidget.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorWidget.java Thu Aug 28 07:56:37 2008
@@ -30,89 +30,131 @@
import org.eclipse.swt.widgets.Table;
+/**
+ * The EntryEditorWidget is a widget to display and edit the attributes of
+ * the results of a search.
+ *
+ * It provides a context menu and a local toolbar with actions to
+ * manage attributes. Further there is an instant search feature to filter
+ * the visible search results.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class SearchResultEditorWidget extends ViewFormWidget
{
+ /** The configuration. */
private SearchResultEditorConfiguration configuration;
+ /** The quick filter widget. */
private SearchResultEditorQuickFilterWidget quickFilterWidget;
+ /** The table. */
private Table table;
+ /** The viewer. */
private TableViewer viewer;
+ /**
+ * Creates a new instance of SearchResultEditorWidget.
+ *
+ * @param configuration the configuration
+ */
public SearchResultEditorWidget( SearchResultEditorConfiguration configuration )
{
this.configuration = configuration;
}
+ /**
+ * {@inheritDoc}
+ */
protected Control createContent( Composite parent )
{
-
// create quick filter
- this.quickFilterWidget = new SearchResultEditorQuickFilterWidget( this.configuration.getFilter() );
- this.quickFilterWidget.createComposite( parent );
+ quickFilterWidget = new SearchResultEditorQuickFilterWidget( configuration.getFilter() );
+ quickFilterWidget.createComposite( parent );
// create table widget and viewer
- this.table = new Table( parent, SWT.BORDER | SWT.HIDE_SELECTION | SWT.VIRTUAL );
- this.table.setHeaderVisible( true );
- this.table.setLinesVisible( true );
- this.table.setLayoutData( new GridData( GridData.FILL_BOTH ) );
- this.viewer = new TableViewer( this.table );
- this.viewer.setUseHashlookup( true );
+ table = new Table( parent, SWT.BORDER | SWT.HIDE_SELECTION | SWT.VIRTUAL );
+ table.setHeaderVisible( true );
+ table.setLinesVisible( true );
+ table.setLayoutData( new GridData( GridData.FILL_BOTH ) );
+ viewer = new TableViewer( table );
+ viewer.setUseHashlookup( true );
// setup providers
- this.viewer.setContentProvider( configuration.getContentProvider( this ) );
- this.viewer.setLabelProvider( configuration.getLabelProvider( this.viewer ) );
+ viewer.setContentProvider( configuration.getContentProvider( this ) );
+ viewer.setLabelProvider( configuration.getLabelProvider( viewer ) );
// set table cell editors
- this.viewer.setCellModifier( configuration.getCellModifier( this.viewer ) );
+ viewer.setCellModifier( configuration.getCellModifier( viewer ) );
- return this.table;
+ return table;
}
+ /**
+ * Sets the input.
+ *
+ * @param input the new input
+ */
public void setInput( Object input )
{
- this.viewer.setInput( input );
+ viewer.setInput( input );
}
+ /**
+ * Sets the focus.
+ */
public void setFocus()
{
- this.configuration.getCursor( this.viewer ).setFocus();
+ configuration.getCursor( viewer ).setFocus();
}
+ /**
+ * {@inheritDoc}
+ */
public void dispose()
{
- if ( this.viewer != null )
+ if ( viewer != null )
{
- this.configuration.dispose();
+ configuration.dispose();
- if ( this.quickFilterWidget != null )
+ if ( quickFilterWidget != null )
{
- this.quickFilterWidget.dispose();
- this.quickFilterWidget = null;
+ quickFilterWidget.dispose();
+ quickFilterWidget = null;
}
- // this.table.dispose();
- this.table = null;
- this.viewer = null;
+ table = null;
+ viewer = null;
}
super.dispose();
}
+ /**
+ * Gets the viewer.
+ *
+ * @return the viewer
+ */
public TableViewer getViewer()
{
return viewer;
}
+ /**
+ * Gets the quick filter widget.
+ *
+ * @return the quick filter widget
+ */
public SearchResultEditorQuickFilterWidget getQuickFilterWidget()
{
return quickFilterWidget;
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowDNAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowDNAction.java?rev=689845&r1=689844&r2=689845&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowDNAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowDNAction.java Thu Aug 28 07:56:37 2008
@@ -26,20 +26,31 @@
import org.eclipse.jface.action.Action;
+/**
+ * Action to show/hide the DN column.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class ShowDNAction extends Action
{
+ /**
+ * Creates a new instance of ShowDNAction.
+ */
public ShowDNAction()
{
super( "Show DN", AS_CHECK_BOX );
super.setToolTipText( getText() );
super.setEnabled( true );
-
super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) );
}
+ /**
+ * {@inheritDoc}
+ */
public void run()
{
BrowserUIPlugin.getDefault().getPreferenceStore().setValue(
@@ -47,18 +58,9 @@
}
- public void setChecked( boolean checked )
- {
- super.setChecked( checked );
- }
-
-
- public boolean isChecked()
- {
- return super.isChecked();
- }
-
-
+ /**
+ * Disposes this action.
+ */
public void dispose()
{
}
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowLinksAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowLinksAction.java?rev=689845&r1=689844&r2=689845&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowLinksAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowLinksAction.java Thu Aug 28 07:56:37 2008
@@ -26,20 +26,31 @@
import org.eclipse.jface.action.Action;
+/**
+ * Action to enable/disable DNs as link.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class ShowLinksAction extends Action
{
+ /**
+ * Creates a new instance of ShowLinksAction.
+ */
public ShowLinksAction()
{
super( "DN as link", AS_CHECK_BOX );
super.setToolTipText( getText() );
super.setEnabled( true );
-
super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS ) );
}
+ /**
+ * {@inheritDoc}
+ */
public void run()
{
BrowserUIPlugin.getDefault().getPreferenceStore().setValue(
@@ -47,18 +58,9 @@
}
- public void setChecked( boolean checked )
- {
- super.setChecked( checked );
- }
-
-
- public boolean isChecked()
- {
- return super.isChecked();
- }
-
-
+ /**
+ * Disposes this action.
+ */
public void dispose()
{
}
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowQuickFilterAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowQuickFilterAction.java?rev=689845&r1=689844&r2=689845&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowQuickFilterAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/ShowQuickFilterAction.java Thu Aug 28 07:56:37 2008
@@ -31,9 +31,11 @@
public class ShowQuickFilterAction extends Action
{
+ /** The Constant SHOW_QUICKFILTER_DIALOGSETTING_KEY. */
public static final String SHOW_QUICKFILTER_DIALOGSETTING_KEY = ShowQuickFilterAction.class.getName()
+ ".showQuickFilter";
+ /** The quick filter widget. */
private SearchResultEditorQuickFilterWidget quickFilterWidget;
@@ -41,7 +43,8 @@
{
super( "Show Quick Filter", AS_CHECK_BOX );
super.setToolTipText( "Show Quick Filter" );
- super.setImageDescriptor( BrowserCommonActivator.getDefault().getImageDescriptor( BrowserCommonConstants.IMG_FILTER ) );
+ super.setImageDescriptor( BrowserCommonActivator.getDefault().getImageDescriptor(
+ BrowserCommonConstants.IMG_FILTER ) );
super.setActionDefinitionId( IWorkbenchActionDefinitionIds.FIND_REPLACE );
super.setEnabled( true );
@@ -53,40 +56,43 @@
}
super.setChecked( BrowserUIPlugin.getDefault().getDialogSettings().getBoolean(
SHOW_QUICKFILTER_DIALOGSETTING_KEY ) );
- this.quickFilterWidget.setActive( super.isChecked() );
+ quickFilterWidget.setActive( isChecked() );
}
+ /**
+ * {@inheritDoc}
+ */
public void run()
{
-
- boolean checked = super.isChecked();
+ boolean checked = isChecked();
super.setChecked( !checked );
- BrowserUIPlugin.getDefault().getDialogSettings().put( SHOW_QUICKFILTER_DIALOGSETTING_KEY, super.isChecked() );
+ BrowserUIPlugin.getDefault().getDialogSettings().put( SHOW_QUICKFILTER_DIALOGSETTING_KEY, isChecked() );
- if ( this.quickFilterWidget != null )
+ if ( quickFilterWidget != null )
{
- this.quickFilterWidget.setActive( super.isChecked() );
+ quickFilterWidget.setActive( isChecked() );
}
}
+ /**
+ * {@inheritDoc}
+ *
+ * This implementation does nothing. Toggling of the checked state is done within the run() method.
+ */
public void setChecked( boolean checked )
{
- // super.setChecked(checked);
- }
-
-
- public boolean isChecked()
- {
- return super.isChecked();
}
+ /**
+ * Disposes this action.
+ */
public void dispose()
{
- this.quickFilterWidget = null;
+ quickFilterWidget = null;
}
}