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 75899 Details for
Bug 88678
jUnits needed for caret querying API
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.
[patch]
Patch for org.eclipse.draw2d.test.CaretTests.java
CaretTests_patch.txt (text/plain), 2.23 KB, created by
Matt Scarpino
on 2007-08-11 02:05:41 EDT
(
hide
)
Description:
Patch for org.eclipse.draw2d.test.CaretTests.java
Filename:
MIME Type:
Creator:
Matt Scarpino
Created:
2007-08-11 02:05:41 EDT
Size:
2.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.draw2d.test >Index: src/org/eclipse/draw2d/test/CaretTests.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/test/org.eclipse.draw2d.test/src/org/eclipse/draw2d/test/CaretTests.java,v >retrieving revision 1.2 >diff -u -r1.2 CaretTests.java >--- src/org/eclipse/draw2d/test/CaretTests.java 29 Mar 2005 23:57:50 -0000 1.2 >+++ src/org/eclipse/draw2d/test/CaretTests.java 11 Aug 2007 06:01:27 -0000 >@@ -11,9 +11,62 @@ > > package org.eclipse.draw2d.test; > >+import org.eclipse.draw2d.FigureCanvas; >+import org.eclipse.draw2d.geometry.Point; >+import org.eclipse.draw2d.text.CaretInfo; >+import org.eclipse.swt.widgets.Shell; >+ > /** > * @since 3.1 > */ > public class CaretTests extends SimpleTextTest { >- >+ >+ int trail[] = new int[1]; >+ int offset; >+ Point offsetPoint; >+ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ flowpage.setFont(TAHOMA); >+ >+ // Necessary to call getNextOffset() >+ sentence.setText(PHRASE + "\n" + PHRASE); >+ >+ // Necessary to create figure with size > 0 >+ Shell shell = new Shell(); >+ FigureCanvas fc = new FigureCanvas(shell); >+ fc.setContents(flowpage); >+ fc.pack(); >+ } >+ >+ public void testOffset() { >+ offsetPoint = new Point(118, 7); >+ offset = sentence.getOffset(offsetPoint, trail, null); >+ assertEquals(offset, 23); >+ assertEquals(trail[0], 0); >+ } >+ >+ public void testNextOffset() { >+ offsetPoint = new Point(129, 0); >+ offset = sentence.getNextOffset(offsetPoint, true, null); >+ assertEquals(offset, 72); >+ assertEquals(trail[0], 0); >+ >+ offsetPoint = new Point(77, 18); >+ offset = sentence.getNextOffset(offsetPoint, false, null); >+ assertEquals(offset, 14); >+ assertEquals(trail[0], 0); >+ } >+ >+ public void testCaretPlacement() { >+ offsetPoint = new Point(11, 21); >+ offset = sentence.getOffset(offsetPoint, trail, null); >+ CaretInfo info = sentence.getCaretPlacement(offset, trail[0] != 0); >+ assertEquals(info.getBaseline(), 24); >+ assertEquals(info.getHeight(), 13); >+ assertEquals(info.getLineHeight(), 13); >+ assertEquals(info.getLineY(), 13); >+ assertEquals(info.getX(), 12); >+ assertEquals(info.getY(), 13); >+ } > }
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 88678
: 75899