blob: 6ec01ef957d633f28735c86dd4b62c865c706345 [file] [log] [blame]
//------------------------------------------------------------------------------
// Copyright (c) 2005, 2006 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 implementation
//------------------------------------------------------------------------------
package org.eclipse.epf.library.edit.category;
import java.util.Collection;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.epf.library.edit.LibraryEditPlugin;
import org.eclipse.epf.library.edit.util.ContentElementList;
import com.ibm.uma.ContentPackage;
import com.ibm.uma.WorkProduct;
import com.ibm.uma.util.AssociationHelper;
/**
* @author Phong Nguyen Le
* @since 1.0
*/
public class DomainUncategorizedWorkProductItemProvider extends
UncategorizedItemProvider {
/**
* @param adapterFactory
* @param coreContentPkg
*/
public DomainUncategorizedWorkProductItemProvider(
AdapterFactory adapterFactory, ContentPackage coreContentPkg) {
super(adapterFactory, coreContentPkg);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object)
*/
public Collection getChildren(Object object) {
ContentElementList list = new ContentElementList(coreContentPkg) {
public boolean accept(Object obj) {
return obj instanceof WorkProduct
&& AssociationHelper.getDomain((WorkProduct) obj) == null;
}
};
// children = ObjectLinkItemProviderList.createList(adapterFactory,
// children, object, list.getList());
// return children;
return createWrappers(list.getList());
}
/*
* (non-Javadoc)
*
* @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getImage(java.lang.Object)
*/
public Object getImage(Object object) {
return LibraryEditPlugin.INSTANCE.getImage("full/obj16/WorkProducts"); //$NON-NLS-1$
}
}