@Override protected void endConstruct() { this.content.add(this.codeOutput); // Hook to replace Input by output on blur this.setTabIndex(0); this.compositeFocus = CompositeFocusHelper.createFocusHelper(this.codeInput, this.codeInput); this.addFocusHandler(this); // in IE, the focus is not set on click on the codeOutput this.codeOutput.asWidget().addDomHandler(this, ClickEvent.getType()); this.compositeFocus.addBlurHandler(this); StyleUtils.removeStyle(this, AbstractInput.STYLE_CONTROL); StyleUtils.addStyle(this.codeInput.asWidget(), AbstractInput.STYLE_CONTROL); super.endConstruct(); }
public CodeOutputImpl() { this.setElement(Document.get().createElement(PreElement.TAG)); StyleUtils.addStyle(this, CodeOutputImpl.STYLE_CODE_EDITOR); StyleUtils.addStyle(this, CodeOutputImpl.STYLE_PRE_SCROLLABLE); }