public boolean selectFile(int index) { if (_resources != null) { try { _file = (Element) _resources.getChildren("file", _dom.getNamespace()).get(index); _isNewFile = false; return true; } catch (Exception e) { return false; } } else return false; }
public void fillFiles(Table table) { table.removeAll(); int index = 0; if (_resources != null) { for (Iterator it = _resources.getChildren("file", _dom.getNamespace()).iterator(); it.hasNext(); ) { Element file = (Element) it.next(); TableItem item = new TableItem(table, SWT.NONE); item.setText(0, Utils.getAttributeValue("file", file)); item.setText(1, Utils.getAttributeValue("os", file)); item.setText(2, Utils.getAttributeValue("type", file)); item.setText(3, Utils.getAttributeValue("id", file)); if (file.equals(_file)) table.select(index); index++; } } }
public FilesListener(DocumentationDom dom, Element parent) { _dom = dom; _parent = parent; _resources = _parent.getChild("resources", _dom.getNamespace()); }
public void setNewFile() { _file = new Element("file", _dom.getNamespace()); Utils.setAttribute("os", _platforms[0], _file); Utils.setAttribute("type", _types[0], _file); _isNewFile = true; }