01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jface.viewers;
11:
12: /**
13: * Filter that accepts everything. Available as a singleton since having
14: * more than one instance would be wasteful.
15: *
16: * @since 3.1
17: */
18: public final class AcceptAllFilter implements IFilter {
19:
20: /**
21: * Returns the singleton instance of AcceptAllFilter
22: *
23: * @return the singleton instance of AcceptAllFilter
24: */
25: public static IFilter getInstance() {
26: return singleton;
27: }
28:
29: /**
30: * The singleton instance
31: */
32: private static IFilter singleton = new AcceptAllFilter();
33:
34: /* (non-Javadoc)
35: * @see org.eclipse.jface.viewers.deferred.IFilter#select(java.lang.Object)
36: */
37: public boolean select(Object toTest) {
38: return true;
39: }
40:
41: /* (non-Javadoc)
42: * @see java.lang.Object#equals(java.lang.Object)
43: */
44: public boolean equals(Object other) {
45: return other == this || other instanceof AcceptAllFilter;
46: }
47:
48: }
|