Developing GUIs with XUL Eitan Suez Programmer

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

1 Web Site Design Overview of the Internet Cookie Setton.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
Cascading Style Sheets
HTML/XML XHTML Authoring. Creating Tables  Table: An arrangement of horizontal rows and vertical columns. The intersection of a row and a column is called.
Introduction to XUL Thuha Nguyen. Overview What is XUL? Benefits of using XUL XUL syntax XUL package XUL elements XUL examples –Menu, menubar –Button.
XUL: XML User Interface Language For: XML Date: April 14 th, 2005 By:David Kleinschmidt Josh Hamell.
XHTML & CSS 2 By Trevor Adams. Last week XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
HTML Hypertext Markup Language –First proposed by CERN in 1989 –It is non-linear so it allows you to jump from place to place –Markup refers to the structure.
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
Chapter 1 Getting Started With Dreamweaver. Explore the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
Introduction to XML: Yong Choi CSU Bakersfield.
Introduction to XML This material is based heavily on the tutorial by the same name at
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
XP Tutorial 5New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Computer Sciences Department
 Using Microsoft Expression Web you can: › Create Web pages and Web sites › Set what you site will look like as you design it › Add text, images, multimedia.
Creating a Simple Page: HTML Overview
Creating a Basic Web Page
Getting Started with Expression Web 3
CO1552 – Web Application Development Lists, Special Characters, and Tables.
Lesson 4: Using HTML5 Markup.  The distinguishing characteristics of HTML5 syntax  The new HTML5 sectioning elements  Adding support for HTML5 elements.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Creating a PowerPoint Presentation
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
Copyright © 2013 MyGraphicsLab / Pearson Education STRUCTURE AND HTML TAGS MyGraphicsLab: Adobe Dreamweaver CS6 ACA Certification Preparation for Web Communication.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Introduction to XML Extensible Markup Language. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
CREATING A POWERPOINT PRESENTATION. Planning a presentation Create a presentation Rearrange and delete text and slides Add animations Add transitions.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Chapter 5: Windows and Frames
XHTML By Trevor Adams. Topics Covered XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Chapter 1 Getting Started With Dreamweaver. Exploring the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
Advanced Topics Lecture 8 Rachel A Ober
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
HTML HYPER TEXT MARKUP LANGUAGE. INTRODUCTION Normal text” surrounded by bracketed tags that tell browsers how to display web pages Pages end with “.htm”
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
Positioning Objects with CSS and Tables
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
DLSLUG Presentation: Firefox extensions. DLSLUG Presentation: Firefox extensions, Roger Trussell ● My address is
© 2004 The McGraw-Hill Companies, Inc. All rights reserved. The Advantage Series Microsoft Office Word 2003 CHAPTER 4 Printing and Web Publishing.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
Unit 4 Representing Web Data: XML
Working with Tables: Module A: Table Basics
Chapter 1: An Introduction to Visual Basic 2015
Building a User Interface with Forms
W3C Web standards and Recommendations
Chapter 7 Representing Web Data: XML
Tutorial 3 Working with Cascading Style Sheets
Using Templates and Library Items
Presentation transcript:

Developing GUIs with XUL Eitan Suez Programmer

Developing GUIs with XUL2 Purpose To Get Acquainted with XUL Learn what it is, what can one do with it, what's it good for, and how to use it

Developing GUIs with XUL3 About the Speaker Eitan Suez is a Java Programmer living and working in Austin, Texas Recently took up interest in XUL Enjoy attending and participating in Austin JUG and XML Austin activities Pet project is Ashkelon (on sourceforge at sf.net/projects/ashkelon), a Java Documentation Management System

Developing GUIs with XUL4 Agenda Overview Why XUL? Mini-Tutorial Overlays & XBL Dev Tools in Mozilla XUL Implementations Analysis, Resources, & Summary

Developing GUIs with XUL5 XUL Defined An XML Application for describing user interfaces A technology produced by the Mozilla project and supported in the Mozilla browser Richness of widgets at par with Swing and other windowing toolkits A relative of (and sometimes substitute for) xhtml

Developing GUIs with XUL6 Is XUL a Standard? Not an official standard A XUL Spec is available at but it doesn't appear to be complete No official DTD or Schema! Has a namespace..

Developing GUIs with XUL7 Agenda Overview  Why XUL? Mini-Tutorial Overlays & XBL Dev Tools in Mozilla XUL Implementations Analysis, Resources, & Summary

Developing GUIs with XUL8 Why use XUL? Is there a problem that XUL solves? Existing GUI Frameworks fall into two camps: Programming Frameworks (Swing, SWT, AWT, MFC, etc..) Web (HTML, CSS, DHTML, JavaScript) It turns out that XUL falls almost directly in the middle dhtmlswingxul imaginary line

Developing GUIs with XUL9 Frameworks (Swing, etc..) Require skill and experience Take longer to develop (compared to markup-based ui's) Code that lays out a page can become difficult to read quickly, hard to maintain..

Developing GUIs with XUL10 Interesting Comparison to Swing XUL version: <menuitem action="newApplication" label="New Application..." mnemonic="A" accel="control A" icon="newApplication" /> Java version: JMenuItem mi = new JMenuItem( "New Application..." ); mi.addActionListener( cmdNewApplication ); mi.setMnemonic( 'A' ); mi.setAccelerator( KeyStroke.getKeystroke( "control A" ) ); mi.setIcon( new ImageIcon( "images/newApplication.gif" ) ); (taken from luxor page)

Developing GUIs with XUL11 More on Swing.. Swing programmers naturally gravitate to externalizing information to a resource. This resource is typically loaded and bound to a widget such as a menu on startup. This design method in some way validates the XUL approach In XUL (and markup in general), the containment relationships between elements are more apparent because they're reflected in the natural form of representing the UI in the first place. In Swing, it's not so apparent (a series of method calls, one must read the semantics of the calls to understand the containment)

Developing GUIs with XUL12 Web (DHTML, etc..) Rapid Development GUI is not as rich Need to be careful to avoid JavaScript "code- creep" Requires discipline to keep clean and organized

Developing GUIs with XUL13 XUL Value Proposition Combine the best of both worlds: Use markup to define a GUI (like xhtml) Markup language provides access to many rich widgets, at par with programmatic frameworks Abandons HTML page-based layout Can this combination provide rapid development, rich GUIs, and maintainable, easily modifiable front-ends?

Developing GUIs with XUL14 XUL Value Proposition Quality of GUI Componentry Rich Poor Easy (markup) Hard (code) XUL Swing HTML MFC

Developing GUIs with XUL15 Agenda Overview Why XUL?  Mini-Tutorial Overlays & XBL Dev Tools in Mozilla XUL Implementations Analysis, Resources, & Summary

Developing GUIs with XUL16 XUL Tutorial Hello XUL Understanding Layout Boxes, Containers, and more Widgets Buttons, Toolbars, StatusBars, Lists More Widgets.. Grids, Tabbed Panes, Buttons

Developing GUIs with XUL17 Hello XUL <window xmlns=" xmlns:html=" title="Hello XUL"> Hello XUL produces..

Developing GUIs with XUL18 Representing Text Several ways.. some text all three are equivalent

Developing GUIs with XUL19 Layout, General Principles Page-based metaphor abandoned! Goal is similar to Java AWT Layout Managers in that location of elements is not fixed, but adapts to the size of the containing window Main container tag is the "Box" Two main types of boxes hbox, vbox Many specialized boxes: groupbox, listbox, tabbox, tabbox, toolbox

Developing GUIs with XUL20 Layout, Practice Basic Usage: hello world hbox is equivalent to: vbox is equivalent to: box's default orientation is "horizontal" So basically you never use box Boxes are nested inside each other to produce more complex layouts.

Developing GUIs with XUL21 Layout, more than meets the eye To be able to layout UIs in XUL, you really have to understand all of these container attributes: orient flex align pack And sometimes these help: spacer CSS min-width, min-height, max-width, and max-height

Developing GUIs with XUL22 Layout Rules 1.positioning of child elements within a box are controlled by the box, using pack and align attributes 2.whether a box expands to occupy the entire space of its container is controlled via flex and align 3.the meaning of these attributes are all relative to orientation. this is very confusing. the fact that align doubles for positioning and expansion doesn't help make things clearer 4.for a horizontally-oriented container, align controls vertical position and pack controls horizontal position (& vice versa) 5.for a horizontally-oriented container, align controls expansion vertically, while flex controls expansion horizontally 6.So, the rule is: pack and flex go along the grain, while align goes against the grain. 7.while orient, pack, and align are specified in a container and apply to children, flex is specified in the child and applies to the child itself

Developing GUIs with XUL23 Layout Rules, illustrated 1.valid values for align and pack are: start, center, end 2.additional valid value for align: stretch 3.flex is either not specified or specified with a value of 1 <window xmlns=" xmlns:html=" title="Basic Layout" orient="vertical" align="center" pack="center"> <box orient="vertical" flex="1"> Hello XUL Basic Layout

Developing GUIs with XUL24 A typical layout.. let's practice by building a typical gui layout together..

Developing GUIs with XUL25 Layout, one last comment..  If contents of a box exceed the box's size, the box will not automatically scroll!  Fortunately, it's pretty easily rectified using CSS:

Developing GUIs with XUL26 Building the Header  Images  Toolboxes  Commands

Developing GUIs with XUL27 Building the Header <description style="font-size: 24pt; color: darkgreen;" value=" Eitan's XUL UI" />

Developing GUIs with XUL28 Adding a statusbar in the footer.. <statusbarpanel id="main-status" label="Welcome to my XUL talk.." flex="1"/> <statusbarpanel id="copyright" style="font-style: italic;" label="© Copyright Eitan 2003" />  A statusbarpanel is simply a message area (it doesn't do much else).  It inherits the look and feel of the current 'skin'

Developing GUIs with XUL29 Sidebar - A ListBox - multi-column capable - stylabe, as are all XUL widgets

Developing GUIs with XUL30 Sidebar - A ListBox

Developing GUIs with XUL31 Attacking the Body: Tabbed Panes  Very simple to implement & use  legible, clear, maintanable  compare this to the kludges we usually implement in dhtml :-)

Developing GUIs with XUL32 Tabbed Panes: The Markup.. je ne sais pas quois inventer <tabpanel style="background-color: white; border: thin solid black;" align="end" pack="center"> coucou

Developing GUIs with XUL33 Grids  Useful for lining things up, like captions and form elements

Developing GUIs with XUL34 Grid markup..

Developing GUIs with XUL35 Buttons  Very rich, varied, and versatile..  And they look so much nicer in Camino!

Developing GUIs with XUL36 Buttons Sampler A Simple Button?

Developing GUIs with XUL37 Agenda Overview Why XUL? Mini-Tutorial  Overlays & XBL Dev Tools in Mozilla XUL Implementations Analysis, Resources, & Summary

Developing GUIs with XUL38 Overlays  Basically a fancy name for an tag  Well designed and thought through  May not work unless working with a locally installed chrome application  How it works:  included page is just like any other page except that top level element is replaced with an element.  overlay may include more than one item to include. label each item with an id attribute so it can be referenced from the containing page  in containing page, must include processing instruction  somewhere in the page, include something by referencing its id in an empty element. mozilla does the rest.

Developing GUIs with XUL39 XBL  A mechanism for writing custom widgets using any combination of javascript, xhtml, xul, css, etc.. you wish to use  similar to microsoft's element behaviors (htc's) but open  a powerful client-side taglib-like mechanism  basically, you can define your own tags and use them in a xul page, after having bound their definition to a specific binding file  the B in XBL stands for Binding  Let's look at a very simple example..

Developing GUIs with XUL40 Simple XBL Example  Need three things:  A binding file that defines the widget  A file that uses the widget  Some way to bind them

Developing GUIs with XUL41 The Binding File <xbl:bindings id="mybindings" xmlns=" xmlns:html=" xmlns:xbl="

Developing GUIs with XUL42 Usage <window xmlns=" xmlns:html=" title=""> This is My Test Another fancy title

Developing GUIs with XUL43 Binding specified in CSS.. fancytitle { -moz-binding: url('bindings.xbl#fancytitle'); }

Developing GUIs with XUL44 XBL Possibilities  Widgets can inherit features and behavior from existing widget (using inherits attribute)  Stylesheets can either be inherited from containing document or they can be referenced as a resource in the binding file  Behavior of widget can be specified in an section. Methods can be defined that belong to the widget and can be called from javascript in the containing document

Developing GUIs with XUL45 Agenda Overview Why XUL? Mini-Tutorial Overlays & XBL  Dev Tools in Mozilla XUL Implementations Analysis, Resources, & Summary

Developing GUIs with XUL46 Developer Tools & Aides in Mozilla  Ability to add debug="true" attribute to any container to get Mozilla draw borders around it and its children; very helpful with layout  DOM Inspector is way cool  JavaScript debugger (called 'venkman') (i personally have yet to gain experience with it)  Availability of methods such as dump() for outputing debug statements to stdout  Other nifty things like XULKit for deploying chrome apps (i have not used this) and a JavaScript shell to try out various XPCOM interfaces

Developing GUIs with XUL47 JavaScript Miscellany  A good idea to wrap your javascript code in CDATA sections to avoid inequality operators to be mistaken for tag openers & closers: <![CDATA[ function sayHi() { alert('hi'); } ]]>  An even better idea to reference a separate javascript source file as in:

Developing GUIs with XUL48 Agenda Overview Why XUL? Mini-Tutorial Overlays & XBL Dev Tools in Mozilla  XUL Implementations Analysis, Resources, & Summary

Developing GUIs with XUL49 XUL Implementations Mozilla Maker Main implementation, most robust Luxor XUL Engine implemented using Java Swing Fairly new project, one main developer (Gerald Bauer) Very promising

Developing GUIs with XUL50 Agenda Overview Why XUL? Mini-Tutorial Overlays & XBL Dev Tools in Mozilla XUL Implementations  Analysis, Resources, & Summary

Developing GUIs with XUL51 Should I Adopt XUL? Advantages: Cross-Platform (with minor caveats) Rapid Development Rich Getting standardized Already familiar with CSS, JavaScript, DOM Disadvantages: Although relatively mature, far from pervasive Not fully standardized Most folks have little to no previous experience with XUL

Developing GUIs with XUL52 Analysis Very innovative technology, holds much promise Not just another spec, can start building right away Produces clean, readable, maintainable front-ends In many ways, leapfrogs internet explorer in abilities Evolutionary, not revolutionary

Developing GUIs with XUL53 Issues No equivalent to html element. it would be really cool if mozilla sported xul+xforms support (probably just a matter of time) Databinding with RDF is not easy to grasp Designed with too much emphasis on locally-installed apps. I think the real value is in delivering apps remotely A number of features do not work unless application is locally installed. Not clear for example why XBL reserved to local apps Need better documentation & a schema Setting up xul apps as local apps accessible via the chrome: requires some setup (XULKit), can't refresh xul pages from local apps, must quit & restart browser

Developing GUIs with XUL54 Things I did not talk about Data binding with RDF (practically a topic in itself) XPCOM Interfaces The mechanics of locally installed apps (chrome) Localization (DTD Entities and Stringbundles) CSS (really a topic in itself)

Developing GUIs with XUL55 Resources a terrific xul tutorial + xul reference complements the o'reilly mozilla book nicely xul doc page on mozilla.org (includes a number of links to various articles on xul too) luxor's home page on sourceforge. promising alternative platform, though not nearly as far along as mozilla (can't really blame him) the xml they show definitely is not xul but for all practical purposes it's the same idea; their demo is interesting The Book: Mozilla, published by O'Reilly Not strictly related to XUL, but for MacOS X fans, you should check out Camino (formerly known as Chimera) at