blob: 52efdbc3bbb8f17489f55660b31da8ffa77c7206 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - Initial API and implementation
*******************************************************************************/
package org.eclipse.wst.server.ui.internal;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.ui.IActionFilter;
/**
* Adapter factory to adapt servers to IActionFilter.
*/
public class ServerAdapterFactory implements IAdapterFactory {
IActionFilter actionFilter = new IActionFilter() {
public boolean testAttribute(Object target, String name, String value) {
return ServerPropertyTester.checkProperty(target, name, value);
}
};
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType != IActionFilter.class)
return null;
return actionFilter;
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
public Class[] getAdapterList() {
return new Class[] { IActionFilter.class };
}
}