ArcBees/GWTP — pull request #576 by rdwallis (2014-09-15 17:28:54+00:00)
Title: Tslots2

### Upgrading

`@ContentSlot Type> CONTENT_SLOT = new Type>();`
becomes
`ContentSlot> CONTENT_SLOT = new ContentSlot>();`

`Object SLOT = new Object();`
becomes
`Slot SLOT = new Slot();`

---

### View Binding

You can replace all setInSlot, removeFromSlot & addToSlot if then else statements by calling ->

`bindSlot(SLOT, widget)` in your view's constructor. `widget` must extend `HasWidgets` which all stock gwt widgets do already.

---

### Slot Types

All Slots are type safe. So if only one kind of Presenter will go in a slot you can declare `Slot`. Or `Slot>` if lots of different presenters can be put in the slot.

* **SingleSlot** - Slot that can take only one presenter. Can call getChild(slot) to see what's in the slot.

* **PermanentSlot** - Same as singleslot but once a presenter goes in it can never be removed. Means that getChild(slot) will never be null.

* **ContentSlot** - Replaces the old ContentSlot annotation and is a kind of SingleSlot but can only take Presenters that have Proxies.

* **Slot** - The most permissive slot, use it like you've always used slots. Can call getChildren(slot) to see which presenters it currently contains.

* **OrderedSlot** - Like Slot except the presenters you put in it must be comparable. The view will automatically put them in order for you but you can only bind them to an IndexedPanel. getChildren(slot) returns the presenters the slot contains in order.

* **PopupSlot** - You can still use addToPopupSlot if you like but this allows you to also call getChildren(slot) if you want to see what's in your popup slot.