diff options
8 files changed, 121 insertions, 17 deletions
diff --git a/WebContent/VAADIN/themes/chameleon/components/textfield/textfield.scss b/WebContent/VAADIN/themes/chameleon/components/textfield/textfield.scss index 7c5c72c1df..3962ba9ccd 100644 --- a/WebContent/VAADIN/themes/chameleon/components/textfield/textfield.scss +++ b/WebContent/VAADIN/themes/chameleon/components/textfield/textfield.scss @@ -20,7 +20,7 @@ textarea.v-textarea, input.#{$primaryStyleName}[type="text"], textarea.v-textarea, .v-filterselect { - padding: .2em; + padding: .1em; } input.#{$primaryStyleName}[type="text"] { diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index 8f53f60145..34904405c7 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -947,6 +947,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, if (tab == null) { tab = tb.addTab(); } + if (selected) { + renderContent(tabUidl.getChildUIDL(0)); + tb.selectTab(index); + } tab.updateFromUIDL(tabUidl); tab.setEnabledOnServer((!disabledTabKeys.contains(tabKeys.get(index)))); tab.setHiddenOnServer(hidden); @@ -963,11 +967,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable, * and tabs won't be too narrow in certain browsers */ tab.recalculateCaptionWidth(); - - if (selected) { - renderContent(tabUidl.getChildUIDL(0)); - tb.selectTab(index); - } } /** @@ -1096,11 +1095,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } if (BrowserInfo.get().isSafari()) { - // fix tab height for safari, bugs sometimes if tabs contain icons - String property = tabs.getStyle().getProperty("height"); - if (property == null || property.equals("")) { - tabs.getStyle().setPropertyPx("height", tb.getOffsetHeight()); - } /* * another hack for webkits. tabscroller sometimes drops without * "shaking it" reproducable in diff --git a/client/src/com/vaadin/client/ui/VTreeTable.java b/client/src/com/vaadin/client/ui/VTreeTable.java index 097b9c7ab2..54c9c2d30c 100644 --- a/client/src/com/vaadin/client/ui/VTreeTable.java +++ b/client/src/com/vaadin/client/ui/VTreeTable.java @@ -131,7 +131,7 @@ public class VTreeTable extends VScrollTable { private int indentWidth = -1; private int maxIndent = 0; - VTreeTableScrollBody() { + protected VTreeTableScrollBody() { super(); } diff --git a/theme-compiler/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluator.java b/theme-compiler/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluator.java index 7dbd8ae1a0..552b464941 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluator.java +++ b/theme-compiler/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluator.java @@ -99,7 +99,8 @@ public class ArithmeticExpressionEvaluator { continue inputTermLoop; } } - throw new ArithmeticException(); + throw new ArithmeticException("Illegal arithmetic expression", + term); } if (current.getLexicalUnitType() == SCSSLexicalUnit.SCSS_OPERATOR_LEFT_PAREN) { operators.push(Parentheses.LEFT); @@ -115,7 +116,7 @@ public class ArithmeticExpressionEvaluator { while (!operators.isEmpty()) { Object operator = operators.pop(); if (operator == Parentheses.LEFT) { - throw new ArithmeticException("Unexpected \"(\" found"); + throw new ArithmeticException("Unexpected \"(\" found", term); } createNewOperand((BinaryOperator) operator, operands); } @@ -123,7 +124,7 @@ public class ArithmeticExpressionEvaluator { if (!operands.isEmpty()) { LexicalUnitImpl operand = (LexicalUnitImpl) operands.peek(); throw new ArithmeticException("Unexpected operand " - + operand.toString() + " found"); + + operand.toString() + " found", term); } return expression; } diff --git a/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java b/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java index 13b6f0e936..f9ab90fc32 100644 --- a/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java +++ b/theme-compiler/src/com/vaadin/sass/internal/expression/exception/ArithmeticException.java @@ -15,12 +15,28 @@ */ package com.vaadin.sass.internal.expression.exception; +import com.vaadin.sass.internal.parser.LexicalUnitImpl; + public class ArithmeticException extends RuntimeException { public ArithmeticException(String errorMsg) { super(errorMsg); } - public ArithmeticException() { - super("Illegal arithmetic expression"); + public ArithmeticException(String error, LexicalUnitImpl term) { + super(buildMessage(error, term)); + } + + private static String buildMessage(String message, LexicalUnitImpl term) { + StringBuilder builder = new StringBuilder(message); + + builder.append(": \""); + builder.append(term.toString()); + builder.append("\" ["); + builder.append(term.getLineNumber()); + builder.append(","); + builder.append(term.getColumnNumber()); + builder.append("]"); + + return builder.toString(); } } diff --git a/theme-compiler/tests/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluatorTest.java b/theme-compiler/tests/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluatorTest.java index 8978eb812e..c408255d0e 100644 --- a/theme-compiler/tests/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluatorTest.java +++ b/theme-compiler/tests/src/com/vaadin/sass/internal/expression/ArithmeticExpressionEvaluatorTest.java @@ -19,6 +19,7 @@ import org.junit.Assert; import org.junit.Test; import org.w3c.css.sac.LexicalUnit; +import com.vaadin.sass.internal.expression.exception.ArithmeticException; import com.vaadin.sass.internal.expression.exception.IncompatibleUnitsException; import com.vaadin.sass.internal.parser.LexicalUnitImpl; @@ -122,4 +123,15 @@ public class ArithmeticExpressionEvaluatorTest { Assert.assertEquals(LexicalUnit.SAC_CENTIMETER, result.getLexicalUnitType()); } + + @Test(expected = ArithmeticException.class) + public void testNonExistingSignal() { + LexicalUnitImpl operand2Integer = LexicalUnitImpl.createInteger(2, 3, + null, 2); + LexicalUnitImpl operatorComma = LexicalUnitImpl.createComma(2, 3, + operand2Integer); + LexicalUnitImpl operand3Integer = LexicalUnitImpl.createInteger(2, 3, + operatorComma, 3); + LexicalUnitImpl result = evaluator.evaluate(operand2Integer); + } } diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java new file mode 100644 index 0000000000..2a9df42ba1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java @@ -0,0 +1,65 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.tests.components.textfield; + +import com.vaadin.annotations.Theme; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.TextField; +import com.vaadin.ui.Window; + +@SuppressWarnings("serial") +@Theme("chameleon") +public class TextFieldTruncatesUnderscoresInModalDialogs extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Window dialog = new Window(); + + FormLayout formLayout = new FormLayout(); + formLayout.setSpacing(true); + + formLayout.addComponent(new Button("Disappear", + new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + event.getButton().setVisible(false); + } + })); + + formLayout.addComponent(new TextField(null, "____pqjgy____")); + + dialog.setContent(formLayout); + + getUI().addWindow(dialog); + } + + @Override + protected String getTestDescription() { + return "Text field must not truncate underscores in modal dialogs."; + } + + @Override + protected Integer getTicketNumber() { + return 12974; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogsTest.java b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogsTest.java new file mode 100644 index 0000000000..66b0df5ff4 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogsTest.java @@ -0,0 +1,16 @@ +package com.vaadin.tests.components.textfield; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class TextFieldTruncatesUnderscoresInModalDialogsTest extends + MultiBrowserTest { + + @Test + public void testWindowRepositioning() throws Exception { + openTestURL(); + + compareScreen("TextFieldTruncatesUnderscoresInModalDialogs"); + } +} |