/** * Removes a style. * * @param name The style name (e.g., "color"). * @return The value of the removed style, or null if none. */ public String removeStyle(String name) { return addStyle(name, null); }
/** * Sets the container as the wrapped component and registers itself to receive action * notifications from the container. */ public SmartPlugin() { super(); getOuterComponent().addStyle("overflow", "hidden"); }
/** * Sets the disabled state of the specified component. * * @param comp The component. * @param disabled The disabled state. */ private void disable(IDisable comp, boolean disabled) { if (comp != null) { comp.setDisabled(disabled); if (comp instanceof BaseUIComponent) { ((BaseUIComponent) comp).addStyle("opacity", disabled ? ".2" : "1"); } } }
/** * Create a drilldown event listener for the specified component. * * @param component The component to which the event listener will be attached. * @param dataObject Data object for the drilldown. * @param drillDownDisplayClass Dialog class for the drilldown display. */ public DrillDownListener(BaseUIComponent component, T dataObject, Class<?> drillDownDisplayClass) { super(); this.component = component; this.dataObject = dataObject; this.drillDownDisplayClass = drillDownDisplayClass; component.addEventListener(ClickEvent.class, this); component.addStyle("cursor", "pointer"); }
/** * Sets the width. This is synchronized with the width style setting. * * @param width The width. */ @PropertySetter(value = "width", description = "The component's width.") public void setWidth(String width) { width = trimify(width); if (!areEqual(width, this.width)) { this.width = width; addStyle("width", width); } }
/** * Sets the height. This is synchronized with the height style setting. * * @param height The height. */ @PropertySetter(value = "height", description = "The component's height.") public void setHeight(String height) { height = trimify(height); if (!areEqual(height, this.height)) { this.height = height; addStyle("height", height); } }
/** * Sets the flex setting. This is synchronized with the flex style setting. * * @param flex The flex setting. */ @PropertySetter(value = "flex", description = "The component's flex style setting.") public void setFlex(String flex) { flex = trimify(flex); if (!areEqual(flex, this.flex)) { this.flex = flex; addStyle("flex", flex); } }
/** * Applies the current color setting to the target component. If the target implements a custom * method for performing this operation, that method will be invoked. Otherwise, the background * color of the target is set. Override this method to provide alternate implementations. * * @param comp Component to receive the color setting. */ protected void applyColor(BaseUIComponent comp) { if (comp instanceof BaseLabeledComponent) { comp.invoke(comp.sub("lbl"), "css", "color", getColor()); } else if (comp != null) { comp.addStyle("background-color", getColor()); } }
/** * Render detail view for the specified patient. * * @param patient Patient whose detail view is to be rendered. */ @Override public BaseUIComponent render(Patient patient) { BaseUIComponent root = new Div(); root.addClass("fujion-layout-vertical text-center"); root.addStyle("align-items", "center"); if (confirmAccess(patient, root)) { renderDemographics(patient, root); } return root; }