/******************************************************************************* * Copyright (c) 2010 Intel Corporation. * 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: * Intel - initial API and implementation *******************************************************************************/ package org.yocto.sdk.remotetools.views; import java.io.BufferedReader; import java.io.FileReader; import java.util.ArrayList; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.part.*; import org.eclipse.jface.viewers.*; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.*; import org.eclipse.swt.SWT; /** * This sample class demonstrates how to plug-in a new * workbench view. The view shows data obtained from the * model. The sample creates a dummy model on the fly, * but a real implementation would connect to the model * available either in this or another plug-in (e.g. the workspace). * The view is connected to the model using a content provider. *
* The view uses a label provider to define how model * objects should be presented in the view. Each * view can present the same model objects using * different labels and icons, if needed. Alternatively, * a single label provider can be shared between views * in order to ensure that objects of the same type are * presented in the same way everywhere. *
*/
public class BaseFileView extends ViewPart {
/**
* The ID of the view as specified by the extension.
*/
public static final String ID = "org.yocto.sdk.remotetools.views.BaseFileView";
private TableViewer viewer;
private String filename;
/*
* The content provider class is responsible for
* providing objects to the view. It can wrap
* existing objects in adapters or simply return
* objects as-is. These objects may be sensitive
* to the current input of the view, or ignore
* it and always show the same content
* (like Task List, for example).
*/
class ViewContentProvider implements IStructuredContentProvider {
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
if(newInput instanceof String)
filename=(String)newInput;
}
public void dispose() {
}
public Object[] getElements(Object parent) {
ArrayList