elemental2.dom.HTMLElement Java Examples

The following examples show how to use elemental2.dom.HTMLElement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MarkerTest.java    From gwty-leaflet with Apache License 2.0 6 votes vote down vote up
public void testMarkeradd(){
	InjectedLeafletResources.whenReady((e) -> {
			 HTMLElement div = (HTMLElement) DomGlobal.document.createElement("div");
			    div.id = "test6";
			    DomGlobal.document.body.appendChild(div);
			   
				Map map = L.map("test6", null);
				MarkerOptions mkOptions = new MarkerOptions.Builder().build();
                   Marker marker = L.marker(L.latLng(52.51, 13.40), mkOptions);
                   marker.addTo(map);
                   
				assertNotNull(map);
				assertNotNull(marker);
				
				assertEquals(marker.getLatLng().lat, 52.51);
				assertEquals(marker.getLatLng().lng, 13.40);
				
				return null;
	});
}
 
Example #2
Source File: MapTest.java    From gwty-leaflet with Apache License 2.0 6 votes vote down vote up
public void testMapPan(){
	InjectedLeafletResources.whenReady((e) -> {
			 HTMLElement div = (HTMLElement) DomGlobal.document.createElement("div");
			    div.id = "test4";
			    DomGlobal.document.body.appendChild(div);
			      MapOptions options = new MapOptions.Builder(L.latLng(52.51, 13.40), 12.0, 7.0).maxZoom(20.0).build();
				Map map = L.map("test4", options);

				assertNotNull(map);
				map.panTo(L.latLng(51.51, 13.80), null);
				assertEquals(map.getCenter().lat, 51.51);
				assertEquals(map.getCenter().lng, 13.80);
				
				return null;
	});
}
 
Example #3
Source File: MockErrorShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createNorth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "header";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #4
Source File: ShellDoesNotHaveGenericContext.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createNorth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "header";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #5
Source File: ShellDoesNotHaveGenericContext.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createSouth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "footer";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #6
Source File: ShellDoesNotExtendAbstractShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private HTMLElement render() {
  document.body.style.margin = CSSProperties.MarginUnionType.of(0);

  HTMLDivElement shell = (HTMLDivElement) document.createElement("div");
  shell.style.height = CSSProperties.HeightUnionType.of("auto");
  shell.style.width = CSSProperties.WidthUnionType.of("100%");
  shell.style.margin = CSSProperties.MarginUnionType.of(0);

  Element header = createNorth();
  shell.appendChild(header);

  HTMLDivElement navigation = (HTMLDivElement) document.createElement("div");
  navigation.id = "navigation";
  navigation.style.position = "absolute";
  navigation.style.overflow = "hidden";
  navigation.style.top = "128px";
  navigation.style.bottom = "42px";
  navigation.style.left = String.valueOf(0);
  navigation.style.width = CSSProperties.WidthUnionType.of("212px");
  navigation.style.borderRight = "black 1px solid";
  shell.appendChild(navigation);

  HTMLDivElement content = (HTMLDivElement) document.createElement("div");
  content.id = "content";
  content.style.position = "absolute";
  content.style.overflow = "hidden";
  content.style.top = "128px";
  content.style.bottom = "42px";
  content.style.left = "212px";
  content.style.right = String.valueOf(0);

  shell.appendChild(content);

  Element footer = createSouth();
  shell.appendChild(footer);

  return shell;
}
 
Example #7
Source File: MockShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private HTMLElement render() {
  this.shell = div().css("shellCreator")
                    .add(createNorth())
                    .add(createSouth())
                    .add(div().css("shellNavigation")
                              .attr(MockShell.NALU_ID_ATTRIBUTE,
                                    "navigation")
                              .get())
                    .add(div().css("shellContent")
                              .attr(MockShell.NALU_ID_ATTRIBUTE,
                                    "content")
                              .get())
                    .get();
  return this.shell;
}
 
Example #8
Source File: ShellDoesNotExtendAbstractShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createSouth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "footer";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #9
Source File: MockShell02.java    From nalu with Apache License 2.0 5 votes vote down vote up
private HTMLElement render() {
  document.body.style.margin = CSSProperties.MarginUnionType.of(0);

  this.shell = (HTMLDivElement) document.createElement("div");
  this.shell.style.height = CSSProperties.HeightUnionType.of("auto");
  this.shell.style.width = CSSProperties.WidthUnionType.of("100%");
  this.shell.style.margin = CSSProperties.MarginUnionType.of(0);

  Element header = createNorth();
  this.shell.appendChild(header);

  HTMLDivElement navigation = (HTMLDivElement) document.createElement("div");
  navigation.id = "navigation";
  navigation.style.position = "absolute";
  navigation.style.overflow = "hidden";
  navigation.style.top = "128px";
  navigation.style.bottom = "42px";
  navigation.style.left = String.valueOf(0);
  navigation.style.width = CSSProperties.WidthUnionType.of("212px");
  navigation.style.borderRight = "black 1px solid";
  this.shell.appendChild(navigation);

  HTMLDivElement content = (HTMLDivElement) document.createElement("div");
  content.id = "content";
  content.style.position = "absolute";
  content.style.overflow = "hidden";
  content.style.top = "128px";
  content.style.bottom = "42px";
  content.style.left = "212px";
  content.style.right = String.valueOf(0);

  this.shell.appendChild(content);

  Element footer = createSouth();
  this.shell.appendChild(footer);

  return this.shell;
}
 
Example #10
Source File: MapTest.java    From gwty-leaflet with Apache License 2.0 5 votes vote down vote up
public void testMapCreateWithId(){
	
	InjectedLeafletResources.whenReady((e) -> {
		    HTMLElement div = (HTMLElement) DomGlobal.document.createElement("div");
		    div.id = "test";
		    DomGlobal.document.body.appendChild(div);
		    
			Map map = L.map("test", null);
			assertNotNull(map);
			return null;
	});
}
 
Example #11
Source File: MockShell02.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createSouth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "footer";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #12
Source File: NaluPluginElemental2.java    From nalu with Apache License 2.0 5 votes vote down vote up
@Override
public boolean attach(String selector,
                      Object asElement) {
  Element selectorElement = DomGlobal.document.querySelector("#" + selector);
  if (selectorElement == null) {
    return false;
  } else {
    selectorElement.appendChild((HTMLElement) asElement);
    return true;
  }
}
 
Example #13
Source File: MockErrorShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private HTMLElement render() {
  document.body.style.margin = CSSProperties.MarginUnionType.of(0);

  this.shell = (HTMLDivElement) document.createElement("div");
  this.shell.style.height = CSSProperties.HeightUnionType.of("auto");
  this.shell.style.width = CSSProperties.WidthUnionType.of("100%");
  this.shell.style.margin = CSSProperties.MarginUnionType.of(0);

  Element header = createNorth();
  this.shell.appendChild(header);

  HTMLDivElement navigation = (HTMLDivElement) document.createElement("div");
  navigation.id = "navigation";
  navigation.style.position = "absolute";
  navigation.style.overflow = "hidden";
  navigation.style.top = "128px";
  navigation.style.bottom = "42px";
  navigation.style.left = String.valueOf(0);
  navigation.style.width = CSSProperties.WidthUnionType.of("212px");
  navigation.style.borderRight = "black 1px solid";
  this.shell.appendChild(navigation);

  HTMLDivElement content = (HTMLDivElement) document.createElement("div");
  content.id = "content";
  content.style.position = "absolute";
  content.style.overflow = "hidden";
  content.style.top = "128px";
  content.style.bottom = "42px";
  content.style.left = "212px";
  content.style.right = String.valueOf(0);

  this.shell.appendChild(content);

  Element footer = createSouth();
  this.shell.appendChild(footer);

  return this.shell;
}
 
Example #14
Source File: MapTest.java    From gwty-leaflet with Apache License 2.0 5 votes vote down vote up
public void testMapCreateWithHTMLElement(){
	InjectedLeafletResources.whenReady((e) -> {
			HTMLElement mapContainer = (HTMLElement) DomGlobal.document.createElement("div");
            Map map = L.map(mapContainer, null);
			assertNotNull(map);
			return null;
	});
}
 
Example #15
Source File: MockShellLogin.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createSouth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "footer";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #16
Source File: MockShell01.java    From nalu with Apache License 2.0 5 votes vote down vote up
private HTMLElement render() {
  document.body.style.margin = CSSProperties.MarginUnionType.of(0);

  this.shell = (HTMLDivElement) document.createElement("div");
  this.shell.style.height = CSSProperties.HeightUnionType.of("auto");
  this.shell.style.width = CSSProperties.WidthUnionType.of("100%");
  this.shell.style.margin = CSSProperties.MarginUnionType.of(0);

  Element header = createNorth();
  this.shell.appendChild(header);

  HTMLDivElement navigation = (HTMLDivElement) document.createElement("div");
  navigation.id = "navigation";
  navigation.style.position = "absolute";
  navigation.style.overflow = "hidden";
  navigation.style.top = "128px";
  navigation.style.bottom = "42px";
  navigation.style.left = String.valueOf(0);
  navigation.style.width = CSSProperties.WidthUnionType.of("212px");
  navigation.style.borderRight = "black 1px solid";
  this.shell.appendChild(navigation);

  HTMLDivElement content = (HTMLDivElement) document.createElement("div");
  content.id = "content";
  content.style.position = "absolute";
  content.style.overflow = "hidden";
  content.style.top = "128px";
  content.style.bottom = "42px";
  content.style.left = "212px";
  content.style.right = String.valueOf(0);

  this.shell.appendChild(content);

  Element footer = createSouth();
  this.shell.appendChild(footer);

  return this.shell;
}
 
Example #17
Source File: MockShell01.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createNorth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "header";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #18
Source File: MockShellDuplicateName.java    From nalu with Apache License 2.0 5 votes vote down vote up
private HTMLElement render() {
  document.body.style.margin = CSSProperties.MarginUnionType.of(0);

  HTMLDivElement shell = (HTMLDivElement) document.createElement("div");
  shell.style.height = CSSProperties.HeightUnionType.of("auto");
  shell.style.width = CSSProperties.WidthUnionType.of("100%");
  shell.style.margin = CSSProperties.MarginUnionType.of(0);

  Element header = createNorth();
  shell.appendChild(header);

  HTMLDivElement navigation = (HTMLDivElement) document.createElement("div");
  navigation.id = "navigation";
  navigation.style.position = "absolute";
  navigation.style.overflow = "hidden";
  navigation.style.top = "128px";
  navigation.style.bottom = "42px";
  navigation.style.left = String.valueOf(0);
  navigation.style.width = CSSProperties.WidthUnionType.of("212px");
  navigation.style.borderRight = "black 1px solid";
  shell.appendChild(navigation);

  HTMLDivElement content = (HTMLDivElement) document.createElement("div");
  content.id = "content";
  content.style.position = "absolute";
  content.style.overflow = "hidden";
  content.style.top = "128px";
  content.style.bottom = "42px";
  content.style.left = "212px";
  content.style.right = String.valueOf(0);

  shell.appendChild(content);

  Element footer = createSouth();
  shell.appendChild(footer);

  return shell;
}
 
Example #19
Source File: MockShellDuplicateName.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createSouth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "footer";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #20
Source File: MockShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private HTMLElement render() {
  document.body.style.margin = CSSProperties.MarginUnionType.of(0);

  this.shell = (HTMLDivElement) document.createElement("div");
  this.shell.style.height = CSSProperties.HeightUnionType.of("auto");
  this.shell.style.width = CSSProperties.WidthUnionType.of("100%");
  this.shell.style.margin = CSSProperties.MarginUnionType.of(0);

  Element header = createNorth();
  this.shell.appendChild(header);

  HTMLDivElement navigation = (HTMLDivElement) document.createElement("div");
  navigation.id = "navigation";
  navigation.style.position = "absolute";
  navigation.style.overflow = "hidden";
  navigation.style.top = "128px";
  navigation.style.bottom = "42px";
  navigation.style.left = String.valueOf(0);
  navigation.style.width = CSSProperties.WidthUnionType.of("212px");
  navigation.style.borderRight = "black 1px solid";
  this.shell.appendChild(navigation);

  HTMLDivElement content = (HTMLDivElement) document.createElement("div");
  content.id = "content";
  content.style.position = "absolute";
  content.style.overflow = "hidden";
  content.style.top = "128px";
  content.style.bottom = "42px";
  content.style.left = "212px";
  content.style.right = String.valueOf(0);

  this.shell.appendChild(content);

  Element footer = createSouth();
  this.shell.appendChild(footer);

  return this.shell;
}
 
Example #21
Source File: MockShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createNorth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "header";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #22
Source File: MockShell.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createSouth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "footer";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #23
Source File: MockErrorShellIllegal.java    From nalu with Apache License 2.0 5 votes vote down vote up
private Element createSouth() {
  HTMLElement panel = (HTMLElement) document.createElement("header");
  panel.id = "footer";
  panel.style.position = "absolute";
  panel.style.overflow = "hidden";
  panel.style.height = CSSProperties.HeightUnionType.of("128px");
  panel.style.top = String.valueOf(0);
  panel.style.right = String.valueOf(0);
  panel.style.left = String.valueOf(0);
  panel.style.width = CSSProperties.WidthUnionType.of("100%");
  panel.style.borderBottom = "black 1px solid";
  return panel;
}
 
Example #24
Source File: CircleMarker.java    From gwty-leaflet with Apache License 2.0 4 votes vote down vote up
@JsMethod
public native L setPopupContent(HTMLElement content);
 
Example #25
Source File: GridLayer.java    From gwty-leaflet with Apache License 2.0 4 votes vote down vote up
@JsMethod
public native L bindPopup(HTMLElement content, PopupOptions options);
 
Example #26
Source File: Polyline.java    From gwty-leaflet with Apache License 2.0 4 votes vote down vote up
@JsMethod
public native L setPopupContent(HTMLElement content);
 
Example #27
Source File: LayerGroup.java    From gwty-leaflet with Apache License 2.0 4 votes vote down vote up
@JsMethod
public native L bindPopup(HTMLElement content, PopupOptions options);
 
Example #28
Source File: Marker.java    From gwty-leaflet with Apache License 2.0 4 votes vote down vote up
@JsMethod
public native L setPopupContent(HTMLElement content);
 
Example #29
Source File: Tooltip.java    From gwty-leaflet with Apache License 2.0 4 votes vote down vote up
@JsMethod
public native L bindPopup(HTMLElement content, PopupOptions options);
 
Example #30
Source File: Tooltip.java    From gwty-leaflet with Apache License 2.0 4 votes vote down vote up
@JsMethod
public native L setPopupContent(HTMLElement content);