diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-12-29 13:39:51 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-12-29 13:39:51 +0200 |
commit | 181b598714e979ad26236a3677f9e825f74ca282 (patch) | |
tree | cc178f0c3e5e971f2d7e071ea46f88d6aea0cdbe /client/src | |
parent | 0d93598759d2a1a95a25cc84e75cfa03f154590e (diff) | |
parent | b89213ee880dd1197bc7696f6f5a1919c0ff02c1 (diff) | |
download | vaadin-framework-181b598714e979ad26236a3677f9e825f74ca282.tar.gz vaadin-framework-181b598714e979ad26236a3677f9e825f74ca282.zip |
Merge remote-tracking branch 'origin/master' into grid
Change-Id: Id00b3893951bc669fcc8e234f09909d480e249ab
Diffstat (limited to 'client/src')
6 files changed, 43 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index bf79009f4c..2f39eaedd4 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -443,7 +443,7 @@ public class LayoutManager { try { String key = null; if (Profiler.isEnabled()) { - key = "layoutHorizontally() for " + key = "layoutVertically() for " + Util.getSimpleName(cl); Profiler.enter(key); } diff --git a/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java b/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java index f4fbe12c0d..5d128cbdcc 100644 --- a/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java +++ b/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java @@ -20,6 +20,7 @@ import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; +import com.google.gwt.dom.client.Style.TextAlign; import com.google.gwt.logging.client.TextLogFormatter; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ApplicationConfiguration; @@ -65,10 +66,12 @@ public class ErrorNotificationHandler extends Handler { .getRunningApplications().get(0); owner = connection.getUIConnector().getWidget(); } - VNotification - .createNotification(VNotification.DELAY_FOREVER, owner) - .show("<h1>Uncaught client side exception</h1><br />" - + exceptionText, VNotification.CENTERED, "error"); + VNotification n = VNotification.createNotification( + VNotification.DELAY_FOREVER, owner); + n.getElement().getStyle().setTextAlign(TextAlign.LEFT); + n.show("<h1>Uncaught client side exception</h1><br />" + + exceptionText.replace("\n", "<br/>\n"), + VNotification.CENTERED, "error"); } catch (Exception e2) { // Just swallow this exception } diff --git a/client/src/com/vaadin/client/ui/ShortcutActionHandler.java b/client/src/com/vaadin/client/ui/ShortcutActionHandler.java index 9e9279267d..a9d5f0731a 100644 --- a/client/src/com/vaadin/client/ui/ShortcutActionHandler.java +++ b/client/src/com/vaadin/client/ui/ShortcutActionHandler.java @@ -123,6 +123,9 @@ public class ShortcutActionHandler { final int modifiers = KeyboardListenerCollection .getKeyboardModifiers(event); final char keyCode = (char) DOM.eventGetKeyCode(event); + if (keyCode == 0) { + return; + } final ShortcutKeyCombination kc = new ShortcutKeyCombination(keyCode, modifiers); final Iterator<ShortcutAction> it = actions.iterator(); diff --git a/client/src/com/vaadin/client/ui/VAccordion.java b/client/src/com/vaadin/client/ui/VAccordion.java index ff77a8cb91..422f195af9 100644 --- a/client/src/com/vaadin/client/ui/VAccordion.java +++ b/client/src/com/vaadin/client/ui/VAccordion.java @@ -344,6 +344,7 @@ public class VAccordion extends VTabsheetBase { public void updateCaption(TabState tabState) { // TODO need to call this because the caption does not have an owner + caption.setCaptionAsHtml(isTabCaptionsAsHtml()); caption.updateCaptionWithoutOwner( tabState.caption, !tabState.enabled, diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index 10c9a332e0..2d34897986 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -235,6 +235,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } private void updateFromState(TabState tabState) { + tabCaption.setCaptionAsHtml(getTabsheet().isTabCaptionsAsHtml()); tabCaption.update(tabState); // Apply the styleName set for the tab String newStyleName = tabState.styleName; diff --git a/client/src/com/vaadin/client/ui/VTabsheetBase.java b/client/src/com/vaadin/client/ui/VTabsheetBase.java index d3c9bf9e10..e96aa035ed 100644 --- a/client/src/com/vaadin/client/ui/VTabsheetBase.java +++ b/client/src/com/vaadin/client/ui/VTabsheetBase.java @@ -49,6 +49,8 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { /** For internal use only. May be removed or replaced in the future. */ protected AbstractComponentConnector connector; + private boolean tabCaptionsAsHtml = false; + public VTabsheetBase(String classname) { setElement(DOM.createDiv()); setStyleName(classname); @@ -168,4 +170,32 @@ public abstract class VTabsheetBase extends ComplexPanel implements HasEnabled { public boolean isEnabled() { return !disabled; } + + /** + * Sets whether the caption is rendered as HTML. + * <p> + * The default is false, i.e. render tab captions as plain text + * + * @since 7.4 + * @param captionAsHtml + * true if the captions are rendered as HTML, false if rendered + * as plain text + */ + public void setTabCaptionsAsHtml(boolean tabCaptionsAsHtml) { + this.tabCaptionsAsHtml = tabCaptionsAsHtml; + } + + /** + * Checks whether captions are rendered as HTML + * + * The default is false, i.e. render tab captions as plain text + * + * @since 7.4 + * @return true if the captions are rendered as HTML, false if rendered as + * plain text + */ + public boolean isTabCaptionsAsHtml() { + return tabCaptionsAsHtml; + } + } |