Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 5237 Details for
Bug 15054
OwnerData or "virtual" Table support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
A simple test application to show a virtual table with 1000,000 rows
VirtualTableView.java (text/plain), 3.60 KB, created by
Michael Scharf
on 2003-06-18 22:31:24 EDT
(
hide
)
Description:
A simple test application to show a virtual table with 1000,000 rows
Filename:
MIME Type:
Creator:
Michael Scharf
Created:
2003-06-18 22:31:24 EDT
Size:
3.60 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2000, 2003 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Common Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/cpl-v10.html > * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >package org.eclipse.swt.widgets.tests; > > >import java.net.MalformedURLException; >import java.net.URL; > >import org.eclipse.jface.resource.ImageDescriptor; >import org.eclipse.jface.window.ApplicationWindow; >import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Image; >import org.eclipse.swt.layout.GridData; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Control; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.TableColumn; >import org.eclipse.swt.widgets.TableVirtual; >/** > * Ole uses <code>org.eclipse.swt</code> to demonstrate Win32 OLE / ActiveX > * integration. > * > * @see ViewPart > */ >public class VirtualTableView extends ApplicationWindow { > > private static Image fImage1; > private static Image fImage2; > private Composite fDisplayArea; > private TableVirtual fVirtualTable; > > /** > * Constructs the OLE browser view. > */ > public VirtualTableView() { > super(null); > } > /** > * Runs main program. > */ > public static void main (String [] args) { > try { > fImage1= ImageDescriptor.createFromURL(new URL("http://twiki.org/p/pub/TWiki/SmiliesPlugin/smile.gif")).createImage(); > fImage2= ImageDescriptor.createFromURL(new URL("http://twiki.org/p/pub/TWiki/SmiliesPlugin/biggrin.gif")).createImage(); > } catch (MalformedURLException e) { > } > VirtualTableView w = new VirtualTableView(); > w.setBlockOnOpen(true); > w.open(); > Display.getCurrent().dispose(); > } > > protected Control createContents(Composite parent){ > getShell().setText("Table Test"); > fDisplayArea = new Composite(parent, SWT.NONE); > > GridLayout gridLayout = new GridLayout(); > gridLayout.numColumns = 3; > fDisplayArea.setLayout(gridLayout); > > createBrowserFrame(); > return fDisplayArea; > } > > > > /** > * Creates the Web browser OleFrame. > */ > private void createBrowserFrame() { > fVirtualTable=new TableVirtual(fDisplayArea, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI); > fVirtualTable.setVirtualLabelProvider(new TableVirtual.IVirtualTableLabelProvider() { > > public String getColumnText(int row, int column) { > row++; > if(column==0) > return ""+row; > else if(column==1) > return "r="+row+" c="+column; > else > return null; > } > public Image getColumnImage(int row, int column) { > if(column==1) > return null; > if(row%2==0) > return fImage1; > else > return fImage2; > } > > }); > fVirtualTable.createItems(1000000); > GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); > gridData.horizontalSpan = 3; > fVirtualTable.setLayoutData(gridData); > > TableColumn column = new TableColumn(fVirtualTable, SWT.LEFT); > column.setText("Name"); > column.setWidth(200); > > column = new TableColumn(fVirtualTable, SWT.RIGHT); > column.setText("Size"); > column.setWidth(100); > column = new TableColumn(fVirtualTable, SWT.LEFT); > column.setText("Icon"); > column.setWidth(30); > > fVirtualTable.setHeaderVisible(true); > getShell().setSize(300, 300); > > } > > > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 15054
:
5236
| 5237