diff options
author | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2007-10-08 10:29:16 +0000 |
---|---|---|
committer | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2007-10-08 10:29:16 +0000 |
commit | 70c02ffa756f1e38332cd306d31683f55bf13839 (patch) | |
tree | dd953a4143171273100255c9d7475d425fb39dd7 /src/com/itmill/toolkit/ui/Select.java | |
parent | 44ec155f7c5e20890c5f6292ab42af944e9c2950 (diff) | |
download | vaadin-framework-70c02ffa756f1e38332cd306d31683f55bf13839.tar.gz vaadin-framework-70c02ffa756f1e38332cd306d31683f55bf13839.zip |
-WidgetSet naming change: "paging"-style table should now be IPagingTable.java.
-FilterSelect styles 60% done.
-Panel sizing (iLayout) refactored (again).
-Tabsheet sizing now done before content rendering.
-Util.isIE refactored to isIE6.
-ExpandLayout(int orientation) constructor added.
-API change: Select now has setColumns().
svn changeset:2454/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/Select.java')
-rw-r--r-- | src/com/itmill/toolkit/ui/Select.java | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/com/itmill/toolkit/ui/Select.java b/src/com/itmill/toolkit/ui/Select.java index e49002e8a0..c0ebf98492 100644 --- a/src/com/itmill/toolkit/ui/Select.java +++ b/src/com/itmill/toolkit/ui/Select.java @@ -28,35 +28,23 @@ package com.itmill.toolkit.ui; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.Charset; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Set; -import com.itmill.toolkit.Application; import com.itmill.toolkit.data.Container; import com.itmill.toolkit.data.Item; import com.itmill.toolkit.data.Property; import com.itmill.toolkit.data.util.IndexedContainer; -import com.itmill.toolkit.terminal.DownloadStream; import com.itmill.toolkit.terminal.KeyMapper; import com.itmill.toolkit.terminal.PaintException; import com.itmill.toolkit.terminal.PaintTarget; import com.itmill.toolkit.terminal.Resource; -import com.itmill.toolkit.terminal.URIHandler; import com.itmill.toolkit.ui.select.OptionFilter; import com.itmill.toolkit.ui.select.StartsWithFilter; @@ -214,6 +202,12 @@ public class Select extends AbstractField implements Container, private String filterstring; + /** + * How many visible columns (~characters) does select occupy visually. + * Used to size select appropriately. Minus one sets to 100% width. + */ + private int columns = -1; + /* Constructors ********************************************************* */ /** @@ -284,6 +278,8 @@ public class Select extends AbstractField implements Container, target.addAttribute("selectmode", "multi"); if (isNewItemsAllowed()) target.addAttribute("allownewitem", true); + if (getColumns() > -1) + target.addAttribute("cols", getColumns()); // Constructs selected keys array String[] selectedKeys; @@ -1504,4 +1500,18 @@ public class Select extends AbstractField implements Container, return optionFilter; } + /** + * Set visible columns. + */ + public void setColumns(int cols) { + this.columns = cols; + } + + /** + * Get visible columns. + */ + public int getColumns() { + return this.columns; + } + } |