KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > activities > ws > ActivityContentProvider


1 /*******************************************************************************
2  * Copyright (c) 2003, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.activities.ws;
12
13 import java.util.Collection JavaDoc;
14
15 import org.eclipse.jface.viewers.IStructuredContentProvider;
16 import org.eclipse.jface.viewers.Viewer;
17 import org.eclipse.ui.activities.IActivityManager;
18
19 /**
20  * @since 3.0
21  */

22 public class ActivityContentProvider implements 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 JavaDoc[] getElements(Object JavaDoc inputElement) {
44         Object JavaDoc[] activities = new Object JavaDoc[0];
45         if (inputElement instanceof IActivityManager) {
46             activities = ((IActivityManager) inputElement)
47                     .getDefinedActivityIds().toArray();
48         } else if (inputElement instanceof Collection JavaDoc) {
49             activities = ((Collection JavaDoc) 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 JavaDoc oldInput, Object JavaDoc newInput) {
61     }
62 }
63
Popular Tags