Upgrade to Vaadin 7, WidgetsTree stub #PL-1809

This commit is contained in:
Yuriy Artamonov 2013-04-18 08:53:23 +00:00
parent 92b8685e90
commit f48f3c1477
2 changed files with 48 additions and 44 deletions

View File

@ -2,11 +2,6 @@
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Nikolay Gorodnov
* Created: 03.08.2010 17:10:03
*
* $Id$
*/
package com.haulmont.cuba.web.gui.components;
@ -15,26 +10,32 @@ import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.WidgetsTree;
import com.haulmont.cuba.gui.data.HierarchicalDatasource;
import com.haulmont.cuba.web.gui.data.HierarchicalDsWrapper;
import com.haulmont.cuba.web.toolkit.ui.CubaWidgetsTree;
/**
* @author gorodnov
* @version $Id$
*/
public class WebWidgetsTree
/*extends
WebAbstractList<com.haulmont.cuba.web.toolkit.ui.WidgetsTree>
extends
WebAbstractList<CubaWidgetsTree>
implements
WidgetsTree, Component.Wrapper*/
{
/*
WidgetsTree, Component.Wrapper {
private String hierarchyProperty;
public WebWidgetsTree() {
component = new com.haulmont.cuba.web.toolkit.ui.WidgetsTree();
component = new CubaWidgetsTree();
component.setSelectable(false);
component.setImmediate(true);
}
@Override
public String getHierarchyProperty() {
return hierarchyProperty;
}
@Override
public void setDatasource(HierarchicalDatasource datasource) {
this.datasource = datasource;
this.hierarchyProperty = datasource.getHierarchyPropertyName();
@ -43,6 +44,7 @@ public class WebWidgetsTree
component.setContainerDataSource(wrapper);
}
@Override
public void expandTree() {
com.vaadin.data.Container.Hierarchical container =
(com.vaadin.data.Container.Hierarchical) component.getContainerDataSource();
@ -53,6 +55,7 @@ public class WebWidgetsTree
}
}
@Override
public void collapseTree() {
com.vaadin.data.Container.Hierarchical container =
(com.vaadin.data.Container.Hierarchical) component.getContainerDataSource();
@ -63,23 +66,28 @@ public class WebWidgetsTree
}
}
@Override
public boolean isExpanded(Object itemId) {
return component.isExpanded(itemId);
}
@Override
public void expand(Object itemId) {
component.expandItem(itemId);
}
@Override
public void collapse(Object itemId) {
component.collapseItem(itemId);
}
@Override
public void setWidgetBuilder(final WidgetBuilder widgetBuilder) {
if (widgetBuilder != null) {
component.setWidgetBuilder(new com.haulmont.cuba.web.toolkit.ui.WidgetsTree.WidgetBuilder() {
component.setWidgetBuilder(new CubaWidgetsTree.WidgetBuilder() {
@Override
public com.vaadin.ui.Component buildWidget(
com.haulmont.cuba.web.toolkit.ui.WidgetsTree source,
CubaWidgetsTree source,
Object itemId,
boolean leaf
) {
@ -92,19 +100,23 @@ public class WebWidgetsTree
}
}
@Override
public CaptionMode getCaptionMode() {
return null;
}
@Override
public void setCaptionMode(CaptionMode captionMode) {
//do nothing
}
@Override
public String getCaptionProperty() {
return null;
}
@Override
public void setCaptionProperty(String captionProperty) {
//do nothing
}*/
}
}
}

View File

@ -2,30 +2,23 @@
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Nikolay Gorodnov
* Created: 03.08.2010 17:09:11
*
* $Id$
*/
package com.haulmont.cuba.web.toolkit.ui;
//import com.haulmont.cuba.toolkit.gwt.client.ui.VWidgetsTree;
//import com.vaadin.server.PaintException;
//import com.vaadin.server.PaintTarget;
//import com.vaadin.terminal.Resource;
//import com.vaadin.ui.ClientWidget;
import com.vaadin.ui.Component;
import java.io.Serializable;
import java.util.LinkedList;
/**
* @author gorodnov
* @version $Id$
*/
@SuppressWarnings("serial")
//@ClientWidget(VWidgetsTree.class)
public class WidgetsTree extends com.vaadin.ui.Tree {
//
// private WidgetBuilder widgetBuilder;
//
public class CubaWidgetsTree extends com.vaadin.ui.Tree {
private WidgetBuilder widgetBuilder;
// vaadin7
// @Override
// protected void paintItem(
// PaintTarget target,
@ -63,17 +56,16 @@ public class WidgetsTree extends com.vaadin.ui.Tree {
// }
// super.paintItem(target, itemId, selectedKeys, expandedKeys);
// }
//
// public WidgetBuilder getWidgetBuilder() {
// return widgetBuilder;
// }
//
// public void setWidgetBuilder(WidgetBuilder widgetBuilder) {
// this.widgetBuilder = widgetBuilder;
// }
//
// public interface WidgetBuilder extends Serializable {
// Component buildWidget(WidgetsTree source, Object itemId, boolean leaf);
// }
}
public WidgetBuilder getWidgetBuilder() {
return widgetBuilder;
}
public void setWidgetBuilder(WidgetBuilder widgetBuilder) {
this.widgetBuilder = widgetBuilder;
}
public interface WidgetBuilder extends Serializable {
Component buildWidget(CubaWidgetsTree source, Object itemId, boolean leaf);
}
}