private void clearDocument() { editorPane.setContentType("text/rtf"); Document doc = new DefaultStyledDocument(); editorPane.setDocument(doc); // defaultAttrSet = ((StyledEditorKit)editorPane.getEditorKit()).getInputAttributes(); // StyleConstants.setFontFamily(defaultAttrSet, "Lucinda Sans Unicode"); log.info("attr: "+defaultAttrSet); try { doc.insertString(0, " ", defaultAttrSet); } catch (Exception ex) { throw new RuntimeException(ex); } editorPane.setEditable(true); editorPane.revalidate(); editorPane.repaint(); saveUntagged.setEnabled(false); saveTaggedAs.setEnabled(false); taggedContents = null; htmlContents = null; loadedFile = null; }
public void clearDocument() { editorPane.setContentType("text/rtf"); Document doc = new DefaultStyledDocument(); editorPane.setDocument(doc); // defaultAttrSet = ((StyledEditorKit)editorPane.getEditorKit()).getInputAttributes(); // StyleConstants.setFontFamily(defaultAttrSet, "Lucinda Sans Unicode"); log.info("attr: "+defaultAttrSet); try { doc.insertString(0, " ", defaultAttrSet); } catch (Exception ex) { throw new RuntimeException(ex); } editorPane.setEditable(true); editorPane.revalidate(); editorPane.repaint(); saveUntagged.setEnabled(false); saveTaggedAs.setEnabled(false); taggedContents = null; untaggedContents = null; htmlContents = null; loadedFile = null; }
public void redraw() { String text = editorPane.getText(); taggedContents = null; untaggedContents = null; if (!editorPane.getContentType().equals("text/html")) { editorPane.setContentType("text/rtf"); Document doc = editorPane.getDocument(); try { doc.insertString(0, text, defaultAttrSet); } catch (Exception e) { throw new RuntimeException(e); } editorPane.revalidate(); editorPane.repaint(); editorPane.setEditable(true); htmlContents = null; } else { editorPane.setEditable(false); htmlContents = editorPane.getText(); } saveUntagged.setEnabled(false); saveTaggedAs.setEnabled(false); }
private void removeTags() { if (editorPane.getContentType().equals("text/html")) { editorPane.setText(htmlContents); editorPane.revalidate(); editorPane.repaint(); } else { DefaultStyledDocument doc = (DefaultStyledDocument)editorPane.getDocument(); SimpleAttributeSet attr = new SimpleAttributeSet(); StyleConstants.setForeground(attr, Color.BLACK); StyleConstants.setBackground(attr, Color.WHITE); doc.setCharacterAttributes(0, doc.getLength(), attr, false); } saveTaggedAs.setEnabled(false); }
editorPane.revalidate(); editorPane.repaint(); } else { editorPane.revalidate(); editorPane.repaint();
private void removeTags() { if (editorPane.getContentType().equals("text/html")) { if (htmlContents != null) { editorPane.setText(htmlContents); } editorPane.revalidate(); editorPane.repaint(); } else { DefaultStyledDocument doc = (DefaultStyledDocument)editorPane.getDocument(); SimpleAttributeSet attr = new SimpleAttributeSet(); StyleConstants.setForeground(attr, Color.BLACK); StyleConstants.setBackground(attr, Color.WHITE); doc.setCharacterAttributes(0, doc.getLength(), attr, false); } saveTaggedAs.setEnabled(false); }
editorPane.revalidate(); editorPane.repaint(); } else { editorPane.revalidate(); editorPane.repaint();
throw new RuntimeException(e); editorPane.revalidate(); editorPane.repaint(); editorPane.setEditable(true);
@Override public void revalidate() { if ((working & PAINT) != 0) { super.revalidate(); } }
public void revalidate() { if ((working & PAINT) != 0) { super.revalidate(); } }
public void revalidate() { if ((working & PAINT) != 0) { super.revalidate(); } }
private void showTextResponse(String response) { results.setContentType("text/plain"); // $NON-NLS-1$ results.setText(response == null ? "" : response); // $NON-NLS-1$ results.setCaretPosition(0); resultsScrollPane.setViewportView(results); // Bug 55111 - Refresh JEditor pane size depending on the presence or absence of scrollbars resultsScrollPane.setPreferredSize(resultsScrollPane.getMinimumSize()); results.revalidate(); }
private void showHTMLFormattedResponse(String response) { results.setContentType("text/plain"); // $NON-NLS-1$ results.setText(response == null ? "" : Jsoup.parse(response).html()); // $NON-NLS-1$ results.setCaretPosition(0); resultsScrollPane.setViewportView(results); // Bug 55111 - Refresh JEditor pane size depending on the presence or absence of scrollbars resultsScrollPane.setPreferredSize(resultsScrollPane.getMinimumSize()); results.revalidate(); }
if(layoutMapOnTextChange) parent.setPreferredSize(new Dimension(preferredSize.width + horizontalSpace , preferredSize.height + verticalSpace)); textfield.revalidate(); final NodeView nodeView = (NodeView) SwingUtilities.getAncestorOfClass(NodeView.class, parent); final MapView mapView = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, nodeView);