public void setPreview(boolean isPreview) {
    if (!isPreview) {
      final String text = getReplaceText();
      if (text == null) return;
      setText(text, true);
      setReplaceText(null);
    } else {
      EclipseUtils.getActivePage().saveEditor(this, false);
      final Map<String, String> vars = actor.getExampleValues();

      final String text = getText();
      setReplaceText(text);
      final String rep = SubstituteUtils.substitute(text, vars);

      setText(rep, false);
    }
  }
 public void revert() {
   if (actor != null) {
     setWritable(true);
     getTextViewer().getDocument().set(actor.getDefaultSubstitution());
   }
 }