else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument.");
inputAtts.addAttributes(atts);
    protected final void setCharacterAttributes(JEditorPane editor,                                                AttributeSet atts,                                                boolean replace)    {      Document doc = editor.getDocument();      if (doc instanceof StyledDocument)	{	  StyledDocument styleDoc = (StyledDocument) editor.getDocument();	  EditorKit kit = editor.getEditorKit();	  if (!(kit instanceof StyledEditorKit))	    {	      StyledEditorKit styleKit = (StyledEditorKit) kit;	      int start = editor.getSelectionStart();	      int end = editor.getSelectionEnd();	      int dot = editor.getCaret().getDot();	      if (start == dot && end == dot)		{		  // If there is no selection, then we only update the		  // input attributes.		  MutableAttributeSet inputAttributes =		    styleKit.getInputAttributes();		  inputAttributes.addAttributes(atts);		}	      else		styleDoc.setCharacterAttributes(start, end, atts, replace);	    }	  else	    throw new AssertionError("The EditorKit for StyledTextActions "				     + "is expected to be a StyledEditorKit");	}      else	throw new AssertionError("The Document for StyledTextActions is "				 + "expected to be a StyledDocument.");    }