use of com.google.gwt.dom.client.Node in project che by eclipse.
the class PerspectiveViewImpl method tuneSplitters.
/**
* Makes splitter better.
*/
public void tuneSplitters() {
NodeList<Node> nodes = splitPanel.getElement().getChildNodes();
boolean firstFound = false;
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.getItem(i);
if (node.hasChildNodes()) {
com.google.gwt.dom.client.Element el = node.getFirstChild().cast();
if ("gwt-SplitLayoutPanel-HDragger".equals(el.getClassName())) {
if (!firstFound) {
firstFound = true;
tuneLeftSplitter(el);
} else {
tuneRightSplitter(el);
}
} else if ("gwt-SplitLayoutPanel-VDragger".equals(el.getClassName())) {
tuneBottomSplitter(el);
}
}
}
}
use of com.google.gwt.dom.client.Node in project che by eclipse.
the class HotKeysDialogPresenter method onPrintClicked.
@Override
public void onPrintClicked() {
final JsoArray<Node> nodesArray = JsoArray.create();
for (Map.Entry<String, List<HotKeyItem>> entry : categories.entrySet()) {
nodesArray.add(wrapCategory(entry.getKey()));
for (HotKeyItem hotKeyItem : entry.getValue()) {
if (hotKeyItem.getActionDescription() != null) {
nodesArray.add(wrapHotKey(hotKeyItem.getHotKey(), hotKeyItem.getActionDescription(), hotKeyItem.isGlobal()));
}
}
}
openWindowForPrinting(resources.printTemplate().getText(), nodesArray);
}
use of com.google.gwt.dom.client.Node in project che by eclipse.
the class OutputConsoleViewImpl method getText.
@Override
public String getText() {
String text = "";
NodeList<Node> nodes = consoleLines.getElement().getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.getItem(i);
Element element = node.cast();
text += element.getInnerText() + "\r\n";
}
return text;
}
use of com.google.gwt.dom.client.Node in project rstudio by rstudio.
the class ShellWidget method consoleWriteExtendedError.
public void consoleWriteExtendedError(final String error, UnhandledError traceInfo, boolean expand, String command) {
if (errorNodes_.containsKey(error)) {
Node errorNode = errorNodes_.get(error);
clearPendingInput();
ConsoleError errorWidget = new ConsoleError(traceInfo, getErrorClass(), this, command);
if (expand)
errorWidget.setTracebackVisible(true);
errorNode.getParentNode().replaceChild(errorWidget.getElement(), errorNode);
scrollPanel_.onContentSizeChanged();
errorNodes_.remove(error);
}
}
use of com.google.gwt.dom.client.Node in project rstudio by rstudio.
the class NodeRelativePosition method toPositionHelper.
private static NodeRelativePosition toPositionHelper(Node here, int[] counter) {
switch(here.getNodeType()) {
case Node.TEXT_NODE:
Text text = (Text) here;
if (counter[0] <= text.getLength())
return new NodeRelativePosition(here, counter[0]);
counter[0] -= text.getLength();
return null;
case Node.ELEMENT_NODE:
Element el = (Element) here;
String tagName = el.getTagName().toLowerCase();
if (tagName.equals("br")) {
if (counter[0] <= 0)
return new NodeRelativePosition(here, 0);
counter[0] -= 1;
return null;
} else if (tagName.equals("script") || tagName.equals("style"))
return null;
break;
}
NodeList<Node> children = here.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
NodeRelativePosition result = toPositionHelper(children.getItem(i), counter);
if (result != null)
return result;
}
return null;
}
Aggregations