Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2020-05-26 16:54:23 +0000
committerMickael Istria2020-06-08 14:59:39 +0000
commit285c6cb0f5a45a011845bda201ca235843f2cb01 (patch)
tree61414ef6338e1f672e8b4282dcc1a58eb9c5c246
parenta733041c6838095813815507cd6d19e7ec997e76 (diff)
downloadeclipse.platform.text-285c6cb0f5a45a011845bda201ca235843f2cb01.tar.gz
eclipse.platform.text-285c6cb0f5a45a011845bda201ca235843f2cb01.tar.xz
eclipse.platform.text-285c6cb0f5a45a011845bda201ca235843f2cb01.zip
Bug 533429 - [printing] Add date to print headerI20200609-0150I20200608-1800
Change-Id: I81a384b64ee997dcda2917502a05132e86a5480f Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
index 8fd1c3662..53944224d 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
@@ -21,7 +21,9 @@ import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.StandardCharsets;
import java.nio.charset.UnsupportedCharsetException;
import java.text.BreakIterator;
+import java.text.DateFormat;
import java.text.MessageFormat;
+import java.util.Date;
import java.util.Iterator;
import org.eclipse.swt.SWT;
@@ -1374,7 +1376,8 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor {
options.printTextForeground= true;
options.printTextBackground= true;
options.jobName= getTitle();
- options.header= StyledTextPrintOptions.SEPARATOR + getTitle();
+ options.header= getTitle() + StyledTextPrintOptions.SEPARATOR + StyledTextPrintOptions.SEPARATOR
+ + DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT).format(new Date());
options.footer= StyledTextPrintOptions.SEPARATOR + NLSUtility.format(TextEditorMessages.AbstractDecoratedTextEditor_printPageNumber, StyledTextPrintOptions.PAGE_TAG);
if (isLineNumberRulerVisible()) {

Back to the top