Lines Matching refs:textComponent
150 * Returns {@code TextComponentPrintable} to print {@code textComponent}.
152 * @param textComponent {@code JTextComponent} to print
155 * @return {@code TextComponentPrintable} to print {@code textComponent}
157 public static Printable getPrintable(final JTextComponent textComponent,
161 if (textComponent instanceof JEditorPane
162 && isFrameSetDocument(textComponent.getDocument())) {
165 List<JEditorPane> frames = getFrames((JEditorPane) textComponent);
174 return new TextComponentPrintable(textComponent,
274 * {@code textComponent} with {@code headerFormat} and {@code footerFormat}.
276 * @param textComponent {@code JTextComponent} to print
280 private TextComponentPrintable(JTextComponent textComponent,
283 this.textComponentToPrint = textComponent;
286 headerFont = textComponent.getFont().deriveFont(Font.BOLD,
288 footerFont = textComponent.getFont().deriveFont(Font.PLAIN,
293 this.printShell = createPrintShell(textComponent);
299 * It creates closest text component to {@code textComponent}
303 * @param textComponent {@code JTextComponent} to create a
307 private JTextComponent createPrintShell(final JTextComponent textComponent) {
309 return createPrintShellOnEDT(textComponent);
315 return createPrintShellOnEDT(textComponent);
335 private JTextComponent createPrintShellOnEDT(final JTextComponent textComponent) {
339 if (textComponent instanceof JTextField) {
344 ((JTextField) textComponent).getHorizontalAlignment());
353 } else if (textComponent instanceof JTextArea) {
357 JTextArea textArea = (JTextArea) textComponent;
369 } else if (textComponent instanceof JTextPane) {
380 if (getDocument() == textComponent.getDocument()) {
381 return ((JTextPane) textComponent).getEditorKit();
387 } else if (textComponent instanceof JEditorPane) {
398 if (getDocument() == textComponent.getDocument()) {
399 return ((JEditorPane) textComponent).getEditorKit();
410 ret.setOpaque(textComponent.isOpaque());
411 ret.setEditable(textComponent.isEditable());
412 ret.setEnabled(textComponent.isEnabled());
413 ret.setFont(textComponent.getFont());
414 ret.setBackground(textComponent.getBackground());
415 ret.setForeground(textComponent.getForeground());
417 textComponent.getComponentOrientation());
421 textComponent.getClientProperty(
424 textComponent.getClientProperty(JEditorPane.W3C_LENGTH_UNITS));
426 textComponent.getClientProperty("charset"));
428 ret.setDocument(textComponent.getDocument());