1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.message.ui;
14 import org.eclipse.jface.viewers.ITreeContentProvider;
15 import org.eclipse.jface.viewers.Viewer;
17 public class LogViewContentProvider implements ITreeContentProvider {
18 private LogView logView;
20 public LogViewContentProvider(LogView logView) {
21 this.logView = logView;
24 public void dispose() { // do nothing
27 public Object[] getChildren(Object element) {
28 return ((AbstractEntry) element).getChildren(element);
31 public Object[] getElements(Object element) {
32 return logView.getElements();
35 public Object getParent(Object element) {
36 if (element instanceof LogSession) {
39 return ((AbstractEntry) element).getParent(element);
42 public boolean hasChildren(Object element) {
43 return ((AbstractEntry) element).getChildren(element).length > 0;
46 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { // do nothing
49 public boolean isDeleted(Object element) {