Browse Source

Disable Sidebar API access since it will still be reworked (#17023)

Change-Id: I86900955497ba8e713f48457a7b858f50f9eeb73
tags/7.5.0.alpha1
Leif Åstrand 9 years ago
parent
commit
2a711a6e8c

+ 2
- 2
client/src/com/vaadin/client/widgets/Grid.java View File

@@ -2901,7 +2901,7 @@ public class Grid<T> extends ResizeComposite implements
*
* @since
*/
public static class Sidebar extends Composite {
private static class Sidebar extends Composite {

private final ClickHandler openCloseButtonHandler = new ClickHandler() {

@@ -7414,7 +7414,7 @@ public class Grid<T> extends ResizeComposite implements
* @since
* @return the sidebar widget for this grid
*/
public Sidebar getSidebar() {
private Sidebar getSidebar() {
return sidebar;
}


+ 0
- 48
uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridSidebarContentTest.java View File

@@ -49,54 +49,6 @@ public class GridSidebarContentTest extends GridBasicClientFeaturesTest {

}

@Test
public void testSidebarWithCustomContent() {
openTestURL();
CustomGridElement gridElement = getGridElement();

Assert.assertEquals("Sidebar should not be initially present", 0,
countBySelector(".v-grid-sidebar"));

selectMenuPath("Component", "Sidebar", "Toggle sidebar entry");

gridElement.findElement(By.className("v-grid-sidebar-button")).click();

WebElement sidebarButton = gridElement.findElement(By
.cssSelector(".v-grid-sidebar-content button"));

Assert.assertEquals("Sidebar button", sidebarButton.getText());

sidebarButton.click();

Assert.assertEquals("Click count: 1", sidebarButton.getText());

selectMenuPath("Component", "Sidebar", "Toggle sidebar entry");

Assert.assertEquals("Sidebar should disappear after content remove", 0,
countBySelector(".v-grid-sidebar"));
}

@Test
public void testProgrammaticSidebarToggle() {
openTestURL();

selectMenuPath("Component", "Sidebar", "Toggle sidebar visibility");

Assert.assertEquals("Toggling without content should't show anything",
0, countBySelector(".v-grid-sidebar-content button"));

selectMenuPath("Component", "Sidebar", "Toggle sidebar entry");
selectMenuPath("Component", "Sidebar", "Toggle sidebar visibility");

Assert.assertEquals("Toggling with content should show sidebar", 1,
countBySelector(".v-grid-sidebar-content button"));

selectMenuPath("Component", "Sidebar", "Toggle sidebar visibility");

Assert.assertEquals("Toggling again should hide sidebar", 0,
countBySelector(".v-grid-sidebar-content button"));
}

private int countBySelector(String cssSelector) {
return getGridElement().findElements(By.cssSelector(cssSelector))
.size();

+ 0
- 40
uitest/src/com/vaadin/tests/widgetset/client/grid/GridBasicClientFeaturesWidget.java View File

@@ -80,7 +80,6 @@ import com.vaadin.client.widgets.Grid.Column;
import com.vaadin.client.widgets.Grid.FooterRow;
import com.vaadin.client.widgets.Grid.HeaderRow;
import com.vaadin.client.widgets.Grid.SelectionMode;
import com.vaadin.client.widgets.Grid.Sidebar;
import com.vaadin.tests.widgetset.client.grid.GridBasicClientFeaturesWidget.Data;

/**
@@ -200,17 +199,6 @@ public class GridBasicClientFeaturesWidget extends

private boolean secondEditorError = false;

private Button sidebarEntry = new Button("Sidebar button",
new ClickHandler() {
private int count = 0;

@Override
public void onClick(ClickEvent event) {
count++;
sidebarEntry.setText("Click count: " + count);
}
});

/**
* Our basic data object
*/
@@ -420,7 +408,6 @@ public class GridBasicClientFeaturesWidget extends
createInternalsMenu();
createDataSourceMenu();
createDetailsMenu();
createSidebarMenu();

grid.getElement().getStyle().setZIndex(0);

@@ -1456,31 +1443,4 @@ public class GridBasicClientFeaturesWidget extends
}
}, menupath);
}

private void createSidebarMenu() {
String[] menupath = new String[] { "Component", "Sidebar" };

addMenuCommand("Toggle sidebar visibility", new ScheduledCommand() {
@Override
public void execute() {
Sidebar sidebar = grid.getSidebar();
if (sidebar.isOpen()) {
sidebar.close();
} else {
sidebar.open();
}
}
}, menupath);

addMenuCommand("Toggle sidebar entry", new ScheduledCommand() {
@Override
public void execute() {
if (sidebarEntry.getParent() != null) {
sidebarEntry.removeFromParent();
} else {
grid.getSidebar().add(sidebarEntry);
}
}
}, menupath);
}
}

Loading…
Cancel
Save