diff options
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/ComponentDetail.java')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ComponentDetail.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ComponentDetail.java b/src/com/vaadin/terminal/gwt/client/ComponentDetail.java index 3254346c76..8e61ec7429 100644 --- a/src/com/vaadin/terminal/gwt/client/ComponentDetail.java +++ b/src/com/vaadin/terminal/gwt/client/ComponentDetail.java @@ -1,5 +1,7 @@ package com.vaadin.terminal.gwt.client; +import java.util.HashMap; + import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize; import com.vaadin.terminal.gwt.client.RenderInformation.Size; @@ -7,8 +9,37 @@ class ComponentDetail { private String pid; private Paintable component; private TooltipInfo tooltipInfo = new TooltipInfo(); + + /** + * Returns a TooltipInfo assosiated with Component. If element is given, + * returns an additional TooltipInfo. + * + * @param key + * @return the tooltipInfo + */ + public TooltipInfo getTooltipInfo(Object key) { + if (key == null) { + return tooltipInfo; + } else { + if (additionalTooltips != null) { + return additionalTooltips.get(key); + } else { + return null; + } + } + } + + /** + * @param tooltipInfo + * the tooltipInfo to set + */ + public void setTooltipInfo(TooltipInfo tooltipInfo) { + this.tooltipInfo = tooltipInfo; + } + private FloatSize relativeSize; private Size offsetSize; + private HashMap<Object, TooltipInfo> additionalTooltips; /** * @return the pid @@ -70,4 +101,15 @@ class ComponentDetail { this.offsetSize = offsetSize; } + public void putAdditionalTooltip(Object key, TooltipInfo tooltip) { + if (tooltip == null && additionalTooltips != null) { + additionalTooltips.remove(key); + } else { + if (additionalTooltips == null) { + additionalTooltips = new HashMap<Object, TooltipInfo>(); + } + additionalTooltips.put(key, tooltip); + } + } + } |