Lines 41-46
Link Here
|
41 |
package org.netbeans.modules.print.api; |
41 |
package org.netbeans.modules.print.api; |
42 |
|
42 |
|
43 |
import javax.swing.Action; |
43 |
import javax.swing.Action; |
|
|
44 |
import org.netbeans.modules.print.Trampoline; |
45 |
import org.netbeans.modules.print.api.PrintManager.Job; |
44 |
import org.netbeans.modules.print.spi.PrintProvider; |
46 |
import org.netbeans.modules.print.spi.PrintProvider; |
45 |
|
47 |
|
46 |
/** |
48 |
/** |
Lines 51-65
Link Here
|
51 |
|
53 |
|
52 |
/** |
54 |
/** |
53 |
* Prints or shows preview dialog for given print provider. |
55 |
* Prints or shows preview dialog for given print provider. |
54 |
* @param provider to be previewed |
56 |
* @param job to be previewed |
55 |
* @param withPreview if true, shows preview dialog before printing |
57 |
* @param withPreview if true, shows preview dialog before printing |
56 |
* otherwise sends data to printer |
58 |
* otherwise sends data to printer |
57 |
*/ |
59 |
*/ |
58 |
void print(PrintProvider provider, boolean withPreview); |
60 |
void print(Job job, boolean withPreview); |
59 |
|
61 |
|
60 |
/** |
62 |
/** |
61 |
* Returns Preview action. |
63 |
* Returns Preview action. |
62 |
* @return Preview action |
64 |
* @return Preview action |
63 |
*/ |
65 |
*/ |
64 |
Action getPreviewAction(); |
66 |
Action getPreviewAction(); |
|
|
67 |
|
68 |
|
69 |
public static final class Job { |
70 |
private PrintProvider provider; |
71 |
|
72 |
Job(PrintProvider provider) { |
73 |
this.provider = provider; |
65 |
} |
74 |
} |
|
|
75 |
static { |
76 |
Trampoline.API = new Trampoline() { |
77 |
|
78 |
public Job createJob(PrintProvider p) { |
79 |
return new Job(p); |
80 |
} |
81 |
|
82 |
public PrintProvider findProvider(Job job) { |
83 |
return job.provider; |
84 |
} |
85 |
|
86 |
}; |
87 |
} |
88 |
} |
89 |
|
90 |
} |