org.openqa.selenium.devtools.overlay.model.HighlightConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenium-devtools Show documentation
Show all versions of selenium-devtools Show documentation
Selenium automates browsers. That's it! What you do with that power is entirely up to you.
package org.openqa.selenium.devtools.overlay.model;
import org.openqa.selenium.Beta;
import org.openqa.selenium.json.JsonInput;
/**
* Configuration data for the highlighting of page elements.
*/
public class HighlightConfig {
private final java.util.Optional showInfo;
private final java.util.Optional showStyles;
private final java.util.Optional showRulers;
private final java.util.Optional showExtensionLines;
private final java.util.Optional contentColor;
private final java.util.Optional paddingColor;
private final java.util.Optional borderColor;
private final java.util.Optional marginColor;
private final java.util.Optional eventTargetColor;
private final java.util.Optional shapeColor;
private final java.util.Optional shapeMarginColor;
private final java.util.Optional cssGridColor;
private final java.util.Optional colorFormat;
private final java.util.Optional gridHighlightConfig;
public HighlightConfig(java.util.Optional showInfo, java.util.Optional showStyles, java.util.Optional showRulers, java.util.Optional showExtensionLines, java.util.Optional contentColor, java.util.Optional paddingColor, java.util.Optional borderColor, java.util.Optional marginColor, java.util.Optional eventTargetColor, java.util.Optional shapeColor, java.util.Optional shapeMarginColor, java.util.Optional cssGridColor, java.util.Optional colorFormat, java.util.Optional gridHighlightConfig) {
this.showInfo = showInfo;
this.showStyles = showStyles;
this.showRulers = showRulers;
this.showExtensionLines = showExtensionLines;
this.contentColor = contentColor;
this.paddingColor = paddingColor;
this.borderColor = borderColor;
this.marginColor = marginColor;
this.eventTargetColor = eventTargetColor;
this.shapeColor = shapeColor;
this.shapeMarginColor = shapeMarginColor;
this.cssGridColor = cssGridColor;
this.colorFormat = colorFormat;
this.gridHighlightConfig = gridHighlightConfig;
}
/**
* Whether the node info tooltip should be shown (default: false).
*/
public java.util.Optional getShowInfo() {
return showInfo;
}
/**
* Whether the node styles in the tooltip (default: false).
*/
public java.util.Optional getShowStyles() {
return showStyles;
}
/**
* Whether the rulers should be shown (default: false).
*/
public java.util.Optional getShowRulers() {
return showRulers;
}
/**
* Whether the extension lines from node to the rulers should be shown (default: false).
*/
public java.util.Optional getShowExtensionLines() {
return showExtensionLines;
}
/**
* The content box highlight fill color (default: transparent).
*/
public java.util.Optional getContentColor() {
return contentColor;
}
/**
* The padding highlight fill color (default: transparent).
*/
public java.util.Optional getPaddingColor() {
return paddingColor;
}
/**
* The border highlight fill color (default: transparent).
*/
public java.util.Optional getBorderColor() {
return borderColor;
}
/**
* The margin highlight fill color (default: transparent).
*/
public java.util.Optional getMarginColor() {
return marginColor;
}
/**
* The event target element highlight fill color (default: transparent).
*/
public java.util.Optional getEventTargetColor() {
return eventTargetColor;
}
/**
* The shape outside fill color (default: transparent).
*/
public java.util.Optional getShapeColor() {
return shapeColor;
}
/**
* The shape margin fill color (default: transparent).
*/
public java.util.Optional getShapeMarginColor() {
return shapeMarginColor;
}
/**
* The grid layout color (default: transparent).
*/
public java.util.Optional getCssGridColor() {
return cssGridColor;
}
/**
* The color format used to format color styles (default: hex).
*/
public java.util.Optional getColorFormat() {
return colorFormat;
}
/**
* The grid layout highlight configuration (default: all transparent).
*/
public java.util.Optional getGridHighlightConfig() {
return gridHighlightConfig;
}
private static HighlightConfig fromJson(JsonInput input) {
java.util.Optional showInfo = java.util.Optional.empty();
java.util.Optional showStyles = java.util.Optional.empty();
java.util.Optional showRulers = java.util.Optional.empty();
java.util.Optional showExtensionLines = java.util.Optional.empty();
java.util.Optional contentColor = java.util.Optional.empty();
java.util.Optional paddingColor = java.util.Optional.empty();
java.util.Optional borderColor = java.util.Optional.empty();
java.util.Optional marginColor = java.util.Optional.empty();
java.util.Optional eventTargetColor = java.util.Optional.empty();
java.util.Optional shapeColor = java.util.Optional.empty();
java.util.Optional shapeMarginColor = java.util.Optional.empty();
java.util.Optional cssGridColor = java.util.Optional.empty();
java.util.Optional colorFormat = java.util.Optional.empty();
java.util.Optional gridHighlightConfig = java.util.Optional.empty();
input.beginObject();
while (input.hasNext()) {
switch(input.nextName()) {
case "showInfo":
showInfo = java.util.Optional.ofNullable(input.nextBoolean());
break;
case "showStyles":
showStyles = java.util.Optional.ofNullable(input.nextBoolean());
break;
case "showRulers":
showRulers = java.util.Optional.ofNullable(input.nextBoolean());
break;
case "showExtensionLines":
showExtensionLines = java.util.Optional.ofNullable(input.nextBoolean());
break;
case "contentColor":
contentColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "paddingColor":
paddingColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "borderColor":
borderColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "marginColor":
marginColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "eventTargetColor":
eventTargetColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "shapeColor":
shapeColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "shapeMarginColor":
shapeMarginColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "cssGridColor":
cssGridColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.dom.model.RGBA.class));
break;
case "colorFormat":
colorFormat = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.overlay.model.ColorFormat.class));
break;
case "gridHighlightConfig":
gridHighlightConfig = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.overlay.model.GridHighlightConfig.class));
break;
default:
input.skipValue();
break;
}
}
input.endObject();
return new HighlightConfig(showInfo, showStyles, showRulers, showExtensionLines, contentColor, paddingColor, borderColor, marginColor, eventTargetColor, shapeColor, shapeMarginColor, cssGridColor, colorFormat, gridHighlightConfig);
}
}