Java 类org.eclipse.swt.custom.StyledTextPrintOptions 实例源码

项目:AppleCommander    文件:StyledTextAdapter.java   
public void print() {
    final Printer printer = SwtUtil.showPrintDialog(styledText);
    if (printer == null) return;    // Print was cancelled
    StyledTextPrintOptions options = new StyledTextPrintOptions();
    options.jobName = printJobName;
    options.printLineBackground = true;
    options.printTextBackground = true;
    options.printTextFontStyle = true;
    options.printTextForeground = true;
    options.footer = "\t<page>"; //$NON-NLS-1$ (for StyledText widget!)
    options.header = "\t" + printJobName; //$NON-NLS-1$

    final Runnable runnable = styledText.print(printer, options);
    new Thread(new Runnable() {
        public void run() {
            runnable.run();
            printer.dispose();
        }
    }).start();
}
项目:applecommander    文件:StyledTextAdapter.java   
public void print() {
    final Printer printer = SwtUtil.showPrintDialog(styledText);
    if (printer == null) return;    // Print was cancelled
    StyledTextPrintOptions options = new StyledTextPrintOptions();
    options.jobName = printJobName;
    options.printLineBackground = true;
    options.printTextBackground = true;
    options.printTextFontStyle = true;
    options.printTextForeground = true;
    options.footer = "\t<page>"; //$NON-NLS-1$ (for StyledText widget!)
    options.header = "\t" + printJobName; //$NON-NLS-1$

    final Runnable runnable = styledText.print(printer, options);
    new Thread(new Runnable() {
        public void run() {
            runnable.run();
            printer.dispose();
        }
    }).start();
}
项目:RepDev    文件:MainShell.java   
protected void print() {
    if (mainfolder.getSelection() != null && mainfolder.getSelection().getControl() instanceof TabTextView) {
        PrintDialog dialog = new PrintDialog(shell);
        PrinterData data = dialog.open();

        if (data != null) {
            StyledTextPrintOptions options = new StyledTextPrintOptions();
            options.footer = "\t\t<page>";
            options.jobName = "RepDev - " + mainfolder.getSelection().getText();
            options.printLineBackground = false;
            options.printTextFontStyle = true;
            options.printTextForeground = true;
            options.printTextBackground = true;

            Runnable runnable = ((TabTextView) mainfolder.getSelection().getControl()).getStyledText().print(new Printer(data), options);
            runnable.run();
        }
    }
}
项目:Pydev    文件:ScriptConsoleViewerWrapper.java   
public void print(StyledTextPrintOptions options) {
    viewer.print(options);
}