01: /*******************************************************************************
02: * Copyright (c) 2000, 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.ui.internal.console;
11:
12: import org.eclipse.core.expressions.PropertyTester;
13: import org.eclipse.ui.console.IConsole;
14:
15: /**
16: * Tests if an IOConsole's type matches the expected value
17: *
18: * @since 3.1
19: */
20: public class ConsoleTypePropertyTester extends PropertyTester {
21:
22: /* (non-Javadoc)
23: * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
24: */
25: public boolean test(Object receiver, String property,
26: Object[] args, Object expectedValue) {
27: IConsole console = (IConsole) receiver;
28: String type = console.getType();
29: return type != null ? type.equals(expectedValue) : false;
30: }
31:
32: }
|