Creating Applications with Mozilla-Chapter 3. XUL Elements and Features- P3

Tham khảo tài liệu 'creating applications with mozilla-chapter 3. xul elements and features- p3', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 3. XUL Elements and Features- P3 Figure 3-5. Multilevel tree hierarchy . Using trees in XUL templates XUL templates are special built-in structures that allow dynamic updating of XUL elements and that are often used with trees and list boxes. Templates harness the power of the Resource Description Framework RDF to pull data from external datasources and dynamically create or update content in the UI. The following code extract shows the basic structure of a XUL template for displaying the browser history in Mozilla template rule treechildren treeitem uri rdf rdf type rdf http 1999 02 22-rdf-syntax- ns type treerow treecell label rdf http NC-rdf Name treecell label rdf http NC-rdf URL treecell label rdf http NC-rdf Date -- further cells -- treerow treeitem treechildren rule template For each entry or row in the browser history the template extracts information from the datasource and renders it in a treecell. It then updates it each time a page is visited. For a more detailed discussion refer to Chapter 9. . Custom tree views Custom views extend upon the static presentation of data in a tree with more flexibility different ways to present the same data and interfaces for defining behavior related to content. The functions include intercepting a treeitem selection and carrying out some functionality populating or getting values from the tree and returning the number of rows currently in the tree. The first thing you have to do to build a custom view is instantiate your tree and then associate a view object with it commonly known as a view. main-tree . mainView In this example the view that is exposed in the nsITreeView XPCOM object is essentially the lifeline for the tree supplying the data that populates the view. The view is assigned to the code object that contains all the functions available to it and your implementation of what you .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.