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 183983 Details for
Bug 331274
Update on "RCP application with a view" template - ArrayContentProvider and TableViewerColumn
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.
TableViewerColumn
patchTableViewerColumnAPI.txt (text/plain), 1.99 KB, created by
Lars Vogel
on 2010-11-27 15:36:17 EST
(
hide
)
Description:
TableViewerColumn
Filename:
MIME Type:
Creator:
Lars Vogel
Created:
2010-11-27 15:36:17 EST
Size:
1.99 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P gsgasd >Index: src/gsgasd/View.java >=================================================================== >RCS file: src/gsgasd/View.java >diff -N src/gsgasd/View.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/gsgasd/View.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,57 @@ >+package gsgasd; >+ >+import org.eclipse.jface.viewers.ArrayContentProvider; >+import org.eclipse.jface.viewers.ColumnLabelProvider; >+import org.eclipse.jface.viewers.TableViewer; >+import org.eclipse.jface.viewers.TableViewerColumn; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.graphics.Image; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.TableColumn; >+import org.eclipse.ui.ISharedImages; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.part.ViewPart; >+ >+public class View extends ViewPart { >+ public static final String ID = "gsgasd.view"; >+ >+ private TableViewer viewer; >+ >+ /** >+ * This is a callback that will allow us to create the viewer and initialize >+ * it. >+ */ >+ public void createPartControl(Composite parent) { >+ viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL >+ | SWT.V_SCROLL); >+ viewer.setContentProvider(new ArrayContentProvider()); >+ >+ //Create the first column of the table >+ TableViewerColumn viewerColumn = new TableViewerColumn(viewer, >+ SWT.NONE); >+ TableColumn column = viewerColumn.getColumn(); >+ column.setWidth(100); >+ viewerColumn.setLabelProvider(new ColumnLabelProvider() { >+ @Override >+ public String getText(Object element) { >+ return element.toString(); >+ } >+ >+ @Override >+ public Image getImage(Object element) { >+ return PlatformUI.getWorkbench().getSharedImages().getImage( >+ ISharedImages.IMG_OBJ_ELEMENT); >+ } >+ }); >+ >+ // Provide the input to the ContentProvider >+ viewer.setInput(new String[] {"One", "Two", "Three"}); >+ } >+ >+ /** >+ * Passing the focus request to the viewer's control. >+ */ >+ public void setFocus() { >+ viewer.getControl().setFocus(); >+ } >+} >\ No newline at end of file
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 331274
:
183981
|
183983
|
183984