use of org.rstudio.core.client.VirtualConsole in project rstudio by rstudio.
the class ChunkOutputStream method initConsole.
private void initConsole() {
if (console_ == null) {
console_ = new PreWidget();
console_.getElement().removeAttribute("tabIndex");
console_.getElement().getStyle().setMarginTop(0, Unit.PX);
console_.getElement().getStyle().setProperty("whiteSpace", "pre-wrap");
} else {
console_.getElement().setInnerHTML("");
}
if (vconsole_ == null)
vconsole_ = new VirtualConsole(console_.getElement());
else
vconsole_.clear();
// attach the console
addWithOrdinal(console_, maxOrdinal_ + 1);
}
use of org.rstudio.core.client.VirtualConsole in project rstudio by rstudio.
the class VirtualConsoleTests method testColorSplit.
public void testColorSplit() {
PreElement ele = Document.get().createPreElement();
VirtualConsole vc = new VirtualConsole(ele);
vc.submit("123456");
vc.submit("\b\b\b\bXX", "X");
Assert.assertEquals("<span>12</span>" + "<span class=\"X\">XX</span>" + "<span>56</span>", ele.getInnerHTML());
}
use of org.rstudio.core.client.VirtualConsole in project rstudio by rstudio.
the class VirtualConsoleTests method testTwoColors.
public void testTwoColors() {
PreElement ele = Document.get().createPreElement();
VirtualConsole vc = new VirtualConsole(ele);
vc.submit("Output 1", "one");
vc.submit("Output 2", "two");
Assert.assertEquals("<span class=\"one\">Output 1</span>" + "<span class=\"two\">Output 2</span>", ele.getInnerHTML());
}
use of org.rstudio.core.client.VirtualConsole in project rstudio by rstudio.
the class VirtualConsoleTests method testColorOverlap.
public void testColorOverlap() {
PreElement ele = Document.get().createPreElement();
VirtualConsole vc = new VirtualConsole(ele);
vc.submit("123", "A");
vc.submit("456", "B");
vc.submit("\b\b\b\bXX", "X");
Assert.assertEquals("<span class=\"A\">12</span>" + "<span class=\"X\">XX</span>" + "<span class=\"B\">56</span>", ele.getInnerHTML());
}
Aggregations