automaticTextAddition(widget);
};
private void automaticTextAddition(final Widget widget) {
if(widget instanceof HasVkText) {
if(widget instanceof HasDoubleClickHandlers) {
((HasDoubleClickHandlers)widget).addDoubleClickHandler(new DoubleClickHandler() {
@Override
public void onDoubleClick(DoubleClickEvent event) {
addTextBox(widget);
event.stopPropagation();
}
});
} else {
widget.addDomHandler(new DoubleClickHandler() {
@Override
public void onDoubleClick(DoubleClickEvent event) {
addTextBox(widget);
event.stopPropagation();
}
}, DoubleClickEvent.getType());
}
} else {
if(widget instanceof HasDoubleClickHandlers) {
((HasDoubleClickHandlers)widget).addDoubleClickHandler(new DoubleClickHandler() {
@Override
public void onDoubleClick(DoubleClickEvent event) {
event.stopPropagation();
}
});
} else {
widget.addDomHandler(new DoubleClickHandler() {
@Override
public void onDoubleClick(DoubleClickEvent event) {
IWidgetEngine<? extends IVkWidget> iWidgetEngine = VkStateHelper.getInstance().getWidgetEngineMapping().getEngineMap().get(((IVkWidget)widget).getWidgetName());
iWidgetEngine.applyAttribute(iWidgetEngine.getAttributesList(widget).get(0), widget);
event.stopPropagation();