/**
* <p>
* This interface is implemented by all visual objects that can be scrolled
- * programmatically from the server-side, or for which it is possible to know
- * the scroll position on the server-side. The unit of scrolling is pixel.
+ * programmatically from the server-side. The unit of scrolling is pixel.
* </p>
*
* @author Vaadin Ltd.
* scrolled right.
* </p>
*
- * <p>
- * The method only has effect if programmatic scrolling is enabled for the
- * scrollable. Some implementations may require enabling programmatic before
- * this method can be used. See {@link #setScrollable(boolean)} for more
- * information.
- * </p>
- *
- * @param pixelsScrolled
+ * @param scrollLeft
* the xOffset.
*/
- public void setScrollLeft(int pixelsScrolled);
+ public void setScrollLeft(int scrollLeft);
/**
* Gets scroll top offset.
* </p>
*
* <p>
- * The method only has effect if programmatic scrolling is enabled for the
- * scrollable. Some implementations may require enabling programmatic before
- * this method can be used. See {@link #setScrollable(boolean)} for more
- * information.
- * </p>
- *
- * <p>
* The scrolling position is limited by the current height of the content
* area. If the position is below the height, it is scrolled to the bottom.
* However, if the same response also adds height to the content area,
* area.
* </p>
*
- * @param pixelsScrolled
+ * @param scrollTop
* the yOffset.
*/
- public void setScrollTop(int pixelsScrolled);
-
- /**
- * Is programmatic scrolling enabled.
- *
- * <p>
- * Whether programmatic scrolling with {@link #setScrollLeft(int)} and
- * {@link #setScrollTop(int)} is enabled.
- * </p>
- *
- * @return <code>true</code> if the scrolling is enabled, otherwise
- * <code>false</code>.
- */
- public boolean isScrollable();
-
- /**
- * Enables or disables programmatic scrolling.
- *
- * <p>
- * Enables setting the scroll position with {@link #setScrollLeft(int)} and
- * {@link #setScrollTop(int)}. Implementations of the interface may have
- * programmatic scrolling disabled by default, in which case you need to
- * enable it to use the mentioned methods.
- * </p>
- *
- * <p>
- * Notice that this does <i>not</i> control whether scroll bars are shown
- * for a scrollable component. That normally happens automatically when the
- * content grows too big for the component, relying on the "overflow: auto"
- * property in CSS.
- * </p>
- *
- * @param isScrollingEnabled
- * true if the scrolling is allowed.
- */
- public void setScrollable(boolean isScrollingEnabled);
+ public void setScrollTop(int scrollTop);
}
private void createConnectorsIfNeeded(ValueMap json) {
VConsole.log(" * Creating connectors (if needed)");
- JsArray<ValueMap> changes = json.getJSValueMapArray("changes");
- // FIXME: This should be based on shared state, not the old
- // "changes"
- int length = changes.length();
- for (int i = 0; i < length; i++) {
+ ValueMap types = json.getValueMap("types");
+ JsArrayString keyArray = types.getKeyArray();
+ for (int i = 0; i < keyArray.length(); i++) {
try {
- final UIDL change = changes.get(i).cast();
- final UIDL uidl = change.getChildUIDL(0);
- String connectorId = uidl.getId();
+ String connectorId = keyArray.get(i);
+ String connectorType = types.getString(connectorId);
Connector connector = connectorMap
.getConnector(connectorId);
if (connector != null) {
continue;
}
-
// Connector does not exist so we must create it
- if (!uidl.getTag().equals(
- configuration.getEncodedWindowTag())) {
+ if (!connectorType.equals(configuration
+ .getEncodedWindowTag())) {
// create, initialize and register the paintable
- getConnector(uidl.getId(), uidl.getTag());
+ getConnector(connectorId, connectorType);
} else {
// First RootConnector update. Before this the
// RootConnector has been created but not
// TODO This check should be done on the server side in
// the future so the hierarchy update is only sent when
// something actually has changed
- Collection<ComponentConnector> oldChildren = ccc
+ List<ComponentConnector> oldChildren = ccc
.getChildren();
boolean actuallyChanged = !Util.collectionsEquals(
oldChildren, newChildren);
.create(ConnectorHierarchyChangedEvent.class);
event.setOldChildren(oldChildren);
event.setParent(ccc);
- ccc.setChildren((Collection) newChildren);
+ ccc.setChildren((List) newChildren);
events.add(event);
} catch (final Throwable e) {
VConsole.error(e);
package com.vaadin.terminal.gwt.client;
-import java.util.Collection;
+import java.util.List;
import com.google.gwt.user.client.ui.HasWidgets;
* @return A collection of children for this connector. An empty collection
* if there are no children. Never returns null.
*/
- public Collection<ComponentConnector> getChildren();
+ public List<ComponentConnector> getChildren();
/**
* Sets the children for this connector. This method should only be called
* @param children
* The new child connectors
*/
- public void setChildren(Collection<ComponentConnector> children);
+ public void setChildren(List<ComponentConnector> children);
/**
* Called when the child connector hierarchy of this connector has changed.
package com.vaadin.terminal.gwt.client;
-import java.util.Collection;
+import java.util.List;
/**
* Event for containing data related to a change in the {@link Connector}
*
*/
public class ConnectorHierarchyChangedEvent {
- Collection<ComponentConnector> oldChildren;
+ List<ComponentConnector> oldChildren;
private ComponentContainerConnector parent;
public ConnectorHierarchyChangedEvent() {
*
* @return A collection of old child connectors. Never returns null.
*/
- public Collection<ComponentConnector> getOldChildren() {
+ public List<ComponentConnector> getOldChildren() {
return oldChildren;
}
* @param oldChildren
* The old child connectors. Must not be null.
*/
- public void setOldChildren(Collection<ComponentConnector> oldChildren) {
+ public void setOldChildren(List<ComponentConnector> oldChildren) {
this.oldChildren = oldChildren;
}
}
if (id == null) {
- /*
- * Uncomment the following to debug unregistring components. No
- * paintables with null id should end here. At least one exception
- * is our VScrollTableRow, that is hacked to fake it self as a
- * Paintable to build support for sizing easier.
- */
- // if (!(p instanceof VScrollTableRow)) {
- // VConsole.log("Trying to unregister Paintable not created by Application Connection.");
- // }
+ VConsole.log("Tried to unregister a "
+ + connector.getClass().getName() + " (" + id
+ + ") which was not registered");
} else {
unregistryBag.add(id);
}
for (Connector connector : getConnectors()) {
if (connector instanceof ComponentConnector) {
ComponentConnector componentConnector = (ComponentConnector) connector;
- if (!unregistryBag.contains(getConnectorId(connector))) {
+ if (!unregistryBag.contains(connector.getId())) {
result.add(componentConnector);
}
}
+ ") that is never registered (or already unregistered)");
continue;
}
+ VConsole.log("Unregistering connector "
+ + connector.getClass().getName() + " " + connectorId);
Widget widget = null;
if (connector instanceof ComponentConnector) {
widget = ((ComponentConnector) connector).getWidget();
*/
package com.vaadin.terminal.gwt.client.ui;
-import java.util.Collection;
import java.util.LinkedList;
+import java.util.List;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ComponentContainerConnector;
public abstract class AbstractComponentContainerConnector extends
AbstractComponentConnector implements ComponentContainerConnector {
- Collection<ComponentConnector> children;
+ List<ComponentConnector> children;
/**
* Default constructor
* @see
* com.vaadin.terminal.gwt.client.ComponentContainerConnector#getChildren()
*/
- public Collection<ComponentConnector> getChildren() {
+ public List<ComponentConnector> getChildren() {
if (children == null) {
return new LinkedList<ComponentConnector>();
}
* com.vaadin.terminal.gwt.client.ComponentContainerConnector#setChildren
* (java.util.Collection)
*/
- public void setChildren(Collection<ComponentConnector> children) {
+ public void setChildren(List<ComponentConnector> children) {
this.children = children;
}
* (com.vaadin.terminal.gwt.client.ConnectorHierarchyChangedEvent)
*/
public void connectorHierarchyChanged(ConnectorHierarchyChangedEvent event) {
- //TODO Remove debug info
+ // TODO Remove debug info
System.out.println("Hierarchy changed for " + Util.getSimpleName(this));
System.out.println("* Old children: " + event.getOldChildren());
System.out.println("* New children: " + getChildren());
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ComponentState;
+import com.vaadin.terminal.gwt.client.ConnectorHierarchyChangedEvent;
import com.vaadin.terminal.gwt.client.LayoutManager;
import com.vaadin.terminal.gwt.client.UIDL;
public class PanelConnector extends AbstractComponentContainerConnector
implements SimpleManagedLayout, PostLayoutListener {
+ public static class PanelState extends ComponentState {
+ private int tabIndex;
+ private int scrollLeft, scrollTop;
+
+ public int getTabIndex() {
+ return tabIndex;
+ }
+
+ public void setTabIndex(int tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+
+ public int getScrollLeft() {
+ return scrollLeft;
+ }
+
+ public void setScrollLeft(int scrollLeft) {
+ this.scrollLeft = scrollLeft;
+ }
+
+ public int getScrollTop() {
+ return scrollTop;
+ }
+
+ public void setScrollTop(int scrollTop) {
+ this.scrollTop = scrollTop;
+ }
+
+ }
+
public static final String CLICK_EVENT_IDENTIFIER = "click";
private Integer uidlScrollTop;
getWidget().handleError(uidl);
// Render content
- final UIDL layoutUidl = uidl.getChildUIDL(0);
- final ComponentConnector newLayout = client.getPaintable(layoutUidl);
- if (newLayout != getWidget().layout) {
- if (getWidget().layout != null) {
- client.unregisterPaintable(getWidget().layout);
- }
- getWidget().setWidget(newLayout.getWidget());
- getWidget().layout = newLayout;
- }
- getWidget().layout.updateFromUIDL(layoutUidl, client);
+ // final UIDL layoutUidl = uidl.getChildUIDL(0);
+ // final ComponentConnector newLayout = client.getPaintable(layoutUidl);
+ // if (newLayout != getWidget().layout) {
+ // if (getWidget().layout != null) {
+ // client.unregisterPaintable(getWidget().layout);
+ // }
+ // getWidget().setWidget(newLayout.getWidget());
+ // getWidget().layout = newLayout;
+ // }
+ // getWidget().layout.updateFromUIDL(layoutUidl, client);
// We may have actions attached to this panel
- if (uidl.getChildCount() > 1) {
+ if (uidl.getChildCount() > 0) {
final int cnt = uidl.getChildCount();
- for (int i = 1; i < cnt; i++) {
+ for (int i = 0; i < cnt; i++) {
UIDL childUidl = uidl.getChildUIDL(i);
if (childUidl.getTag().equals("actions")) {
if (getWidget().shortcutHandler == null) {
}
}
- if (uidl.hasVariable("scrollTop")
- && uidl.getIntVariable("scrollTop") != getWidget().scrollTop) {
+ if (getState().getScrollTop() != getWidget().scrollTop) {
// Sizes are not yet up to date, so changing the scroll position
// is deferred to after the layout phase
- uidlScrollTop = new Integer(uidl.getIntVariable("scrollTop"));
+ uidlScrollTop = getState().getScrollTop();
}
- if (uidl.hasVariable("scrollLeft")
- && uidl.getIntVariable("scrollLeft") != getWidget().scrollLeft) {
+ if (getState().getScrollLeft() != getWidget().scrollLeft) {
// Sizes are not yet up to date, so changing the scroll position
// is deferred to after the layout phase
- uidlScrollLeft = new Integer(uidl.getIntVariable("scrollLeft"));
+ uidlScrollLeft = getState().getScrollLeft();
}
// And apply tab index
- if (uidl.hasVariable("tabindex")) {
- getWidget().contentNode
- .setTabIndex(uidl.getIntVariable("tabindex"));
- }
+ getWidget().contentNode.setTabIndex(getState().getTabIndex());
}
public void updateCaption(ComponentConnector component, UIDL uidl) {
}
}
+ @Override
+ public PanelState getState() {
+ return (PanelState) super.getState();
+ }
+
+ @Override
+ protected PanelState createState() {
+ return GWT.create(PanelState.class);
+ }
+
+ @Override
+ public void connectorHierarchyChanged(ConnectorHierarchyChangedEvent event) {
+ super.connectorHierarchyChanged(event);
+
+ possiblyUnregisterOldChild(event);
+
+ // We always have 0 or 1 child
+ ComponentConnector newChild = null;
+ if (getChildren().size() != 0) {
+ // We now have one child
+ newChild = getChildren().get(0);
+ }
+
+ getWidget().setWidget(newChild.getWidget());
+ }
+
+ private void possiblyUnregisterOldChild(ConnectorHierarchyChangedEvent event) {
+ // Did we have a child that needs to be unregistered?
+ if (event.getOldChildren().size() != 0) {
+ ComponentConnector oldChild = event.getOldChildren().get(0);
+ // We had a child, unregister it
+ // TODO Should be handled by the framework
+ if (oldChild.getParent() == null) {
+ getConnection().unregisterPaintable(oldChild);
+ }
+ }
+ }
}
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.SimplePanel;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
private Element errorIndicatorElement;
- ComponentConnector layout;
-
ShortcutActionHandler shortcutHandler;
private String width = "";
LinkedList<Paintable> stateQueue = new LinkedList<Paintable>();
LinkedList<Paintable> rpcPendingQueue = new LinkedList<Paintable>();
LinkedList<Paintable> hierarchyPendingQueue = new LinkedList<Paintable>();
+ LinkedList<Paintable> connectorTypeQueue = new LinkedList<Paintable>();
if (paintables != null) {
final Paintable p = paintQueue.removeFirst();
// for now, all painted components may need a state refresh
stateQueue.push(p);
+ // TODO This should be optimized. The type only needs to be sent
+ // once for each connector id + on refresh
+ connectorTypeQueue.push(p);
// also a hierarchy update
hierarchyPendingQueue.push(p);
// ... and RPC calls to be sent
outWriter.append(sharedStates.toString());
outWriter.print(", "); // close states
}
+ if (!connectorTypeQueue.isEmpty()) {
+ JSONObject connectorTypes = new JSONObject();
+ while (!connectorTypeQueue.isEmpty()) {
+ final Paintable p = connectorTypeQueue.pop();
+ String paintableId = getPaintableId(p);
+ String connectorType = paintTarget.getTag(p);
+ try {
+ connectorTypes.put(paintableId, connectorType);
+ } catch (JSONException e) {
+ throw new PaintException(
+ "Failed to send connector type for paintable "
+ + paintableId + ": " + e.getMessage());
+ }
+ }
+ outWriter.print("\"types\":");
+ outWriter.append(connectorTypes.toString());
+ outWriter.print(", "); // close states
+ }
if (!hierarchyPendingQueue.isEmpty()) {
// Send update hierarchy information to the client.
while (iterator.hasNext()) {
Component child = iterator.next();
if (child.getState().isVisible()) {
- String childConnectorId = paintableIdMap.get(child);
+ String childConnectorId = getPaintableId(child);
children.put(childConnectorId);
}
}
}
}
outWriter.append(hierarchyInfo.toString());
- outWriter.print(", "); // close states
+ outWriter.print(", "); // close hierarchy
}
import com.vaadin.terminal.Scrollable;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.PanelConnector;
+import com.vaadin.terminal.gwt.client.ui.PanelConnector.PanelState;
import com.vaadin.ui.Component.Focusable;
-import com.vaadin.ui.themes.Reindeer;
-import com.vaadin.ui.themes.Runo;
/**
* Panel - a simple single component container.
private static final String CLICK_EVENT = PanelConnector.CLICK_EVENT_IDENTIFIER;
- /**
- * Removes extra decorations from the Panel.
- *
- * @deprecated this style is no longer part of the core framework and this
- * component, even though most built-in themes implement this
- * style. Use the constant specified in the theme class file
- * that you're using, if it provides one, e.g.
- * {@link Reindeer#PANEL_LIGHT} or {@link Runo#PANEL_LIGHT} .
- */
- @Deprecated
- public static final String STYLE_LIGHT = "light";
-
/**
* Content of the panel.
*/
private ComponentContainer content;
- /**
- * Scroll X position.
- */
- private int scrollOffsetX = 0;
-
- /**
- * Scroll Y position.
- */
- private int scrollOffsetY = 0;
-
- /**
- * Scrolling mode.
- */
- private boolean scrollable = false;
-
/**
* Keeps track of the Actions added to this component, and manages the
* painting and handling as well.
*/
protected ActionManager actionManager;
- /**
- * By default the Panel is not in the normal document focus flow and can
- * only be focused by using the focus()-method. Change this to 0 if you want
- * to have the Panel in the normal focus flow.
- */
- private int tabIndex = -1;
-
/**
* Creates a new empty panel. A VerticalLayout is used as content.
*/
*/
public Panel(ComponentContainer content) {
setContent(content);
- setWidth(100, UNITS_PERCENTAGE);
+ setWidth(100, Unit.PERCENTAGE);
+ getState().setTabIndex(-1);
}
/**
*/
@Override
public void paintContent(PaintTarget target) throws PaintException {
+ // This is needed for now for paint to be ever run for the child
content.paint(target);
- target.addVariable(this, "tabindex", getTabIndex());
-
- if (isScrollable()) {
- target.addVariable(this, "scrollLeft", getScrollLeft());
- target.addVariable(this, "scrollTop", getScrollTop());
- }
-
if (actionManager != null) {
actionManager.paintActions(null, target);
}
final Integer newScrollY = (Integer) variables.get("scrollTop");
if (newScrollX != null && newScrollX.intValue() != getScrollLeft()) {
// set internally, not to fire request repaint
- scrollOffsetX = newScrollX.intValue();
+ getState().setScrollLeft(newScrollX.intValue());
}
if (newScrollY != null && newScrollY.intValue() != getScrollTop()) {
// set internally, not to fire request repaint
- scrollOffsetY = newScrollY.intValue();
+ getState().setScrollTop(newScrollY.intValue());
}
// Actions
* @see com.vaadin.terminal.Scrollable#setScrollable(boolean)
*/
public int getScrollLeft() {
- return scrollOffsetX;
- }
-
- /**
- * @deprecated use {@link #getScrollLeft()} instead
- */
- @Deprecated
- public int getScrollOffsetX() {
- return getScrollLeft();
+ return getState().getScrollLeft();
}
/*
* @see com.vaadin.terminal.Scrollable#setScrollable(boolean)
*/
public int getScrollTop() {
- return scrollOffsetY;
- }
-
- /**
- * @deprecated use {@link #getScrollTop()} instead
- */
- @Deprecated
- public int getScrollOffsetY() {
- return getScrollTop();
+ return getState().getScrollTop();
}
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Scrollable#setScrollable(boolean)
- */
- public boolean isScrollable() {
- return scrollable;
- }
-
- /**
- * Sets the panel as programmatically scrollable.
- *
- * <p>
- * Panel is by default not scrollable programmatically with
- * {@link #setScrollLeft(int)} and {@link #setScrollTop(int)}, so if you use
- * those methods, you need to enable scrolling with this method. Components
- * that extend Panel may have a different default for the programmatic
- * scrollability.
- * </p>
- *
- * @see com.vaadin.terminal.Scrollable#setScrollable(boolean)
- */
- public void setScrollable(boolean isScrollingEnabled) {
- if (scrollable != isScrollingEnabled) {
- scrollable = isScrollingEnabled;
- requestRepaint();
- }
- }
-
- /**
- * Sets the horizontal scroll position.
- *
- * <p>
- * Setting the horizontal scroll position with this method requires that
- * programmatic scrolling of the component has been enabled. For Panel it is
- * disabled by default, so you have to call {@link #setScrollable(boolean)}.
- * Components extending Panel may have a different default for programmatic
- * scrollability.
- * </p>
- *
* @see com.vaadin.terminal.Scrollable#setScrollLeft(int)
- * @see #setScrollable(boolean)
*/
- public void setScrollLeft(int pixelsScrolled) {
- if (pixelsScrolled < 0) {
+ public void setScrollLeft(int scrollLeft) {
+ if (scrollLeft < 0) {
throw new IllegalArgumentException(
"Scroll offset must be at least 0");
}
- if (scrollOffsetX != pixelsScrolled) {
- scrollOffsetX = pixelsScrolled;
- requestRepaint();
- }
- }
-
- /**
- * @deprecated use setScrollLeft() method instead
- */
- @Deprecated
- public void setScrollOffsetX(int pixels) {
- setScrollLeft(pixels);
+ getState().setScrollLeft(scrollLeft);
+ requestRepaint();
}
- /**
- * Sets the vertical scroll position.
- *
- * <p>
- * Setting the vertical scroll position with this method requires that
- * programmatic scrolling of the component has been enabled. For Panel it is
- * disabled by default, so you have to call {@link #setScrollable(boolean)}.
- * Components extending Panel may have a different default for programmatic
- * scrollability.
- * </p>
+ /*
+ * (non-Javadoc)
*
* @see com.vaadin.terminal.Scrollable#setScrollTop(int)
- * @see #setScrollable(boolean)
*/
- public void setScrollTop(int pixelsScrolledDown) {
- if (pixelsScrolledDown < 0) {
+ public void setScrollTop(int scrollTop) {
+ if (scrollTop < 0) {
throw new IllegalArgumentException(
"Scroll offset must be at least 0");
}
- if (scrollOffsetY != pixelsScrolledDown) {
- scrollOffsetY = pixelsScrolledDown;
- requestRepaint();
- }
- }
-
- /**
- * @deprecated use setScrollTop() method instead
- */
- @Deprecated
- public void setScrollOffsetY(int pixels) {
- setScrollTop(pixels);
+ getState().setScrollTop(scrollTop);
+ requestRepaint();
}
/* Documented in superclass */
* {@inheritDoc}
*/
public int getTabIndex() {
- return tabIndex;
+ return getState().getTabIndex();
}
/**
* {@inheritDoc}
*/
public void setTabIndex(int tabIndex) {
- this.tabIndex = tabIndex;
+ getState().setTabIndex(tabIndex);
requestRepaint();
}
// This is so wrong... (#2924)
return content.getComponentCount();
}
+
+ @Override
+ public PanelState getState() {
+ return (PanelState) super.getState();
+ }
+
+ @Override
+ protected PanelState createState() {
+ return new PanelState();
+ }
}
import com.vaadin.event.ShortcutListener;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.PanelConnector.PanelState;
import com.vaadin.terminal.gwt.client.ui.VView;
import com.vaadin.terminal.gwt.client.ui.WindowConnector;
@ClientWidget(WindowConnector.class)
public class Window extends Panel implements FocusNotifier, BlurNotifier {
+ public class WindowState extends PanelState {
+
+ }
+
/**
* <b>Sub window only</b>. Top offset in pixels for the sub window (relative
* to the parent application window) or -1 if unspecified.
*/
public Window(String caption, ComponentContainer content) {
super(caption, content);
- setScrollable(true);
setSizeUndefined();
}
getLayout().addComponent(panel);
getLayout().setExpandRatio(panel, 1);
- panel.setScrollable(true);
panel.setScrollTop(50);
panel.setScrollLeft(50);
panel.setImmediate(true);
@Override
protected void setup() {
final Panel p = new Panel(new CssLayout());
- p.setScrollable(true);
p.setSizeFull();
p.setHeight("600px");
p.addComponent(foo());
tree.setImmediate(true);
Panel panel = new Panel();
- panel.setScrollable(true);
panel.addComponent(tree);
panel.setWidth("200px");
panel.setHeight("300px");
Panel panel = new Panel("scrollable panel");
panel.setHeight(400, Panel.UNITS_PIXELS);
- panel.setScrollable(true);
panel.setScrollLeft(50);
panel.setScrollTop(50);
panel.getContent().setSizeUndefined();
cb.setImmediate(true);
hidingControls.addComponent(cb);
elhp.setVisible(false);
- elhp.setScrollable(true);
elh.setWidth("2000px");
elh.setHeight("100px");
addFields(elh);
Panel controlWrapper = new Panel();
controlWrapper.addComponent(controls);
controlWrapper.setWidth("100%");
- controlWrapper.setScrollable(true);
controlWrapper.setStyleName("controls");
internalLayout.addComponent(controlWrapper);
Panel testPanel = new Panel(testPanelLayout);
}
private void updateMarginsAndSpacing() {
- testedLayout.setMargin(
- ((Boolean) marginTop.getValue()).booleanValue(),
- ((Boolean) marginRight.getValue()).booleanValue(),
- ((Boolean) marginBottom.getValue()).booleanValue(),
- ((Boolean) marginLeft.getValue()).booleanValue());
+ testedLayout.setMargin(marginTop.getValue().booleanValue(),
+ marginRight.getValue().booleanValue(), marginBottom
+ .getValue().booleanValue(), marginLeft.getValue()
+ .booleanValue());
if (testedLayout instanceof Layout.SpacingHandler) {
- ((Layout.SpacingHandler) testedLayout)
- .setSpacing(((Boolean) spacing.getValue())
- .booleanValue());
+ ((Layout.SpacingHandler) testedLayout).setSpacing(spacing
+ .getValue().booleanValue());
}
}
}
Window w = new Window("Status of the fields");
w.setModal(true);
- w.setScrollable(true);
w.setHeight("80%");
w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
main.addWindow(w);
main.addComponent(b);
p = new Panel("TestPanel");
- p.setScrollable(true);
for (int i = 0; i < ROWS; i++) {
p.addComponent(new Label(
lo.addComponent(elp);
elp.setWidth("300px");
elp.setHeight("300px");
- elp.setScrollable(true);
HorizontalLayout elh = new HorizontalLayout();
Panel elph = new Panel(
lo.addComponent(elph);
elph.setWidth("300px");
elph.setHeight("300px");
- elph.setScrollable(true);
}
}
p = new Panel("TestPanel 250x300");
// p.getLayout().setWidth("100%");
- p.setScrollable(true);
// p.setContent(new GridLayout(1, 100));
for (int i = 0; i < ROWS; i++) {
p.addComponent(new Label(
panel.setSizeFull();
panel.setStyleName(Reindeer.PANEL_LIGHT);
panel.addComponent(hl);
- panel.setScrollable(true);
addComponent(panel);
}