blob: 2da6dc26ed0d5882d0a6dde75a477a3dd47fee51 [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.Task;
import com.ibm.uma.util.AssociationHelper;
/**
* @author Phong Nguyen Le
* @since 1.0
*/
public class UncategorizedTasksItemProvider extends UncategorizedItemProvider {
/**
* @param adapterFactory
* @param coreContentPkg
*/
public UncategorizedTasksItemProvider(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 Task
&& AssociationHelper.getDiscipline((Task) obj) == null;
}
};
// children = ObjectLinkItemProviderList.createList(adapterFactory,
// children, object, list.getList());
// return children;
return createWrappers(list.getList());
}
/*
* (non-Javadoc)
*
* @see com.ibm.library.edit.category.UncategorizedItemProvider#getText(java.lang.Object)
*/
public String getText(Object object) {
return LibraryEditPlugin.INSTANCE
.getString("_UI_Uncategorized_Tasks_text"); //$NON-NLS-1$
}
/*
* (non-Javadoc)
*
* @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getImage(java.lang.Object)
*/
public Object getImage(Object object) {
return LibraryEditPlugin.INSTANCE.getImage("full/obj16/Tasks"); //$NON-NLS-1$
}
}