/******************************************************************************* * Copyright (c) 2012 Google, Inc. * 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: * Google, Inc. - initial API and implementation *******************************************************************************/ package com.windowtester.sandbox.views; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; import org.eclipse.ui.part.ViewPart; public class TableInAView extends ViewPart { private Table table; public static final String ID = "com.windowtester.sandbox.views.TableInAView"; //$NON-NLS-1$ /** * Create contents of the view part * @param parent */ @Override public void createPartControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); table = new Table(container, SWT.BORDER); table.setLinesVisible(true); table.setHeaderVisible(true); table.setBounds(10, 10, 100, 100); final TableItem newItemTableItem = new TableItem(table, SWT.BORDER); newItemTableItem.setText("New item 1"); final TableItem newItemTableItem_1 = new TableItem(table, SWT.BORDER); newItemTableItem_1.setText("New item 2"); // createActions(); initializeToolBar(); initializeMenu(); } /** * Create the actions */ private void createActions() { // Create the actions } /** * Initialize the toolbar */ private void initializeToolBar() { // IToolBarManager toolbarManager = getViewSite().getActionBars() // .getToolBarManager(); } /** * Initialize the menu */ private void initializeMenu() { // IMenuManager menuManager = getViewSite().getActionBars() // .getMenuManager(); } @Override public void setFocus() { // Set the focus } }