return getDocument().getLength() > 0;
return getDocument().getLength() > 0;
return getDocument().getLength() > 0;
public void visit(LinkModel link) { try { // make sure to reload editorPane.getDocument().putProperty(Document.StreamDescriptionProperty, null); // JW: editorPane defaults to asynchronous loading // no need to explicitly start a thread - really? editorPane.setPage(link.getURL()); link.setVisited(true); } catch (IOException e1) { editorPane.setText("<html>Error 404: couldn't show " + link.getURL() + " </html>"); } }
public void visit(LinkModel link) { try { // make sure to reload editorPane.getDocument().putProperty(Document.StreamDescriptionProperty, null); // JW: editorPane defaults to asynchronous loading // no need to explicitly start a thread - really? editorPane.setPage(link.getURL()); link.setVisited(true); } catch (IOException e1) { editorPane.setText("<html>Error 404: couldn't show " + link.getURL() + " </html>"); } }
public void visit(LinkModel link) { try { // make sure to reload editorPane.getDocument().putProperty(Document.StreamDescriptionProperty, null); // JW: editorPane defaults to asynchronous loading // no need to explicitly start a thread - really? editorPane.setPage(link.getURL()); link.setVisited(true); } catch (IOException e1) { editorPane.setText("<html>Error 404: couldn't show " + link.getURL() + " </html>"); } }
public void visit(LinkModel link) { try { // make sure to reload editorPane.getDocument().putProperty(Document.StreamDescriptionProperty, null); // JW: editorPane defaults to asynchronous loading // no need to explicitly start a thread - really? editorPane.setPage(link.getURL()); link.setVisited(true); } catch (IOException e1) { editorPane.setText("<html>Error 404: couldn't show " + link.getURL() + " </html>"); } }
public void visit(LinkModel link) { try { // make sure to reload editorPane.getDocument().putProperty(Document.StreamDescriptionProperty, null); // JW: editorPane defaults to asynchronous loading // no need to explicitly start a thread - really? editorPane.setPage(link.getURL()); link.setVisited(true); } catch (IOException e1) { editorPane.setText("<html>Error 404: couldn't show " + link.getURL() + " </html>"); } }
private void init() { setEditorKitForContentType("text/html", new SloppyHTMLEditorKit()); addPropertyChangeListener(new PropertyHandler()); getDocument().addUndoableEditListener(getUndoableEditListener()); initActions(); }
private void init() { putClientProperty(HONOR_DISPLAY_PROPERTIES, true); setEditorKitForContentType("text/html", new SloppyHTMLEditorKit()); addPropertyChangeListener(new PropertyHandler()); getDocument().addUndoableEditListener(getUndoableEditListener()); initActions(); }
private void init() { putClientProperty(HONOR_DISPLAY_PROPERTIES, true); setEditorKitForContentType("text/html", new SloppyHTMLEditorKit()); addPropertyChangeListener(new PropertyHandler()); getDocument().addUndoableEditListener(getUndoableEditListener()); initActions(); }
private void init() { putClientProperty(HONOR_DISPLAY_PROPERTIES, true); setEditorKitForContentType("text/html", new SloppyHTMLEditorKit()); addPropertyChangeListener(new PropertyHandler()); getDocument().addUndoableEditListener(getUndoableEditListener()); initActions(); }
/** * Applys the tag to the current selection */ protected void applyTag(HTML.Tag tag) { Document doc = getDocument(); if (!(doc instanceof HTMLDocument)) { return; } HTMLDocument hdoc = (HTMLDocument)doc; int start = getSelectionStart(); int end = getSelectionEnd(); Element element = hdoc.getParagraphElement(start); MutableAttributeSet newAttrs = new SimpleAttributeSet(element.getAttributes()); newAttrs.addAttribute(StyleConstants.NameAttribute, tag); hdoc.setParagraphAttributes(start, end - start, newAttrs, true); }
/** * Applys the tag to the current selection */ protected void applyTag(HTML.Tag tag) { Document doc = getDocument(); if (!(doc instanceof HTMLDocument)) { return; } HTMLDocument hdoc = (HTMLDocument)doc; int start = getSelectionStart(); int end = getSelectionEnd(); Element element = hdoc.getParagraphElement(start); MutableAttributeSet newAttrs = new SimpleAttributeSet(element.getAttributes()); newAttrs.addAttribute(StyleConstants.NameAttribute, tag); hdoc.setParagraphAttributes(start, end - start, newAttrs, true); }
/** * Applys the tag to the current selection */ protected void applyTag(HTML.Tag tag) { Document doc = getDocument(); if (!(doc instanceof HTMLDocument)) { return; } HTMLDocument hdoc = (HTMLDocument)doc; int start = getSelectionStart(); int end = getSelectionEnd(); Element element = hdoc.getParagraphElement(start); MutableAttributeSet newAttrs = new SimpleAttributeSet(element.getAttributes()); newAttrs.addAttribute(StyleConstants.NameAttribute, tag); hdoc.setParagraphAttributes(start, end - start, newAttrs, true); }
/** * Applys the tag to the current selection */ protected void applyTag(HTML.Tag tag) { Document doc = getDocument(); if (!(doc instanceof HTMLDocument)) { return; } HTMLDocument hdoc = (HTMLDocument)doc; int start = getSelectionStart(); int end = getSelectionEnd(); Element element = hdoc.getParagraphElement(start); MutableAttributeSet newAttrs = new SimpleAttributeSet(element.getAttributes()); newAttrs.addAttribute(StyleConstants.NameAttribute, tag); hdoc.setParagraphAttributes(start, end - start, newAttrs, true); }
/** * Applys the tag to the current selection */ protected void applyTag(HTML.Tag tag) { Document doc = getDocument(); if (!(doc instanceof HTMLDocument)) { return; } HTMLDocument hdoc = (HTMLDocument)doc; int start = getSelectionStart(); int end = getSelectionEnd(); Element element = hdoc.getParagraphElement(start); MutableAttributeSet newAttrs = new SimpleAttributeSet(element.getAttributes()); newAttrs.addAttribute(StyleConstants.NameAttribute, tag); hdoc.setParagraphAttributes(start, end - start, newAttrs, true); }
private void init() { putClientProperty(HONOR_DISPLAY_PROPERTIES, true); setEditorKitForContentType("text/html", new SloppyHTMLEditorKit()); addPropertyChangeListener(new PropertyHandler()); getDocument().addUndoableEditListener(getUndoableEditListener()); initActions(); }
public void caretUpdate(CaretEvent evt) { StyledDocument document = (StyledDocument)getDocument(); int dot = evt.getDot();
@Override public void caretUpdate(CaretEvent evt) { StyledDocument document = (StyledDocument)getDocument(); int dot = evt.getDot();