blob: 999a8b4edb116b89d6bd37cf66698531cfe7d8bc [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2014 Xored Software Inc and others.
* 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:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.internal.launching.ext.ui;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.rcptt.launching.ext.AUTInformation;
import org.eclipse.rcptt.launching.target.ITargetPlatformHelper;
public class AUTInformationViewer {
private TableViewer informationViewer;
public void create(Composite parent) {
informationViewer = new TableViewer(parent);
informationViewer.getTable().setHeaderVisible(true);
TableColumn col1 = new TableColumn(informationViewer.getTable(),
SWT.NONE);
col1.setText("Property");
col1.setWidth(150);
TableColumn col2 = new TableColumn(informationViewer.getTable(),
SWT.NONE);
col2.setText("Value");
col2.setWidth(300);
GridData infoGD = new GridData(SWT.FILL, SWT.DEFAULT, true, false, 3, 1);
infoGD.heightHint = 100;
informationViewer.getControl().setLayoutData(infoGD);
informationViewer.setContentProvider(new ArrayContentProvider());
informationViewer.setLabelProvider(new MapLabelProvider());
}
public void updateInfo(ITargetPlatformHelper info) {
// Initialize viewer with status
informationViewer.setInput(AUTInformation.getInformationMap(info)
.entrySet());
informationViewer.refresh();
}
}