Home

# Class goog.ui.CharPicker

Character Picker Class. This widget can be used to pick any Unicode character by traversing a category-subcategory structure or by inputing its hex value. See charpicker.html demo for example usage.

extends goog.ui.Component

Instance Method Summary
| `createDom()` Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
| `createMenuItem_(number id, string caption) ⇒ ?goog.ui.MenuItem` Creates a menu entry for either the category listing or subcategory listing.
| `decorateInternal(?Element element)` Actually decorates the element. Should be overridden by inheriting objects. This method can assume there are checks to ensure the component has not already been rendered have occurred and that enter document will be called afterwards. This method is considered protected.
| `displayChar_(string ch) ⇒ string` Gets the display character for the given character.
| `disposeInternal()` Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
| `enterDocument()` Called when the component's element is known to be in the document. Anything using document.getElementById etc. should be done at this stage. If the component contains child components, this call is propagated to its children.
| `getChar_(?Element e) ⇒ string` Gets the character from the event target.
| `getInputChar_() ⇒ string` Gets the user inputed unicode character.
| `getRecentChars() ⇒ ?Array.<string>` Gets the list of characters user selected recently.
| `getSelectedChar() ⇒ ?string` Gets the last selected character.
| `getTagFromChar_(string ch) ⇒ string` Gets the description text for the given character.
| `handleEnter_(?goog.events.KeyEvent e) ⇒ boolean` Behaves exactly like the OK button on Enter key.
| `handleInput_(?goog.events.Event e)` When user types the characters displays the preview. Enables the OK button, if the character is valid.
| `handleOkClick_(?goog.events.Event= opt_event) ⇒ boolean` On OK click accepts the character and updates the recent char list.
| `handleScroll_(?goog.events.Event e)` On scroll, updates the grid with characters correct to the scroll position.
| `handleSelectedItem_(?goog.events.Event e)` On a menu click, sets correct character set in the grid; on a grid click accept the character as the selected one and adds to recent selection, if not already present.
| `modifyCharNode_(?goog.ui.Component button, string ch)` Updates the grid cell with new character.
| `modifyGridWithItems_(?goog.ui.Component grid, ?Array.<string> items, number start)` Updates the grid with new character list for a given starting point.
| `populateGridWithButtons_(?goog.ui.Component grid)` Creates the grid for characters to displayed for selection.
| `setSelectedCategory_(number category, number= opt_subcategory)` Sets the category and updates the submenu items and grid accordingly.
| `setSelectedGrid_(number category, number subcategory)` Updates the grid according to a given category and subcategory.
| `setSelectedSubcategory_(number subcategory)` Sets the subcategory and updates the grid accordingly.
| `updateGrid_(?goog.ui.Component grid, ?Array.<string> items)` Updates the grid with new character list.
| `updateRecents_(string character)` Adds a given character to the recent character list.