1 | while (it.hasNext()) {↵ | | |
|
2 | String id = it.next();↵ | | 1 | Document doc = retrieveDocument(is);↵
|
|
3 | IComponentInfo c = get(id);↵ | | 2 | Element menubarElement = doc.getRootElement();↵
|
4 | if (c.getType().equals(IComponent.TYPE.EVENT)) {↵ | | 3 | if (menubarElement.getName().equals(↵
|
5 | IEvent event = (IEvent) c;↵ | | |
|
6 | Calendar sd = event.getDtStart();↵ | | |
|
7 | if (startDate.equals(sd))↵ | | |
|
8 | result.add(id);↵ | | |
|
9 | } else if (c↵ | | 4 | MenuXMLDecoder.MENUBAR) == false) {↵
|
| | | 5 | LOG.severe("root element <menubar> expected");↵
|
| | | 6 | return null;↵
|
| | | 7 | }↵
|
|
| | | 8 | ExtendableMenuBar menuBar = new ExtendableMenuBar();↵
|
| | | 9 | Iterator it = menubarElement.getChildren().listIterator();↵
|
| | | 10 | while (it.hasNext()) {↵
|
| | | 11 | Element menuElement = (Element) it.next();↵
|
10 | .getType().equals(IComponent.TYPE.TODO)) {↵ | | 12 | if (menuElement.getName().equals(MenuXMLDecoder.MENU)) {↵
|
|
11 | ITodo todo = (ITodo) c;↵ | | 13 | ↵
|
12 | Calendar sd = todo.getDtStart(↵ | | 14 | String menuId = menuElement↵
|
13 | );↵ | | 15 | .getAttributeValue(MenuXMLDecoder.ID);↵
|
|
14 | Calendar endDate = todo.getDue(↵ | | 16 | String menuName = mediator.getString("menu", "mainframe",↵
|
15 | );↵ | | 17 | menuId);↵
|
|
16 | IDateRange dr = new DateRange(startDate, endDate);↵ | | 18 | ExtendableMenu menu = new ExtendableMenu(menuId, menuName);↵
|
17 | if (startDate.equals(sd))↵ | | 19 | ↵
|
18 | result↵ | | 20 | parseMenu(menu, menuElement);↵
|
19 | .add(id);↵ | | 21 | menuBar.add(menu);↵
|
20 | } else↵ | | 22 | }↵
|
21 | throw new IllegalArgumentException(↵ | | |
|
22 | "unsupported component type " + c.getType());↵ | | |
|
23 | } | | |
|
| | | 23 | }↵
|
|
| | | 24 | return menuBar;
|