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 26998 Details for
Bug 19602
[Printing] Line numbers aren't printed
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]
Quick and dirty fix
eclipse-SDK-3.1-print-line-numbers.patch (text/plain), 1.81 KB, created by
John Clark
on 2005-09-10 00:23:44 EDT
(
hide
)
Description:
Quick and dirty fix
Filename:
MIME Type:
Creator:
John Clark
Created:
2005-09-10 00:23:44 EDT
Size:
1.81 KB
patch
obsolete
>--- old/plugins/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/PrintRenderer.java 2005-06-27 14:54:40.000000000 -0400 >+++ new/plugins/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/PrintRenderer.java 2005-09-09 22:07:27.375000000 -0400 >@@ -54,7 +54,7 @@ > Hashtable lineStyles, Hashtable bidiSegments, > int tabLength, Rectangle clientArea) { > super(device, regularFont); >- this.logicalContent = logicalContent; >+ this.logicalContent = prefixLineNumbers(logicalContent); > this.lineBackgrounds = lineBackgrounds; > this.lineStyles = lineStyles; > this.bidiSegments = bidiSegments; >@@ -62,7 +62,7 @@ > this.gc = gc; > calculateLineHeight(); > setTabLength(tabLength); >- content = new WrappedContent(this, logicalContent); >+ content = new WrappedContent(this, this.logicalContent); > // wrapLines requires tab width to be known > content.wrapLines(); > } >@@ -264,4 +264,28 @@ > protected boolean isFullLineSelection() { > return false; > } >+ >+protected StyledTextContent prefixLineNumbers(StyledTextContent logicalContent) >+{ >+ StyledTextContent content = logicalContent; >+ String nl = content.getLineDelimiter(); >+ int lineNumLenMax = String.valueOf(content.getLineCount()).length(); >+ int newCharCount = content.getCharCount() >+ + (content.getLineCount() * (lineNumLenMax + 2)); >+ StringBuffer buf = new StringBuffer(newCharCount + 16); >+ >+ for (int i = 0; i < content.getLineCount(); i++) { >+ String lineNum = String.valueOf(i + 1); >+ for (int j = 0; j < (lineNumLenMax - lineNum.length()); j++) { >+ buf.append(" "); >+ } >+ buf.append(lineNum); >+ buf.append(" "); >+ buf.append(content.getLine(i)); >+ buf.append(nl); >+ } >+ >+ content.setText(buf.toString()); >+ return content; >+} > }
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 19602
: 26998 |
34574
|
34575
|
34576
|
34577
|
59913
|
80953