01: /*******************************************************************************
02: * Copyright (c) 2003, 2006 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.activities.ws;
11:
12: import java.util.Collection;
13:
14: import org.eclipse.jface.viewers.IStructuredContentProvider;
15: import org.eclipse.jface.viewers.Viewer;
16: import org.eclipse.ui.activities.IActivityManager;
17:
18: /**
19: * @since 3.0
20: */
21: public class ActivityContentProvider implements
22: IStructuredContentProvider {
23:
24: /**
25: * @since 3.0
26: */
27: public ActivityContentProvider() {
28: }
29:
30: /*
31: * (non-Javadoc)
32: *
33: * @see org.eclipse.jface.viewers.IContentProvider#dispose()
34: */
35: public void dispose() {
36: }
37:
38: /*
39: * (non-Javadoc)
40: *
41: * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
42: */
43: public Object[] getElements(Object inputElement) {
44: Object[] activities = new Object[0];
45: if (inputElement instanceof IActivityManager) {
46: activities = ((IActivityManager) inputElement)
47: .getDefinedActivityIds().toArray();
48: } else if (inputElement instanceof Collection) {
49: activities = ((Collection) inputElement).toArray();
50: }
51: return activities;
52: }
53:
54: /*
55: * (non-Javadoc)
56: *
57: * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
58: * java.lang.Object, java.lang.Object)
59: */
60: public void inputChanged(Viewer viewer, Object oldInput,
61: Object newInput) {
62: }
63: }
|