blob: 95656ade5791b01873fdd339079445e69427b503 [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.configuration;
import java.util.Collection;
import java.util.Iterator;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.epf.library.edit.util.TngUtil;
import com.ibm.uma.Activity;
import com.ibm.uma.UmaPackage;
/**
* @author Phong Nguyen Le
* @since 1.0
*/
public class DeliveryProcessItemProvider extends
com.ibm.uma.provider.DeliveryProcessItemProvider {
public DeliveryProcessItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
public Collection getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(UmaPackage.eINSTANCE
.getActivity_BreakdownElements());
}
return childrenFeatures;
}
public Collection getChildren(Object object) {
Collection children = super.getChildren(object);
for (Iterator iter = children.iterator(); iter.hasNext();) {
Object element = iter.next();
if (!(element instanceof Activity)) {
iter.remove();
}
}
return children;
}
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(Activity.class)) {
case UmaPackage.ACTIVITY__BREAKDOWN_ELEMENTS:
switch (notification.getEventType()) {
case Notification.ADD:
case Notification.ADD_MANY:
case Notification.REMOVE:
case Notification.REMOVE_MANY:
case Notification.MOVE:
fireNotifyChanged(new ViewerNotification(notification,
notification.getNotifier(), true, false));
return;
}
return;
}
super.notifyChanged(notification);
}
public String getText(Object object) {
return TngUtil.getLabel(object, getString("_UI_DeliveryProcess_type")); //$NON-NLS-1$
}
}