List of usage examples for com.google.gwt.text.shared SimpleSafeHtmlRenderer getInstance
public static SimpleSafeHtmlRenderer getInstance()
From source file:cc.alcina.framework.gwt.client.cell.EditTextCell.java
License:Apache License
/** * Construct a new EditTextCell that will use a * {@link SimpleSafeHtmlRenderer}. */ public EditTextCell() { this(SimpleSafeHtmlRenderer.getInstance()); }
From source file:cc.alcina.framework.gwt.client.cell.PropertyDateCell.java
License:Apache License
/** * Constructs a new DatePickerCell that uses the date/time format given by * {@link DateTimeFormat#getFullDateFormat}. *//*from ww w . j a v a 2 s . c o m*/ @SuppressWarnings("deprecation") public PropertyDateCell() { this(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT), SimpleSafeHtmlRenderer.getInstance()); }
From source file:cc.alcina.framework.gwt.client.cell.PropertyDateCell.java
License:Apache License
/** * Constructs a new DatePickerCell that uses the given date/time format and * a {@link SimpleSafeHtmlRenderer}.//ww w . j ava 2 s.com * * @param format * a {@link DateTimeFormat} instance */ public PropertyDateCell(DateTimeFormat format) { this(format, SimpleSafeHtmlRenderer.getInstance()); }
From source file:cc.alcina.framework.gwt.client.cell.PropertyDomainSuggestCell.java
License:Apache License
public PropertyDomainSuggestCell(Function<T, String> toStringMapper, BoundSuggestBox suggestor) { super(CLICK, KEYDOWN); this.toStringMapper = toStringMapper; this.suggestor = suggestor; this.renderer = SimpleSafeHtmlRenderer.getInstance(); this.panel = new PopupPanel(true, true) { @Override/*from w ww .j a va 2 s . com*/ protected void onPreviewNativeEvent(NativePreviewEvent event) { if (Event.ONKEYUP == event.getTypeInt()) { if (event.getNativeEvent().getKeyCode() == ESCAPE) { // Dismiss when escape is pressed panel.hide(); } } } }; panel.addStyleName("property-selector"); panel.addCloseHandler(new CloseHandler<PopupPanel>() { public void onClose(CloseEvent<PopupPanel> event) { lastKey = null; lastValue = null; lastIndex = -1; lastColumn = -1; if (lastParent != null && !event.isAutoClosed()) { // Refocus on the containing cell after the user selects a // value, but // not if the popup is auto closed. lastParent.focus(); } lastParent = null; } }); panel.add(suggestor); // Hide the panel and call valueUpdater.update when a value is selected suggestor.addPropertyChangeListener("value", event -> { // Remember the values before hiding the popup. Element cellParent = lastParent; T oldValue = lastValue; Object key = lastKey; int index = lastIndex; int column = lastColumn; panel.hide(); // Update the cell and value updater. T value = (T) event.getNewValue(); setViewData(key, value); setValue(new Context(index, column, key), cellParent, oldValue); if (valueUpdater != null) { valueUpdater.update(value); } lastFilterText = suggestor.getLastFilterText(); }); }
From source file:cc.alcina.framework.gwt.client.cell.PropertySelectorCell.java
License:Apache License
public PropertySelectorCell(Class<T> selectionObjectClass, Function<Set<T>, String> toStringMapper, FlatSearchSelector selector) {//from w w w . j a v a 2s . co m super(CLICK, KEYDOWN); this.toStringMapper = toStringMapper; this.selector = selector; this.renderer = SimpleSafeHtmlRenderer.getInstance(); // Hide the panel and call valueUpdater.update when a value is selected selector.addPropertyChangeListener("value", event -> { // Remember the values before hiding the popup. Element cellParent = lastParent; Set<T> oldValue = lastValue; Object key = lastKey; int index = lastIndex; int column = lastColumn; ensurePopup().hide(); // Update the cell and value updater. Set<T> value = (Set<T>) event.getNewValue(); setViewData(key, value); setValue(new Context(index, column, key), cellParent, oldValue); if (valueUpdater != null) { valueUpdater.update(value); } lastFilterText = selector.getLastFilterText(); }); }
From source file:cc.alcina.framework.gwt.client.cell.PropertySingleSelectorCell.java
License:Apache License
public PropertySingleSelectorCell(Class<T> selectionObjectClass, Function<T, String> toStringMapper, FlatSearchSelector selector) {/* w w w . j a v a 2 s .co m*/ super(CLICK, KEYDOWN); this.toStringMapper = toStringMapper; this.selector = selector; this.renderer = SimpleSafeHtmlRenderer.getInstance(); this.panel = new PopupPanel(true, true) { @Override protected void onPreviewNativeEvent(NativePreviewEvent event) { if (Event.ONKEYUP == event.getTypeInt()) { if (event.getNativeEvent().getKeyCode() == ESCAPE) { // Dismiss when escape is pressed panel.hide(); } } } }; panel.addStyleName("property-selector"); panel.addCloseHandler(new CloseHandler<PopupPanel>() { public void onClose(CloseEvent<PopupPanel> event) { lastKey = null; lastValue = null; lastIndex = -1; lastColumn = -1; if (lastParent != null && !event.isAutoClosed()) { // Refocus on the containing cell after the user selects a // value, but // not if the popup is auto closed. lastParent.focus(); } lastParent = null; } }); panel.add(selector); // Hide the panel and call valueUpdater.update when a value is selected selector.addPropertyChangeListener("value", event -> { // Remember the values before hiding the popup. Element cellParent = lastParent; T oldValue = lastValue; Object key = lastKey; int index = lastIndex; int column = lastColumn; panel.hide(); // Update the cell and value updater. T value = (T) event.getNewValue(); setViewData(key, value); setValue(new Context(index, column, key), cellParent, oldValue); if (valueUpdater != null) { valueUpdater.update(value); } lastFilterText = selector.getLastFilterText(); }); }
From source file:cc.alcina.framework.gwt.client.cell.PropertyTextCell.java
License:Apache License
/** * Construct a new EditTextCell that will use a * {@link SimpleSafeHtmlRenderer}. */ public PropertyTextCell() { this(SimpleSafeHtmlRenderer.getInstance()); }
From source file:com.chinarewards.gwt.license.client.ui.HyperLinkCell.java
/** * Construct a new ButtonCell that will use a {@link SimpleSafeHtmlRenderer} * . */ public HyperLinkCell() { this(SimpleSafeHtmlRenderer.getInstance()); }
From source file:com.google.code.tree.client.CustomEditTextCell.java
License:Apache License
/** * Construct a new CustomEditTextCell that will use a * {@link SimpleSafeHtmlRenderer}. */ public CustomEditTextCell() { this(SimpleSafeHtmlRenderer.getInstance()); }
From source file:com.google.code.tree.client.CustomEditTextCell.java
License:Apache License
/** * Construct a new CustomEditTextCell that will use a * {@link SimpleSafeHtmlRenderer}.// w w w .java 2 s . c o m * * @param charSize * size of characters the input element will use (default 20) */ public CustomEditTextCell(int charSize) { this(SimpleSafeHtmlRenderer.getInstance()); this.charSize = charSize; }