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 190959 Details for
Bug 339644
Tooltips for Canvas display incorrect for bidi only for Linux(Suse11 sp1, and Redhat6)
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.
sample code
SimpleCanvas.java (text/x-java-source), 1.68 KB, created by
yanghang
on 2011-03-11 02:42:03 EST
(
hide
)
Description:
sample code
Filename:
MIME Type:
Creator:
yanghang
Created:
2011-03-11 02:42:03 EST
Size:
1.68 KB
patch
obsolete
> >import org.eclipse.osgi.util.TextProcessor; >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >/** > * This class demonstrates a Canvas > */ >public class SimpleCanvas { > /** > * Runs the application > */ > public void run() { > Display display = new Display(); > Shell shell = new Shell(display, SWT.DIALOG_TRIM|SWT.RIGHT_TO_LEFT); > > shell.setText("Canvas Example"); > createContents(shell); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > display.dispose(); > } > > /** > * Creates the main window's contents > * > * @param shell the main window > */ > private void createContents(Shell shell) { > shell.setLayout(new FillLayout()); > > // Create a canvas > Canvas canvas = new Canvas(shell, SWT.NONE); > > > > // Create a paint handler for the canvas > canvas.addPaintListener(new PaintListener() { > public void paintControl(PaintEvent e) { > // Do some drawing > Rectangle rect = ((Canvas) e.widget).getBounds(); > e.gc.setForeground(e.display.getSystemColor(SWT.COLOR_RED)); > e.gc.drawFocus(5, 5, rect.width - 10, rect.height - 10); > e.gc.drawText("test ××§××ת", 60, 60); > } > }); > canvas.setToolTipText(TextProcessor.process("test ××§××ת")); > //canvas.setToolTipText("test ××§××ת"); > } > > /** > * The application entry point > * > * @param args the command line arguments > */ > public static void main(String[] args) { > new SimpleCanvas().run(); > } >} >
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 339644
:
190958
| 190959