1 | protected ViewItem loadDefaultView(String id) {↵ | | 1 | p↵
|
2 | // If defaultViews doesn't exist, create it (backward compatibility)↵ | | |
|
3 | if (defaultViews == null) {↵ | | |
|
4 | XmlElement gui = Config.getInstance().get("views").getElement(↵ | | |
|
5 | "/views↵ | | 2 | ublic final void expand(IMailFolder parent) {↵
|
| | | 3 | // get configuration from tree.xml file↵
|
| | | 4 | IFolderItem item = parent.getConfiguration();↵
|
|
6 | ");↵ | | 5 | XmlElement property = item.getElement("property");↵
|
7 | ↵ | | |
|
8 | defaultViews = new XmlElement("defaultviews↵ | | 6 | if (property != null) {↵
|
9 | ");↵ | | 7 | String expanded = property.getAttribute("expanded");↵
|
|
10 | gui.addElement(defaultViews)↵ | | 8 | if (expanded == null) {↵
|
11 | ;↵ | | 9 | expanded = "true";↵
|
12 | }↵ | | 10 | }↵
|
|
13 | // search through defaultViews to get settings for given id↵ | | 11 | // ↵
|
14 | ViewItem view = null;↵ | | |
|
| | | 12 | expand folder↵
|
| | | 13 | int row = getRowForPath(new TreePath(parent.getPath()));↵
|
|
| | | 14 | if (expanded.equals("true")) {↵
|
| | | 15 | expandRow(row);↵
|
| | | 16 | }↵
|
| | | 17 | }↵
|
|
| | | 18 | // recursivly expand all children↵
|
15 | for (int i = 0; i < defaultViews.count(); i++) {↵ | | 19 | for (int i = 0; i < parent.getChildCount(); i++) {↵
|
16 | XmlElement child = defaultViews.getElement(i);↵ | | 20 | ↵
|
17 | String childId = child.getAttribute("id");↵ | | 21 | IMailFolder child = (IMailFolder) parent.getChildAt(i);↵
|
|
18 | if ((childId != null) && childId.equals(id)) {↵ | | 22 | ↵
|
19 | view = new ViewItem(child);↵ | | |
|
|
20 | break;↵ | | |
|
21 | }↵ | | |
|
22 | }↵ | | |
|
|
23 | return view;↵ | | |
|
| | | 23 | expand(child);↵
|
24 | | | 24 |
|