use of com.google.gwt.dom.client.DivElement in project che by eclipse.
the class AbstractPresentationRenderer method getInfoTextContainer.
/** {@inheritDoc} */
@Override
public Element getInfoTextContainer(Element content) {
DivElement divElement = Document.get().createDivElement();
divElement.setClassName(treeStyles.styles().infoTextContainer());
divElement.appendChild(content);
return divElement;
}
use of com.google.gwt.dom.client.DivElement in project che by eclipse.
the class EmptyEditorsPanel method renderAction.
private Node renderAction(String title, final Action action) {
final Presentation presentation = presentationFactory.getPresentation(action);
Element divElement = Elements.createDivElement(style.listElement());
divElement.addEventListener("click", new EventListener() {
@Override
public void handleEvent(Event evt) {
ActionEvent event = new ActionEvent(presentation, actionManager, perspectiveManagerProvider.get());
action.actionPerformed(event);
}
}, true);
divElement.getStyle().setCursor("pointer");
divElement.getStyle().setColor(Style.getOutputLinkColor());
Element label = Elements.createDivElement(style.actionLabel());
label.setInnerText(title);
divElement.appendChild(label);
String hotKey = KeyMapUtil.getShortcutText(keyBindingAgent.getKeyBinding(actionManager.getId(action)));
if (hotKey == null) {
hotKey = " ";
} else {
hotKey = "<nobr> " + hotKey + " </nobr>";
}
SpanElement hotKeyElement = Elements.createSpanElement(style.hotKey());
hotKeyElement.setInnerHTML(hotKey);
divElement.appendChild(hotKeyElement);
return divElement;
}
use of com.google.gwt.dom.client.DivElement in project che by eclipse.
the class SplitEditorPartViewImpl method tuneHorizontalSplitter.
/**
* Tunes bottom splitter. Makes it tiny but with a transparent area for easy resizing.
*
* @param el
* element to tune
*/
private void tuneHorizontalSplitter(Element el) {
/** Add Z-Index to move the splitter on the top and make content visible */
el.getParentElement().getStyle().setProperty("zIndex", "1000");
el.getParentElement().getStyle().setProperty("overflow", "visible");
el.getStyle().setProperty("height", "3px");
el.getStyle().setProperty("marginTop", "-2px");
el.getStyle().setProperty("backgroundColor", "transparent");
/** Add small border */
DivElement delimiter = Document.get().createDivElement();
delimiter.getStyle().setProperty("position", "absolute");
delimiter.getStyle().setProperty("width", "100%");
delimiter.getStyle().setProperty("height", "1px");
delimiter.getStyle().setProperty("left", "0px");
delimiter.getStyle().setProperty("backgroundColor", Style.getSplitterSmallBorderColor());
delimiter.getStyle().setProperty("top", "2px");
el.appendChild(delimiter);
}
use of com.google.gwt.dom.client.DivElement in project gwt-test-utils by gwt-test-utils.
the class HTMLPanelTest method getElementById.
@Test
public void getElementById() {
// Given
HTMLPanel panel = new HTMLPanel("<div id=\"childDiv\" class=\"myClass\">some text</div>");
// When
DivElement childDiv = panel.getElementById("childDiv").cast();
// Then
assertThat(childDiv.getClassName()).isEqualTo("myClass");
assertThat(childDiv.getInnerText()).isEqualTo("some text");
}
use of com.google.gwt.dom.client.DivElement in project rstudio by rstudio.
the class ShadowBorder method addPanel.
private DivElement addPanel(String styleName, int halign, int valign) {
DivElement div = Document.get().createDivElement();
div.setClassName(styleName);
Style style = div.getStyle();
style.setPosition(Style.Position.ABSOLUTE);
switch(halign) {
case LEFT:
style.setPropertyPx("left", 0);
style.setPropertyPx("width", 10);
break;
case CENTER:
style.setPropertyPx("left", 10);
style.setPropertyPx("right", 10);
break;
case RIGHT:
style.setPropertyPx("right", 0);
style.setPropertyPx("width", 10);
break;
}
switch(valign) {
case TOP:
style.setPropertyPx("top", 0);
style.setPropertyPx("height", 26);
break;
case MIDDLE:
style.setPropertyPx("top", 26);
style.setPropertyPx("bottom", 26);
break;
case BOTTOM:
style.setPropertyPx("bottom", 0);
style.setPropertyPx("height", 26);
}
layout_.getElement().appendChild(div);
return div;
}
Aggregations