From bedbe2bf818385bb2356224a40c49de8f8056749 Mon Sep 17 00:00:00 2001 From: Mika Murtojarvi Date: Wed, 17 Dec 2014 18:10:09 +0200 Subject: Allow reading and writing empty designs (#7749). Change-Id: Id66201d040d07f0e0d731418624c9b702b2d0d3b --- server/src/com/vaadin/ui/declarative/Design.java | 33 ++++++++++++++-------- .../com/vaadin/ui/declarative/DesignContext.java | 2 +- 2 files changed, 23 insertions(+), 12 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/ui/declarative/Design.java b/server/src/com/vaadin/ui/declarative/Design.java index 59393a7815..dc96e789bf 100644 --- a/server/src/com/vaadin/ui/declarative/Design.java +++ b/server/src/com/vaadin/ui/declarative/Design.java @@ -184,13 +184,18 @@ public class Design implements Serializable { // taken care of by jsoup. Element root = doc.body(); Elements children = root.children(); - if (children.size() != 1) { + if (children.size() > 1) { throw new DesignException( - "The first level of a component hierarchy should contain exactly one root component, but found " - + children.size()); + "The first level of a component hierarchy should contain at most one root component, but found " + + children.size() + "."); } - Element element = children.first(); + Element element = children.size() == 0 ? null : children.first(); if (componentRoot != null) { + if (element == null) { + throw new DesignException( + "The root element cannot be null when the specified root Component is" + + " not null."); + } // user has specified root instance that may have member fields that // should be bound final FieldBinder binder; @@ -222,7 +227,8 @@ public class Design implements Serializable { designContext.removeComponentCreationListener(creationListener); } else { // createChild creates the entire component hierarchy - componentRoot = designContext.readDesign(element); + componentRoot = element == null ? null : designContext + .readDesign(element); } designContext.setRootComponent(componentRoot); return designContext; @@ -255,8 +261,10 @@ public class Design implements Serializable { // creates the entire component hierarchy rooted at the // given root node. Component root = designContext.getRootComponent(); - Node rootNode = designContext.createElement(root); - body.appendChild(rootNode); + if (root != null) { + Node rootNode = designContext.createElement(root); + body.appendChild(rootNode); + } designContext.writePackageMappings(doc); return doc; } @@ -424,10 +432,11 @@ public class Design implements Serializable { /** * Writes the given component tree in design format to the given output - * stream + * stream. * * @param component - * the root component of the component tree + * the root component of the component tree, null can be used for + * generating an empty design * @param outputStream * the output stream to write the design to. The design is always * written as UTF-8 @@ -446,8 +455,10 @@ public class Design implements Serializable { * and other information not available in the component tree. * * @param designContext - * the DesignContext object specifying the component hierarchy - * and the local id values of the objects + * The DesignContext object specifying the component hierarchy + * and the local id values of the objects. If + * designContext.getRootComponent() is null, an empty design will + * be generated. * @param outputStream * the output stream to write the design to. The design is always * written as UTF-8 diff --git a/server/src/com/vaadin/ui/declarative/DesignContext.java b/server/src/com/vaadin/ui/declarative/DesignContext.java index ade2494638..fd83339b76 100644 --- a/server/src/com/vaadin/ui/declarative/DesignContext.java +++ b/server/src/com/vaadin/ui/declarative/DesignContext.java @@ -415,7 +415,7 @@ public class DesignContext implements Serializable { * * @param componentDesign * The design element containing the description of the component - * to be created + * to be created. * @return the root component of component tree */ public Component readDesign(Element componentDesign) { -- cgit v1.2.3 From e1d84638ff22503d2fc8dd883802536770a21409 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 18 Dec 2014 18:49:22 +0200 Subject: Revert "Update selection after changes in underlying data source (#13580)." This reverts commit f4d1383b20da01f9fc43c32d7541a7816f8a9a9b. Change-Id: I5911f63ae35bef54f01477b14e5feffdf952aa6d --- server/src/com/vaadin/ui/AbstractSelect.java | 21 ---- .../TestAbstractSelectValueUpdate.java | 81 -------------- .../TableClickAndDragOnIconAndComponents.java | 10 +- .../components/table/TableDeleteSelectedRow.java | 117 --------------------- .../table/TableDeleteSelectedRowTest.java | 65 ------------ 5 files changed, 3 insertions(+), 291 deletions(-) delete mode 100644 server/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectValueUpdate.java delete mode 100644 uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRow.java delete mode 100644 uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRowTest.java (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/ui/AbstractSelect.java b/server/src/com/vaadin/ui/AbstractSelect.java index d5e47b2286..423ebcb46a 100644 --- a/server/src/com/vaadin/ui/AbstractSelect.java +++ b/server/src/com/vaadin/ui/AbstractSelect.java @@ -1688,8 +1688,6 @@ public abstract class AbstractSelect extends AbstractField implements // Clears the item id mapping table itemIdMapper.removeAll(); - adjustSelection(); - // Notify all listeners fireItemSetChange(); } @@ -1727,25 +1725,6 @@ public abstract class AbstractSelect extends AbstractField implements markAsDirty(); } - /** - * Removes orphaned ids from selection. - * - * @since 7.4 - */ - protected void adjustSelection() { - Object value = getValue(); - if (isMultiSelect() && (value instanceof Collection)) { - Collection collection = (Collection) value; - for (Object id : collection) { - if (!containsId(id)) { - unselect(id); - } - } - } else if (!containsId(value)) { - unselect(value); - } - } - /** * Implementation of item set change event. */ diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectValueUpdate.java b/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectValueUpdate.java deleted file mode 100644 index e81f6e09b6..0000000000 --- a/server/tests/src/com/vaadin/tests/server/component/abstractselect/TestAbstractSelectValueUpdate.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2000-2014 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.server.component.abstractselect; - -import java.util.Collection; -import java.util.Collections; - -import org.junit.Assert; -import org.junit.Test; - -import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.ui.AbstractSelect; - -public class TestAbstractSelectValueUpdate { - - @Test - public void removeItem_deleteItemFromUnderlyingContainer_selectValueIsUpdated() { - BeanItemContainer container = new BeanItemContainer( - Object.class); - Object item1 = new Object(); - Object item2 = new Object(); - container.addBean(item1); - container.addBean(item2); - TestSelect select = new TestSelect(); - select.setContainerDataSource(container); - - select.setValue(item1); - - Assert.assertNotNull("Value is null after selection", select.getValue()); - - container.removeItem(item1); - - Assert.assertNull("Value is not null after removal", select.getValue()); - } - - @Test - public void removeItem_multiselectSectionDeleteItemFromUnderlyingContainer_selectValueIsUpdated() { - BeanItemContainer container = new BeanItemContainer( - Object.class); - Object item1 = new Object(); - Object item2 = new Object(); - container.addBean(item1); - container.addBean(item2); - TestSelect select = new TestSelect(); - select.setMultiSelect(true); - select.setContainerDataSource(container); - - select.setValue(Collections.singletonList(item1)); - - checkSelectedItemsCount(select, 1); - - container.removeItem(item1); - - checkSelectedItemsCount(select, 0); - } - - private void checkSelectedItemsCount(TestSelect select, int count) { - Assert.assertNotNull("Selected value is null", select.getValue()); - Assert.assertTrue("Selected value is not a collection", - select.getValue() instanceof Collection); - Assert.assertEquals("Wrong number of selected items", - ((Collection) select.getValue()).size(), count); - } - - private class TestSelect extends AbstractSelect { - - } -} diff --git a/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java b/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java index 4bdec81ccf..64f1a64558 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java +++ b/uitest/src/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java @@ -38,7 +38,7 @@ public class TableClickAndDragOnIconAndComponents extends AbstractTestUI { table.setId("testable-table"); addComponent(table); for (int i = 0; i < 5; i++) { - addItemAfter(i + "foo", null, false); + addItemAfter(i + "foo", null); } table.addGeneratedColumn("Label", new ColumnGenerator() { @@ -118,15 +118,14 @@ public class TableClickAndDragOnIconAndComponents extends AbstractTestUI { IndexedContainer container = (IndexedContainer) table .getContainerDataSource(); - boolean selected = table.getValue().equals(dragged); container.removeItem(dragged); - addItemAfter(dragged, target, selected); + addItemAfter(dragged, target); } }); } @SuppressWarnings("unchecked") - private void addItemAfter(Object itemId, Object afterItemId, boolean select) { + private void addItemAfter(Object itemId, Object afterItemId) { Item item; if (afterItemId != null) { item = table.addItemAfter(afterItemId, itemId); @@ -137,9 +136,6 @@ public class TableClickAndDragOnIconAndComponents extends AbstractTestUI { item.getItemProperty("red").setValue("red " + itemId); item.getItemProperty("icon").setValue( new ThemeResource("../runo/icons/16/ok.png")); - if (select) { - table.select(itemId); - } } @Override diff --git a/uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRow.java b/uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRow.java deleted file mode 100644 index 349fbc73fe..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRow.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2000-2014 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.table; - -import java.util.Collection; - -import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.MultiSelectMode; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; - -/** - * Test UI for delete rows operation in multiselect table. - * - * @author Vaadin Ltd - */ -public class TableDeleteSelectedRow extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - final Table table = new Table(); - table.setSelectable(true); - table.setImmediate(true); - - BeanItemContainer container = createContainer(); - - table.setContainerDataSource(container); - - final Label selectedSize = new Label(); - selectedSize.addStyleName("selected-rows"); - - Button changeMode = new Button("Set multiselect", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - table.setMultiSelect(true); - table.setMultiSelectMode(MultiSelectMode.SIMPLE); - - BeanItemContainer container = createContainer(); - - table.setContainerDataSource(container); - } - }); - changeMode.addStyleName("multiselect"); - - Button delete = new Button("Delete selected", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - if (table.getValue() instanceof Collection) { - Collection rows = (Collection) table.getValue(); - for (Object row : rows) { - table.getContainerDataSource().removeItem(row); - } - rows = (Collection) table.getValue(); - selectedSize.setValue(String.valueOf(rows.size())); - } else { - table.getContainerDataSource().removeItem(table.getValue()); - selectedSize.setValue(table.getValue() == null ? "0" : "1"); - } - } - }); - delete.addStyleName("delete"); - - addComponents(delete, changeMode, selectedSize, table); - } - - @Override - protected String getTestDescription() { - return "Items deleted via container data source should not be available as selected in the table."; - } - - @Override - protected Integer getTicketNumber() { - return 13580; - } - - private BeanItemContainer createContainer() { - BeanItemContainer container = new BeanItemContainer( - TableBean.class); - container.addBean(new TableBean("first")); - container.addBean(new TableBean("second")); - container.addBean(new TableBean("third")); - return container; - } - - public static class TableBean { - - TableBean(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - private String name; - } -} diff --git a/uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRowTest.java b/uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRowTest.java deleted file mode 100644 index 0e807edf14..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/TableDeleteSelectedRowTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2000-2014 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.table; - -import org.junit.Assert; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import com.vaadin.tests.tb3.MultiBrowserTest; - -/** - * Test to check selected rows in multiselect table after deletion. - * - * @author Vaadin Ltd - */ -public class TableDeleteSelectedRowTest extends MultiBrowserTest { - - @Test - public void deleteSelectedRows() { - openTestURL(); - - // Select row in the table - findElement(By.className("v-table-row-odd")).click(); - - // Delete selected row - findElement(By.className("delete")).click(); - - WebElement selectedSize = findElement(By.className("selected-rows")); - int size = Integer.parseInt(selectedSize.getText()); - - Assert.assertEquals( - "Non empty collection of selected rows after remove via container", - 0, size); - - // Reset table and set multiselect mode - findElement(By.className("multiselect")).click(); - - // Select row in the table - findElement(By.className("v-table-row-odd")).click(); - - // Delete selected row - findElement(By.className("delete")).click(); - - selectedSize = findElement(By.className("selected-rows")); - size = Integer.parseInt(selectedSize.getText()); - - Assert.assertEquals( - "Non empty collection of selected rows after remove via container", - 0, size); - } -} -- cgit v1.2.3 From 3f1295a9d540e223fe7cc2c39f84cf904df8b60b Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 18 Dec 2014 18:01:37 +0200 Subject: Make is possible to click a detached button again (#12781) Partial revert of the earlier fix Change-Id: I67d016f1ea073189fdb53fc99f7c1b45b21ac124 --- server/src/com/vaadin/ui/Button.java | 2 +- .../tests/server/component/button/ButtonClick.java | 34 ++++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/ui/Button.java b/server/src/com/vaadin/ui/Button.java index 677f29ba13..6beb6ed686 100644 --- a/server/src/com/vaadin/ui/Button.java +++ b/server/src/com/vaadin/ui/Button.java @@ -365,7 +365,7 @@ public class Button extends AbstractComponent implements * No action is taken is the button is disabled. */ public void click() { - if (isConnectorEnabled() && !isReadOnly()) { + if (isEnabled() && !isReadOnly()) { fireClick(); } } diff --git a/server/tests/src/com/vaadin/tests/server/component/button/ButtonClick.java b/server/tests/src/com/vaadin/tests/server/component/button/ButtonClick.java index b41e93900f..3d5fe77f8e 100644 --- a/server/tests/src/com/vaadin/tests/server/component/button/ButtonClick.java +++ b/server/tests/src/com/vaadin/tests/server/component/button/ButtonClick.java @@ -3,9 +3,11 @@ package com.vaadin.tests.server.component.button; import org.junit.Assert; import org.junit.Test; +import com.vaadin.data.util.ObjectProperty; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.UI; /** @@ -14,6 +16,22 @@ import com.vaadin.ui.UI; public class ButtonClick { private boolean clicked = false; + @Test + public void clickDetachedButton() { + Button b = new Button(); + final ObjectProperty counter = new ObjectProperty(0); + b.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + counter.setValue(counter.getValue() + 1); + } + }); + + b.click(); + Assert.assertEquals(Integer.valueOf(1), counter.getValue()); + } + @Test public void testClick() { getButton().click(); @@ -36,22 +54,6 @@ public class ButtonClick { Assert.assertFalse("Read only button fires click events", clicked); } - @Test - public void testClickConnectorDisabled() { - Button b = new Button() { - @Override - public boolean isConnectorEnabled() { - return false; - } - }; - UI ui = createUI(); - b.setParent(ui); - addClickListener(b); - b.click(); - Assert.assertFalse("Button with disabled connector fires click events", - clicked); - } - private Button getButton() { Button b = new Button(); UI ui = createUI(); -- cgit v1.2.3 From 11129786c4591e768c018db2d3e39be1b21caa2d Mon Sep 17 00:00:00 2001 From: Denis Anisimov Date: Wed, 10 Dec 2014 22:17:32 +0200 Subject: Avoid NoClassDefFoundError retrieving Atmosphere version (#14904). Change-Id: Id64c4c4535e250c6e0e6457dfdfd17424bdc2fd4 --- server/src/com/vaadin/server/BootstrapHandler.java | 9 +++++-- .../com/vaadin/server/VaadinServletService.java | 28 ++++++++++------------ .../communication/AtmospherePushConnection.java | 11 +++++++++ 3 files changed, 31 insertions(+), 17 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index 985d7ef765..bfe195ccf9 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -39,6 +39,7 @@ import org.jsoup.parser.Tag; import com.vaadin.annotations.Viewport; import com.vaadin.annotations.ViewportGeneratorClass; +import com.vaadin.server.communication.AtmospherePushConnection; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.Version; import com.vaadin.shared.communication.PushMode; @@ -505,8 +506,12 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { JsonObject versionInfo = Json.createObject(); versionInfo.put("vaadinVersion", Version.getFullVersion()); - versionInfo.put("atmosphereVersion", - org.atmosphere.util.Version.getRawVersion()); + String atmosphereVersion = AtmospherePushConnection + .getAtmosphereVersion(); + if (atmosphereVersion != null) { + versionInfo.put("atmosphereVersion", atmosphereVersion); + } + appConfig.put("versionInfo", versionInfo); appConfig.put("widgetset", context.getWidgetsetName()); diff --git a/server/src/com/vaadin/server/VaadinServletService.java b/server/src/com/vaadin/server/VaadinServletService.java index 6832da236a..22848c023c 100644 --- a/server/src/com/vaadin/server/VaadinServletService.java +++ b/server/src/com/vaadin/server/VaadinServletService.java @@ -27,8 +27,7 @@ import java.util.logging.Logger; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; -import org.atmosphere.util.Version; - +import com.vaadin.server.communication.AtmospherePushConnection; import com.vaadin.server.communication.PushRequestHandler; import com.vaadin.server.communication.ServletBootstrapHandler; import com.vaadin.server.communication.ServletUIInitHandler; @@ -54,21 +53,20 @@ public class VaadinServletService extends VaadinService { } private static boolean checkAtmosphereSupport() { - try { - String rawVersion = Version.getRawVersion(); - if (!Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION - .equals(rawVersion)) { - getLogger().log( - Level.WARNING, - Constants.INVALID_ATMOSPHERE_VERSION_WARNING, - new Object[] { - Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION, - rawVersion }); - } - return true; - } catch (NoClassDefFoundError e) { + String rawVersion = AtmospherePushConnection.getAtmosphereVersion(); + if (rawVersion == null) { return false; } + + if (!Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION.equals(rawVersion)) { + getLogger().log( + Level.WARNING, + Constants.INVALID_ATMOSPHERE_VERSION_WARNING, + new Object[] { + Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION, + rawVersion }); + } + return true; } @Override diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java index a274fbbb9b..0819a24ee9 100644 --- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java @@ -31,6 +31,7 @@ import java.util.logging.Logger; import org.atmosphere.cpr.AtmosphereResource; import org.atmosphere.cpr.AtmosphereResource.TRANSPORT; +import org.atmosphere.util.Version; import com.vaadin.shared.communication.PushConstants; import com.vaadin.ui.UI; @@ -44,6 +45,16 @@ import com.vaadin.ui.UI; */ public class AtmospherePushConnection implements PushConnection { + public static String getAtmosphereVersion() { + try { + String v = Version.getRawVersion(); + assert v != null; + return v; + } catch (NoClassDefFoundError e) { + return null; + } + } + /** * Represents a message that can arrive as multiple fragments. */ -- cgit v1.2.3 From 3c181c6e31749f90a8d9c0d78715fe65aa861b74 Mon Sep 17 00:00:00 2001 From: Sauli Tähkäpää Date: Fri, 28 Nov 2014 12:28:41 +0200 Subject: Add @since to AbstractSplitPanel. (#15285) Change-Id: I476d8c7e53ce90941b00deefffc1b6a7ea63b43b --- server/src/com/vaadin/ui/AbstractSplitPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/ui/AbstractSplitPanel.java b/server/src/com/vaadin/ui/AbstractSplitPanel.java index 414681f5dd..af73fca6a8 100644 --- a/server/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/server/src/com/vaadin/ui/AbstractSplitPanel.java @@ -358,7 +358,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * by the first region, but if split position is reversed the measuring is * done by the second region instead. * - * @since 7.4 + * @since 7.3.6 * @return {@code true} if reversed, {@code false} otherwise. * @see #setSplitPosition(float, boolean) */ -- cgit v1.2.3 From 304cd3f48a0e7729053491d6f2afc51b3947a240 Mon Sep 17 00:00:00 2001 From: Denis Anisimov Date: Mon, 15 Sep 2014 21:53:39 +0300 Subject: 3 args method buildAndBind should be overriden, not 2 args (#12453). Change-Id: I7afabec7e0d9334b799019b581fca858895b2cc1 --- server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java | 6 +++--- .../server/component/fieldgroup/BeanFieldGroupTest.java | 14 ++++++++++++++ .../vaadin/tests/fieldgroup/FormWithNestedProperties.java | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java index 23a72ee1e5..0a92c00cad 100644 --- a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java +++ b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java @@ -155,10 +155,10 @@ public class BeanFieldGroup extends FieldGroup { } @Override - public Field buildAndBind(String caption, Object propertyId) - throws BindException { + public T buildAndBind(String caption, Object propertyId, + Class fieldType) throws BindException { ensureNestedPropertyAdded(propertyId); - return super.buildAndBind(caption, propertyId); + return super.buildAndBind(caption, propertyId, fieldType); } @Override diff --git a/server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java b/server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java index 9c37b91ef5..90c079b35c 100644 --- a/server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java @@ -11,6 +11,7 @@ import com.vaadin.data.fieldgroup.FieldGroup.CommitException; import com.vaadin.data.fieldgroup.PropertyId; import com.vaadin.data.util.BeanItem; import com.vaadin.ui.Field; +import com.vaadin.ui.RichTextArea; import com.vaadin.ui.TextField; public class BeanFieldGroupTest { @@ -135,6 +136,19 @@ public class BeanFieldGroupTest { assertEquals(bean.nestedBean.hello, helloField.getValue().toString()); } + @Test + public void buildAndBindNestedRichTextAreaProperty() { + + MyBean bean = new MyBean(); + + BeanFieldGroup bfg = new BeanFieldGroup(MyBean.class); + bfg.setItemDataSource(bean); + + RichTextArea helloField = bfg.buildAndBind("Hello string", + "nestedBean.hello", RichTextArea.class); + assertEquals(bean.nestedBean.hello, helloField.getValue().toString()); + } + @Test public void setDataSource_nullBean_nullBeanIsSetInDataSource() { BeanFieldGroup group = new BeanFieldGroup(MyBean.class); diff --git a/uitest/src/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java b/uitest/src/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java index f66d822495..6caa8f3e26 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java +++ b/uitest/src/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java @@ -31,8 +31,8 @@ public class FormWithNestedProperties extends AbstractBeanFieldGroupTest { super.setup(); setFieldBinder(new BeanFieldGroup(Person.class)); - country = getFieldBinder().buildAndBind("country", "address.country", - NativeSelect.class); + country = (NativeSelect) getFieldBinder().buildAndBind("country", + "address.country", NativeSelect.class); getFieldBinder().bindMemberFields(this); addComponent(firstName); addComponent(lastName); -- cgit v1.2.3 From 42ef01bfdb2c93e03b8b8e54b7422cbc9b1eea32 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 4 Sep 2014 22:12:59 +0300 Subject: Allow TabSheet and Accordion tab captions to contain HTML (#14609) Change-Id: If15db442fdbdcc80918e52f8c87e0808f76eb336 --- client/src/com/vaadin/client/ui/VAccordion.java | 1 + client/src/com/vaadin/client/ui/VTabsheet.java | 1 + client/src/com/vaadin/client/ui/VTabsheetBase.java | 30 +++++++++ server/src/com/vaadin/ui/TabSheet.java | 30 +++++++++ .../vaadin/shared/ui/tabsheet/TabsheetState.java | 4 ++ .../components/tabsheet/HtmlInTabCaption.java | 72 +++++++++++++++++++++ .../components/tabsheet/HtmlInTabCaptionTest.java | 73 ++++++++++++++++++++++ 7 files changed, 211 insertions(+) create mode 100644 uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaption.java create mode 100644 uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaptionTest.java (limited to 'server/src/com/vaadin') 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. + *

+ * 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; + } + } diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java index 266c93e81f..67dfdd4258 100644 --- a/server/src/com/vaadin/ui/TabSheet.java +++ b/server/src/com/vaadin/ui/TabSheet.java @@ -1621,4 +1621,34 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, } } + /** + * Sets whether HTML is allowed in the tab captions. + *

+ * If set to true, the captions are rendered in the browser as HTML and the + * developer is responsible for ensuring no harmful HTML is used. If set to + * false, the content is rendered in the browser as plain text. + *

+ * The default is false, i.e. render tab captions as plain text + * + * @param tabCaptionsAsHtml + * true if the tab captions are rendered as HTML, false if + * rendered as plain text + * @since 7.4 + */ + public void setTabCaptionsAsHtml(boolean tabCaptionsAsHtml) { + getState().tabCaptionsAsHtml = tabCaptionsAsHtml; + } + + /** + * Checks whether HTML is allowed in the tab captions. + *

+ * The default is false, i.e. render tab captions as plain text + * + * @return true if the tab captions are rendered as HTML, false if rendered + * as plain text + * @since 7.4 + */ + public boolean isTabCaptionsAsHtml() { + return getState(false).tabCaptionsAsHtml; + } } diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java index 98a1d2b87f..f17f214626 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; import com.vaadin.shared.AbstractComponentState; +import com.vaadin.shared.annotations.DelegateToWidget; public class TabsheetState extends AbstractComponentState { public static final String PRIMARY_STYLE_NAME = "v-tabsheet"; @@ -41,4 +42,7 @@ public class TabsheetState extends AbstractComponentState { /** the key of the currently selected tab */ public String selected; + @DelegateToWidget + public boolean tabCaptionsAsHtml = false; + } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaption.java b/uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaption.java new file mode 100644 index 0000000000..66a27a10b5 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaption.java @@ -0,0 +1,72 @@ +/* + * Copyright 2000-2014 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.tabsheet; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Accordion; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet; + +public class HtmlInTabCaption extends AbstractTestUI { + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + getLayout().setSpacing(true); + TabSheet ts = new TabSheet(); + ts.setCaption("TabSheet - no html in tab captions"); + ts.setCaptionAsHtml(true); + ts.addTab(new Label(), "red"); + ts.addTab(new Label(), "blue"); + addComponent(ts); + + ts = new TabSheet(); + ts.setCaption("TabSheet - html in tab captions"); + ts.setCaptionAsHtml(false); + ts.setTabCaptionsAsHtml(true); + ts.addTab(new Label(), "red"); + ts.addTab(new Label(), "blue"); + addComponent(ts); + + Accordion acc = new Accordion(); + acc.setCaption("Accordion - no html in tab captions"); + acc.setCaptionAsHtml(true); + acc.addTab(new Label(), "red"); + acc.addTab(new Label(), "blue"); + addComponent(acc); + + acc = new Accordion(); + acc.setCaption("Accordion - html in tab captions"); + acc.setCaptionAsHtml(false); + acc.setTabCaptionsAsHtml(true); + acc.addTab(new Label(), "red"); + acc.addTab(new Label(), "blue"); + addComponent(acc); + + } + + @Override + protected Integer getTicketNumber() { + return 14609; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaptionTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaptionTest.java new file mode 100644 index 0000000000..41b7037b09 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/HtmlInTabCaptionTest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2000-2014 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.tabsheet; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.AccordionElement; +import com.vaadin.testbench.elements.TabSheetElement; +import com.vaadin.tests.tb3.SingleBrowserTest; + +public class HtmlInTabCaptionTest extends SingleBrowserTest { + static final String PLAIN_TEXT_RED = "red"; + static final String HTML_TEXT_RED = "red"; + static final String PLAIN_TEXT_BLUE = "blue"; + static final String HTML_TEXT_BLUE = "blue"; + + @Test + public void tabsheetWithoutHtmlCaptions() { + openTestURL(); + TabSheetElement ts = $(TabSheetElement.class).get(0); + Assert.assertEquals(PLAIN_TEXT_RED, getTab(ts, 0).getText()); + Assert.assertEquals(PLAIN_TEXT_BLUE, getTab(ts, 1).getText()); + } + + private WebElement getTab(TabSheetElement tabSheetElement, int i) { + String className = "v-tabsheet-tabitem"; + if (tabSheetElement instanceof AccordionElement) { + className = "v-accordion-item"; + } + return tabSheetElement.findElements(By.className(className)).get(i); + } + + @Test + public void tabsheetWithHtmlCaptions() { + openTestURL(); + TabSheetElement ts = $(TabSheetElement.class).get(1); + Assert.assertEquals(HTML_TEXT_RED, getTab(ts, 0).getText()); + Assert.assertEquals(HTML_TEXT_BLUE, getTab(ts, 1).getText()); + } + + @Test + public void accordionWithoutHtmlCaptions() { + openTestURL(); + AccordionElement acc = $(AccordionElement.class).get(0); + Assert.assertEquals(PLAIN_TEXT_RED, getTab(acc, 0).getText()); + Assert.assertEquals(PLAIN_TEXT_BLUE, getTab(acc, 1).getText()); + + } + + @Test + public void accordionWithHtmlCaptions() { + openTestURL(); + AccordionElement acc = $(AccordionElement.class).get(1); + Assert.assertEquals(HTML_TEXT_RED, getTab(acc, 0).getText()); + Assert.assertEquals(HTML_TEXT_BLUE, getTab(acc, 1).getText()); + } +} -- cgit v1.2.3 From 62d7830a7702691e6a262171ced119e0e7fa55fc Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 10 Dec 2014 09:01:29 +0200 Subject: Ensure enum fields are created when not specifying a strict type (#10975) Change-Id: I64cfc5b315444d7135738a8f3870bf50050f4678 --- .../fieldgroup/DefaultFieldGroupFieldFactory.java | 24 ++++++++++++++++--- .../data/DefaultFieldGroupFieldFactoryTest.java | 28 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java b/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java index 98fed3ad01..8e32585a47 100644 --- a/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java +++ b/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java @@ -91,10 +91,20 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { private T createEnumField(Class type, Class fieldType) { + // Determine first if we should (or can) create a select for the enum + Class selectClass = null; if (AbstractSelect.class.isAssignableFrom(fieldType)) { - AbstractSelect s = createCompatibleSelect((Class) fieldType); + selectClass = (Class) fieldType; + } else if (anySelect(fieldType)) { + selectClass = AbstractSelect.class; + } + + if (selectClass != null) { + AbstractSelect s = createCompatibleSelect(selectClass); populateWithEnumData(s, (Class) type); return (T) s; + } else if (AbstractTextField.class.isAssignableFrom(fieldType)) { + return (T) createAbstractTextField((Class) fieldType); } return null; @@ -106,8 +116,8 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { if (InlineDateField.class.isAssignableFrom(fieldType)) { field = new InlineDateField(); - } else if (DateField.class.isAssignableFrom(fieldType) - || fieldType == Field.class) { + } else if (anyField(fieldType) + || DateField.class.isAssignableFrom(fieldType)) { field = new PopupDateField(); } else if (AbstractTextField.class.isAssignableFrom(fieldType)) { field = createAbstractTextField((Class) fieldType); @@ -119,6 +129,10 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { return (T) field; } + private boolean anyField(Class fieldType) { + return fieldType == Field.class || fieldType == AbstractField.class; + } + protected AbstractSelect createCompatibleSelect( Class fieldType) { AbstractSelect select; @@ -143,6 +157,10 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { return select; } + private boolean anySelect(Class fieldType) { + return anyField(fieldType) || fieldType == AbstractSelect.class; + } + protected T createBooleanField(Class fieldType) { if (fieldType.isAssignableFrom(CheckBox.class)) { CheckBox cb = new CheckBox(null); diff --git a/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java b/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java index bbf74bfb21..fc258ab138 100644 --- a/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java +++ b/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java @@ -23,9 +23,12 @@ import org.junit.Before; import org.junit.Test; import com.vaadin.data.fieldgroup.DefaultFieldGroupFieldFactory; +import com.vaadin.ui.AbstractSelect; +import com.vaadin.ui.ComboBox; import com.vaadin.ui.DateField; import com.vaadin.ui.Field; import com.vaadin.ui.InlineDateField; +import com.vaadin.ui.ListSelect; import com.vaadin.ui.PopupDateField; import com.vaadin.ui.TextField; @@ -89,4 +92,29 @@ public class DefaultFieldGroupFieldFactoryTest { Assert.assertEquals(PopupDateField.class, f.getClass()); } + public enum SomeEnum { + FOO, BAR; + } + + @Test + public void testEnumComboBox() { + Field f = fieldFactory.createField(SomeEnum.class, ComboBox.class); + Assert.assertNotNull(f); + Assert.assertEquals(ComboBox.class, f.getClass()); + } + + @Test + public void testEnumAnySelect() { + Field f = fieldFactory + .createField(SomeEnum.class, AbstractSelect.class); + Assert.assertNotNull(f); + Assert.assertEquals(ListSelect.class, f.getClass()); + } + + @Test + public void testEnumAnyField() { + Field f = fieldFactory.createField(SomeEnum.class, Field.class); + Assert.assertNotNull(f); + Assert.assertEquals(ListSelect.class, f.getClass()); + } } -- cgit v1.2.3 From 2346f36de54719ca635b471156188b828317b1a7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 19 Dec 2014 02:13:20 +0200 Subject: Disable Atmosphere annotation scanning (#15414) Change-Id: I172a7c3a25b059cbddfae4d7b60d7019bed5fc58 --- server/src/com/vaadin/server/communication/PushRequestHandler.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/server/communication/PushRequestHandler.java b/server/src/com/vaadin/server/communication/PushRequestHandler.java index 40eb1b688e..d0367d0bed 100644 --- a/server/src/com/vaadin/server/communication/PushRequestHandler.java +++ b/server/src/com/vaadin/server/communication/PushRequestHandler.java @@ -29,6 +29,7 @@ import org.atmosphere.cpr.AtmosphereInterceptor; import org.atmosphere.cpr.AtmosphereRequest; import org.atmosphere.cpr.AtmosphereResponse; import org.atmosphere.interceptor.HeartbeatInterceptor; +import org.atmosphere.util.VoidAnnotationProcessor; import com.vaadin.server.RequestHandler; import com.vaadin.server.ServiceDestroyEvent; @@ -91,6 +92,8 @@ public class PushRequestHandler implements RequestHandler, atmosphere.addAtmosphereHandler("/*", pushHandler.handler); atmosphere.addInitParameter(ApplicationConfig.BROADCASTER_CACHE, UUIDBroadcasterCache.class.getName()); + atmosphere.addInitParameter(ApplicationConfig.ANNOTATION_PROCESSOR, + VoidAnnotationProcessor.class.getName()); atmosphere.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); atmosphere.addInitParameter(ApplicationConfig.MESSAGE_DELIMITER, -- cgit v1.2.3 From 8ba0064fe230b4cee7792c651da89adbaa9b2952 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 19 Dec 2014 02:10:47 +0200 Subject: Remove mentions of SimpleViewDisplay as there is no such thing (#12934) Change-Id: I8fd616f52e7a4fbc8c0f251103f440092ec0c57f --- server/src/com/vaadin/navigator/Navigator.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'server/src/com/vaadin') diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java index 591f73dc75..ef5c61a294 100644 --- a/server/src/com/vaadin/navigator/Navigator.java +++ b/server/src/com/vaadin/navigator/Navigator.java @@ -58,9 +58,8 @@ import com.vaadin.ui.UI; * Views can be explicitly registered or dynamically generated and listening to * view changes is possible. *

- * Note that {@link Navigator} is not a component itself but comes with - * {@link SimpleViewDisplay} which is a component that displays the selected - * view as its contents. + * Note that {@link Navigator} is not a component itself but uses a + * {@link ViewDisplay} to update contents based on the state. * * @author Vaadin Ltd * @since 7.0 @@ -627,11 +626,9 @@ public class Navigator implements Serializable { } /** - * Return the ViewDisplay used by the navigator. Unless another display is - * specified, a {@link SimpleViewDisplay} (which is a {@link Component}) is - * used by default. + * Return the {@link ViewDisplay} used by the navigator. * - * @return current ViewDisplay + * @return the ViewDisplay used for displaying views */ public ViewDisplay getDisplay() { return display; -- cgit v1.2.3