blob: 61b2f844135887eb94b18371d9d54b7b0fcc704d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*******************************************************************************
* Copyright (c) 2016 Red Hat.
* 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:
* Red Hat - Initial Contribution
*******************************************************************************/
package org.eclipse.linuxtools.internal.docker.ui.views;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.linuxtools.docker.core.IDockerConnection;
import org.eclipse.linuxtools.docker.core.IDockerConnectionSettings;
/**
* @author jjohnstn
*
*/
public class ConnectionSettingsContentProvider implements ITreeContentProvider {
private static final Object[] EMPTY = new Object[0];
@Override
public void dispose() {
}
@Override
public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
}
@Override
public Object[] getElements(final Object inputElement) {
if (inputElement instanceof IDockerConnection) {
final IDockerConnection connection = (IDockerConnection) inputElement;
IDockerConnectionSettings data = connection.getSettings();
if (data != null) {
return data.getProperties();
}
}
return EMPTY;
}
@Override
public Object[] getChildren(final Object parentElement) {
return EMPTY;
}
@Override
public Object getParent(final Object element) {
return null;
}
@Override
public boolean hasChildren(final Object element) {
return false;
}
}
|