Преглед на файлове

#5890 Added getComponentCount to ComponentContainer

tags/7.0.0.alpha2
Artur Signell преди 12 години
родител
ревизия
016f5997ab
променени са 3 файла, в които са добавени 31 реда и са изтрити 0 реда
  1. 8
    0
      src/com/vaadin/ui/ComponentContainer.java
  2. 9
    0
      src/com/vaadin/ui/Panel.java
  3. 14
    0
      src/com/vaadin/ui/Root.java

+ 8
- 0
src/com/vaadin/ui/ComponentContainer.java Целия файл

@@ -69,6 +69,14 @@ public interface ComponentContainer extends Component {
*/
public Iterator<Component> getComponentIterator();

/**
* Gets the number of children this {@link ComponentContainer} has. This
* must be symmetric with what {@link #getComponentIterator()} returns.
*
* @return The number of child components this container has.
*/
public int getComponentCount();

/**
* Causes a repaint of this component, and all components below it.
*

+ 9
- 0
src/com/vaadin/ui/Panel.java Целия файл

@@ -661,4 +661,13 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
super.focus();
}

/*
* (non-Javadoc)
*
* @see com.vaadin.ui.ComponentContainer#getComponentCount()
*/
public int getComponentCount() {
// This is so wrong... (#2924)
return content.getComponentCount();
}
}

+ 14
- 0
src/com/vaadin/ui/Root.java Целия файл

@@ -632,10 +632,24 @@ public abstract class Root extends AbstractComponentContainer implements
}
}

/*
* (non-Javadoc)
*
* @see com.vaadin.ui.ComponentContainer#getComponentIterator()
*/
public Iterator<Component> getComponentIterator() {
return Collections.singleton((Component) getContent()).iterator();
}

/*
* (non-Javadoc)
*
* @see com.vaadin.ui.ComponentContainer#getComponentCount()
*/
public int getComponentCount() {
return getContent() == null ? 0 : 1;
}

/**
* Sets the application to which this root is assigned. It is not legal to
* change the application once it has been set nor to set a

Loading…
Отказ
Запис