• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.ddmuilib.logcat;
17 
18 import org.eclipse.jface.viewers.IStructuredContentProvider;
19 import org.eclipse.jface.viewers.Viewer;
20 
21 import java.util.List;
22 
23 /**
24  * A JFace content provider for logcat filter list, used in {@link LogCatPanel}.
25  */
26 public final class LogCatFilterContentProvider implements IStructuredContentProvider {
dispose()27     public void dispose() {
28     }
29 
inputChanged(Viewer arg0, Object arg1, Object arg2)30     public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
31     }
32 
33     /**
34      * Obtain the list of filters currently in use.
35      * @param model list of {@link LogCatFilter}'s
36      * @return array of {@link LogCatFilter} objects, or null.
37      */
getElements(Object model)38     public Object[] getElements(Object model) {
39         if (model instanceof List<?>) {
40             return ((List<?>) model).toArray();
41         }
42         return null;
43     }
44 
45 }
46