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 279819 Details for
Bug 550555
org.eclipse.swt.SWTError: No more handles error when 10K Hyperlinks are created
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Create table with fake controls.
TableEditorTest2.java (text/plain), 4.08 KB, created by
Paul Pazderski
on 2019-09-09 15:42:43 EDT
(
hide
)
Description:
Create table with fake controls.
Filename:
MIME Type:
Creator:
Paul Pazderski
Created:
2019-09-09 15:42:43 EDT
Size:
4.08 KB
patch
obsolete
>package tableColumnProject; > > >import java.util.ArrayList; >import java.util.List; > >import org.eclipse.jface.viewers.ArrayContentProvider; >import org.eclipse.jface.viewers.ColumnLabelProvider; >import org.eclipse.jface.viewers.StyledCellLabelProvider; >import org.eclipse.jface.viewers.TableViewer; >import org.eclipse.jface.viewers.TableViewerColumn; >import org.eclipse.jface.viewers.ViewerCell; >import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.TableColumn; > >public class TableEditorTest2 { > > /** > * @param args > */ > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > > shell.setLayout(new FillLayout()); > > > TableViewer viewer = new TableViewer(shell, SWT.FULL_SELECTION); > viewer.getTable().setHeaderVisible(true); > viewer.getTable().setLinesVisible(true); > viewer.setContentProvider(new ArrayContentProvider()); > > TableColumn column = new TableColumn(viewer.getTable(), SWT.NONE); > column.setText("First Name"); //$NON-NLS-1$ > column.setWidth(100); > TableViewerColumn firstNameCol = new TableViewerColumn(viewer, column); > > firstNameCol.setLabelProvider(new ColumnLabelProvider(){ > > @Override > public String getText(Object element) { > Person p = (Person)element; > > return p.getFirstName(); > } > > }); > > column = new TableColumn(viewer.getTable(), SWT.NONE); > column.setText("Last Name"); //$NON-NLS-1$ > column.setWidth(100); > TableViewerColumn lastNameCol = new TableViewerColumn(viewer, column); > lastNameCol.setLabelProvider(new ColumnLabelProvider(){ > > @Override > public String getText(Object element) { > Person p = (Person)element; > > return p.getLastName(); > } > > }); > > column = new TableColumn(viewer.getTable(), SWT.NONE); > column.setText("Actions"); //$NON-NLS-1$ > column.setWidth(100); > TableViewerColumn actionsNameCol = new TableViewerColumn(viewer, column); > actionsNameCol.setLabelProvider(new StyledCellLabelProvider() { > > @Override > public void update(ViewerCell cell) { > cell.setText("Remove"); //$NON-NLS-1$ > cell.setBackground(display.getSystemColor(SWT.COLOR_GRAY)); > super.update(cell); > } > > }); > viewer.getTable().addMouseMoveListener(e -> { > ViewerCell cell = viewer.getCell(new Point(e.x, e.y)); > if (cell != null && cell.getColumnIndex() == 2) { > viewer.getTable().setCursor(display.getSystemCursor(SWT.CURSOR_HAND)); > } else { > viewer.getTable().setCursor(display.getSystemCursor(SWT.CURSOR_ARROW)); > } > }); > viewer.getTable().addListener(SWT.MouseUp, e -> { > ViewerCell cell = viewer.getCell(new Point(e.x, e.y)); > if (cell != null && cell.getColumnIndex() == 2) { > cell.getViewerRow().getItem().dispose(); > } > }); > > > List<Person> persons = new ArrayList<Person>(); > for (int i = 0; i < 100000; i++) { > Person p = new Person(); > p.setFirstName("FirstName_"+i); //$NON-NLS-1$ > p.setLastName("LastName_"+i); //$NON-NLS-1$ > > persons.add(p); > } > > > viewer.setInput(persons); > > shell.layout(); > shell.open(); > while(!shell.isDisposed()) > { > > if(!display.readAndDispatch()) > { > display.sleep(); > } > } > > display.dispose(); > } > > > private static class Person > { > > String firstName; > String lastName; > > Person() > { > > } > > public String getFirstName() { > return firstName; > } > > public String getLastName() { > return lastName; > } > > public void setFirstName(String firstName) { > this.firstName = firstName; > } > > public void setLastName(String lastName) { > this.lastName = lastName; > } > > } > > >}
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 550555
:
279705
| 279819