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 16160 Details for
Bug 79542
A bug in Thumbnail.ThumbnailUpdater
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Thumbnail bug demo
ThumbnailTest.java (text/plain), 2.27 KB, created by
Milos Volauf
on 2004-11-26 05:09:50 EST
(
hide
)
Description:
Thumbnail bug demo
Filename:
MIME Type:
Creator:
Milos Volauf
Created:
2004-11-26 05:09:50 EST
Size:
2.27 KB
patch
obsolete
>/* > * Created on Nov 26, 2004 > */ >package com.whitestein.eclipse.thumbnaildemo; > >import org.eclipse.draw2d.ColorConstants; >import org.eclipse.draw2d.Figure; >import org.eclipse.draw2d.IFigure; >import org.eclipse.draw2d.Label; >import org.eclipse.draw2d.LightweightSystem; >import org.eclipse.draw2d.RectangleFigure; >import org.eclipse.draw2d.ScrollPane; >import org.eclipse.draw2d.ToolbarLayout; >import org.eclipse.draw2d.geometry.Rectangle; >import org.eclipse.draw2d.parts.Thumbnail; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >/** > * A test class for demonstrating a Thumbnail bug. > * > * @author Milos Volauf > */ >public class ThumbnailTest { > > public static void main(String args[]) { > Display d = new Display(); > Shell shell = new Shell(d); > shell.setBackground(ColorConstants.white); > shell.setSize(400, 400); > shell.setText("Thumbnail Test"); > LightweightSystem lws = new LightweightSystem(shell); > > IFigure contents = new ContentsFigure(); > lws.setContents(contents); > > shell.open(); > while (!shell.isDisposed()) > while (!d.readAndDispatch()) > d.sleep(); > } > > private static class ContentsFigure extends Figure { > > private ScrollPane scrollPane; > private Thumbnail thumbnail; > private Figure figure; > > public ContentsFigure() { > figure = new Figure(); > ToolbarLayout toolbarLayout = new ToolbarLayout(); > toolbarLayout.setSpacing(10); > figure.setLayoutManager(toolbarLayout); > > for (int i = 0; i < 10; i++) { > RectangleFigure fig = new RectangleFigure(); > fig.setPreferredSize(100, 100); > if (i % 2 == 0) > fig.setBackgroundColor(ColorConstants.lightBlue); > figure.add(fig); > figure.add(new Label("Hello")); > } > scrollPane = new ScrollPane(); > scrollPane.setContents(figure); > add(scrollPane); > > thumbnail = new Thumbnail(); > add(thumbnail); > } > > public void addNotify() { > super.addNotify(); > > // set a source for the thumbnail here > // so that an UpdateManager is valid > thumbnail.setSource(figure); > } > > protected void layout() { > Rectangle area = getClientArea(); > scrollPane.setBounds(area); > > Rectangle thumbnailRect = new Rectangle(area.x, area.bottom() - 150, 100, 150); > thumbnail.setBounds(thumbnailRect); > } > } >}
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 79542
: 16160 |
16161
|
83071
|
123955