SYSTEM AND METHOD FOR CREATING A GRAPHICAL USER INTERFACE FROM A FILTER EXPRESSION TREE

Abstract: A system and method for creating a graphical user interface from a filter expression tree. An application program may create a filter expression tree representing a filter expression, e.g. for filtering text searches, email messages, etc. Each leaf node of the filter expression tree may comprise information that specifies an "expression unit", which may include an attribute, a comparison operator, and a value. The expression units specified by the filter expression tree leaf nodes may be logically connected to each other via Boolean operators specified by the non-leaf nodes of the filter expression tree. The filter expression tree may then be processed, in order to automatically create a graphical user interface for the filter expression. Given the tree root node, the child nodes may be recursively processed, until leaf nodes are reached. For each leaf node, user interface components corresponding to the three portions of the expression unit may be created and positioned on a hierarchy of user interface containers. Information referencing the user interface components may be stored in the filter expression tree as the graphical user interface is created, and the application may interact with the graphical user interface by retrieving this information.

Description: TITLE: SYSTEM AND METHOD FOR CREATING A GRAPHICAL USER INTERFACE FROM A FILTER EXPRESSION TREE BACKGROUND OF THE INVENTION 1 Field of the Invention The present invention relates to the fields of small footpπnt devices and graphical user interfaces (GUIs), and more particularly to a system and method for efficiently creatmg a graphical user interface from a filter expression tree 2. Description of the Related Art Graphical user interfaces (GUIs) enable users to interact with software applications m an intuitive manner, utilizing graphical components or controls, such as buttons, mput text fields, menus, etc Although graphical user interfaces are often associated with software applications that run on general computing devices, such as desktop computers. GUIs are becommg more common in other types of computing devices, such as small footpπnt devices. The field of "smart" small footprint devices is growmg and changmg rapidly. Small footprmt devices include handheld computers, personal data assistants (PDAs), cellular phones, global positioning system (GPS) receivers, game consoles, set-top boxes, and many more such devices. Small footpπnt devices are becoming mcreasmgly powerful and enabled to run software applications or services historically associated with general computmg devices, such as desktop computers For example, many small footprmt devices are now able to run web browser applications As small footprmt devices have become more powerful and the software applications running on small footprmt devices have become more complex, it has become mcreasmgly desirable to enable users to easily interact with the applications through graphical user interfaces However, small footprmt devices may have very strong resource constraints, such as the amount of memory and the processing power available. Thus, it is often necessary or desirable to design specialized GUI code for software that runs m the environment of a small footprmt device. The source code to create graphical user interfaces for various portions of a software application often represents a significant portion of the code base for an application. GUI creation may involve performing such procedural operations as creatmg user interface components or controls, setting vaπous attributes of the user interface components as desired, positioning the user interface components appropπately, etc. The resulting source code may compnse a long succession of function calls or other programmatic operations. For example, the process of positioning the user interface components may require many function calls to obtam the sizes of vaπous aspects of the user mterface components, interspersed with code to perform positioning logic, such as setting vanable values to the values of component widths or heights, etc In a resource-constrained environment, such as a small footpπnt device, it is often desirable to reduce code size, e g., in order to reduce the memory requirements to run a software application. One aspect of code size that may be possible to reduce is the size of the code for GUI creation Instead of wπtmg customized source code as descnbed above for creatmg particular GUIs, it may be possible to provide a general method for GUI creation that may be used to automatically create certain GUIs Of course, in order to create GUIs m such a systematic manner, certain regulaπties must be identified m the GUIs to be created One type of GUI that lends itself well to such systematic creation is a GUI for specifymg a filter expression Application programs provide filter expression GUIs to enable users to specify certain cπteπa that should be met when performmg an operation For example, an email application may provide a filter expression GUI for specifymg cπtena of email messages to block As a simple example, such a GUI may enable a user to specify that email messages with a subject field containing a particular phrase or a sender field containing a particular name should be blocked or automatically moved to a trash folder Applications may utilize filter expression GUIs for any of vaπous other purposes For example, a word processor application may provide a filter expression GUI enabling a user to specify various document cπteπa to meet when performmg a text search As another example, applications that search databases may provide a GUI for specifying a filter expression to use when performmg a database search or query For example, an application for lookmg up telephone number information from a database may provide a GUI for specifymg cπteπa regarding the telephone numbers to obtain and display Many types of filter expression GUIs share certain aspects m common For example, the GUIs for both the message-blockmg example and the text search example given above may include user interface components used to create Boolean expressions, together with user mterface components for specifymg terms Instead of a long senes of statements coded by a programmer to create user interface components, position the components, etc , it may be possible to automatically create a filter expression GUI usmg a systematic method If an application utilizes multiple filter expression GUIs, each of these GUIs may be created usmg common code, which may reduce the size of the application For example, in addition to the message-blockmg filter expression GUI discussed above, an email application may also provide users with a filter expression GUI for performmg email message searches In this example, both of the filter expression GUIs may be created usmg common source code SUMMARY OF THE INVENTION The problems outlined above may in large part be solved by a system and method for creatmg a graphical user interface from a filter expression tree, as descnbed herem Filter expressions may be used for any of vaπous purposes by application programs An application program may create a filter expression tree representing a filter expression e g , by parsmg stored information regarding the filter expression and usmg the information to create a tree structure with nodes compnsmg information specifymg vanous aspects of the filter expression Leaf nodes of the filter expression tree may compπse information that specifies an attπbute, a compaπson operator, and a value For example, an email application may create a filter expression tree with a leaf node of "sender contains 'John Doe'", where "sender" is the attπbute, "contains" is the companson operator, and "John Doe" is the value The attribute, comparison operator, and value associated with a leaf node are together referred to as an "expression unit" Non-leaf nodes of the filter expression tree may comprise information that specifies a Boolean operator, such as "AND", "OR", "XOR", "NOT", etc These Boolean operators may logically connect the expression units specified by the leaf nodes, in order to form a complete filter expression The child node(s) of a non-leaf node may either be a leaf node specifying an expression unit or another non-leaf node Thus, each non-leaf node other than the root node may be seen as a root of a sub-tree specifymg a sub-expression of the filter expression The filter expression tree may then be processed, m order to automatically create a graphical user mterface (GUI) for the filter expression The GUI may compnse sets of user mterface components or controls, such as text field components/controls, selection components/controls, etc , where each set corresponds to an expression unit included m the filter expression tree Each user mterface component/control m the set may enable a user to specify mformation regardmg a portion of the expression unit. For example, a GUI may mclude a set of user mterface (UI) components with a first UI component enablmg a user to select an attnbute, a second UI component enablmg a user to select a compaπson operator appropriate for the attnbute, and a third UI component enablmg a user to select a value appropnate for the attπbute Given the tree root node, the child nodes may be recursively traversed, addmg sets of user mterface components/controls representmg expression umts to the GUI as tree leaf nodes are reached The UI components/controls for each expression unit may be mitialized to appropnate values corresponding to the expression unit information For example, for the "sender contams 'John Doe'" expression unit given above, the attnbute UI component may be a selection UI component enablmg a user to select from among entnes such as "sender", "subject", "date", etc , and the selection UI component may be mitialized so that the "sender" entry is selected The user mterface components/controls may be added to a user mterface "contamer", l e., a user mterface structure or object, such as a user mterface panel or wmdow, that is able to host user mterface components/controls As the UI components/controls are added to the UI contamer, the UI components/controls may be positioned in any way desirable, e g., horizontally beginning with an attnbute UI component on the left, a companson operator UI component in the middle, and a value UI component on the πght A hierarchy of UI contamers may be created That is, as each tree leaf node is processed, a separate UI contamer for hostmg the UI components/controls representmg the leaf node's expression unit may be created and added to a parent UI contamer Creatmg a separate UI contamer for a node in this way may simplify the creation of the GUI by enablmg the UI components/controls to be positioned on a UI contamer independently of where the node lies the filter expression tree However, in an alternative embodiment, a smgle UI contamer may be used to host UI components/controls for the vaπous nodes, and positioning offset mformation may be kept track of as the tree is traversed, enabling the UI components/controls to be positioned appropπately As each non-leaf node of the filter expression tree is reached dunng traversal of the tree, a selection UI component or control enablmg the user to select a Boolean operator may be added to the GUI This selection UI component control may be mitialized so that an entry conespondmg to the Boolean operator mformation specified by the non-leaf node is selected Similarly as discussed above, this selection UI component/control may be added to its own separate UI contamer, or a smgle UI contamer may be used Information referencmg the user mterface components may be stored in the filter expression tree as the graphical user mterface is created Once the GUI has been created, the application may interact with the graphical user mterface by retπevmg this mformation BRIEF DESCRIPTION OF THE DRAWINGS Other objects and advantages of the invention will become apparent upon readmg the followmg detailed descπption and upon reference to the accompanymg drawmgs m which Figure 1 is a block diagram illustrating one embodiment of a system supporting the creation of a graphical user mterface from a filter expression tree, Figure 2 is a diagram illustrating an example of a filter expression tree, Figure 3 illustrates an exemplary GUI created from a filter expression tree, Figure 4 is a flowchart diagram illustrating one embodiment of a method for systematically creating a GUI from a filter expression tree, Figure 5 is a flowchart diagram illustrating one embodiment of a process for determining whether a filter expression tree node has child nodes, and Figures 6A - 6B are a flowchart diagram illustrating one embodiment of a process for creatmg graphical user mterface elements representmg an expression unit of a filter expression tree While the invention is susceptible to vanous modifications and alternative forms, specific embodiments thereof are shown by way of example m the drawmgs and will be descnbed herem in detail It should be understood, however, that the drawings and detailed descπption thereto are not mtended to limit the mvention to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the present invention as defined by the appended claims DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Figure 1 - Exemplary System Figure 1 is a block diagram illustrating one embodiment of a system 720 supporting the creation of a graphical user mterface (GUI) from a filter expression tree The system 720 may be employed in any of vaπous types of computing devices, such as desktop computers or workstations, small footpnnt devices, etc As shown m Figure 1, the system 720 may mclude a processor 710 The processor 710 may be any of vanous types, including an x86 processor, e g , a Pentium class, a PowerPC processor, a CPU from the SPARC family of RISC processors, as well as others In various embodiments, such as an embodiment in which the system 720 illustrates a small footprint device, the processor 710 may be a less powerful processor than those listed above or may be a processor developed specifically for a small footpπnt device, such as a digital signal processor (DSP) The processor 710 may have various clock speeds including clock speeds similar to those found in desktop computer-class processors, as well as lower speeds such as 16 MHz The system 720 also includes a memory 712 coupled to the processor 710 The memory 712 may compnse any of vanous types of memory, including DRAM, SRAM, EDO RAM, etc , or a non-volatile memory such as a magnetic media, e g , a hard drive, or optical storage The memory 712 may comprise other types of memory as well, or combinations thereof For an embodiment in which the system 720 illustrates a small footprmt device, the memory 712 may have a very small storage capacity compared to a typical desktop computer system As shown m Figure 1, the memory 712 may store an application program 718 The application program 718 may be any of vanous types of application programs that utilize filter expressions For example, the application program 718 may be an email application that utilizes filter expressions to block or search through email messages, the application program 718 may be a word processor program that utilizes a filter expression to perform document searches, the application 718 may be an application operable to search or query a database usmg criteria specified by a filter expression, etc The application program may be configured to automatically create a graphical user mterface from a tree representmg a filter expression, as described below As shown m Figure 1, the system 720 may also compnse a display 716 The display 716 may be any of vanous types, such as an LCD (liquid crystal display), a CRT (cathode ray tube) display, etc It is noted that the display for a typical small footpnnt device, such as a smart cellular phone, may be small compared to the display of a desktop computer system Figure 1 illustrates a GUI 722 displayed on the display 716 The GUI 722 may be a GUI created from a filter expression tree in accordance with the present mvention The processor 710 executing code and data from the memory 712 provides a means for generating and displaying the GUI As shown m Figure 1, the system 720 may also compπse an mput mechamsm 714 The mput mechamsm 714 may be any of vaπous types, as appropnate for a particular system For example, the mput mechamsm may be a keyboard, mouse, trackball, touch pen, microphone, modem, mfrared receiver, etc As noted above, in various embodiments, the system 720 may be illustrative of a small footpnnt device As used herein, a small footprmt device is a hardware device comprising computmg resources such as a processor and a system memory, but havmg significantly greater constraints on one or more of these resources than a typical desktop computer has For example, a typical small footpnnt device may have two megabytes of memory or less, whereas a typical desktop system may have 64 megabytes or more Also a typical small footpπnt device may have significantly less processmg power than a typical desktop computmg system, either m terms of processor type, or processor speed, or both For example, a particular personal data assistant device may have a 16 MHz processor, whereas a typical desktop system may have a processor speed of 100 MHz or higher Also, a typical small footpπnt device may have a display size significantly smaller than the display screen of a desktop computing system For example, the display screen of a handheld computer is typically small compared to the display screen of a desktop monitor It is noted that the specific numbers given above are exemplary only and are used for comparison purposes Small footprint devices may also have constraints on other resource types compared to typical desktop computmg systems, besides the memory, processor, and display size resources descnbed above For example, a typical small footpnnt device may not have a hard disk, may not have a network connection, or may have an intermittent netwoik connection or may have a wireless network connection, etc Many small footpnnt devices are portable and/or are small compared to desktop computers, but are not necessarily so Also, many small footprmt devices are pnmanly or exclusively battery-operated Also, small footpnnt devices may typically have a more limited or nanow range of usage possibilities than a typical desktop computing system Thus, m vanous embodiments, the system illustrated m Figure 1 is illustrative of, but is not limited to, any one of the followmg handheld computers, wearable devices (e g , wnstwatch computers), personal data assistants (PDAs), "smart" cellular telephones, set-top boxes, game consoles, global positioning system (GPS) units, electronic textbook devices, etc Since new classes of consumer devices are rapidly emergmg, it is not possible to provide an exhaustive list of small footpnnt devices However, the term "small footpnnt device" is mtended to mclude such devices as may reasonably be mcluded withm the spirit and scope of the term as descnbed above It is noted that in various embodiments the system and method descnbed herem may also be employed in a general-purpose computer system, such as a desktop PC or mainframe computer. Figure 2 - Filter Expression Tree Figure 2 is a diagram illustrating an example of a filter expression tree. A filter expression tree is a tree data structure representing a filter expression. An application program may construct a filter expression tree m any of various ways. For example, an application may store mformation that specifies a filter expression and may construct a filter expression tree by parsmg this mformation and creatmg a tree data structure representing the mformation. Information specifying a filter expression may be stored m any of vaπous formats and may be stored usmg any of vaπous persistent or non-persistent storage means As an example, an email application program may store information m a text format such as: AND (AND (OR ("Sender" "contains" "John Doe") ("Date" "is before" "11/10/99")) ("Subject" "begins with" "sales figures")) ("Pπonty" "is" "low")) where this information specifies expression units logically related to each other via Boolean operators As shown m Figure 2, this mformation may be used to create a filter expression tree that specifies a hierarchical relationship among various portions of the filter expression. It is noted that the format shown above is exemplary only, and the filter expression mformation may be specified and stored m any of vaπous other formats, mcludmg text and binary formats. As discussed above, filter expressions may be used for vanous purposes by application programs For example, a word processor application program may persistently store mformation specifying the most recent text search performed by a user and may construct a filter expression tree from the mformation. Note that the filter expression mformation may be initially stored m a default format, e.g., as a part of the installation process for an application For other types of application programs or for application programs runnmg withm certam environments, it may be desirable to always construct a filter expression tree from such default mformation, rather than from stored mformation that has been modified m response to a user action Filter expression mformation may be stored internally withm an application program, e g., as default mformation specified by the application source code, or externally to an application program, e.g , by storing mformation m a file or database As shown m Figure 2, each leaf node of the constructed filter expression tree may compnse information that specifies an attπbute, a companson operator, and a value As used herem, a leaf node is a node connected by a branch of the tree which forms a termination and does not connect to further branches. For example, as shown m Figure 2, one of the leaf nodes specifies an attnbute 300 of "sender", a comparison operator 302 of "contams", and a value 304 of "John Doe" The attnbute, comparison operator, and value associated with a leaf node are together refened to as an "expression unit". It is noted that, m alternative embodiments, a filter expression tree may differ in vanous aspects from the exemplary Figure 2 filter expression tree. For example, mstead of storing the elements of an expression unit withm a smgle node, separate nodes may be used to store the expression unit attnbute, companson operator, and value mformation The attπbute of an expression unit specifies some aspect of the entities to be filtered by the application program The possible attributes may depend on a particular type of application program or on the particular type of entity to be filtered by the application program For example, for a filter expression to be applied to email messages, attnbutes may include such aspects of email messages as the message sender, the message subject, the message date, the message pnonty, etc , as shown m Figure 2 Particular applications may define and use any of vanous types of attnbutes, as desired The companson operator of an expression unit specifies a type of compaπson to be applied to the attπbute of the expression unit The possible companson operators may depend on the particular attnbute or type of attnbute For example, if the expression unit attnbute is a "date" attnbute, then the possible companson operators may mclude such operators as "is before", "is", "is after", etc As another example, if the expression umt attπbute is a textual attπbute, e g , message sender, message subject, etc , then the possible compaπson operators may mclude such operators as "begins with", "contams", etc The value of an expression unit specifies a value to be used in determining whether an entity satisfies the cnteπon specified by an expression unit The possible values may depend on the particular attπbute or type of attπbute For example, if the expression unit attnbute is a "date" attnbute, then the possible values may be dates If the expression unit attribute is a "message pnonty" attnbute, then the possible values may include pnonty values, such as "low", "normal", "high", etc If the expression unit attnbute is a textual attπbute, e g , "message subject", then the possible values may include any text values It is noted that, in alternative embodiments, portions of a filter expression may be represented differently from the expression units described above For example, mstead of an expression unit with an attnbute, companson operator, and value, it may be appropnate or desirable to represent an expression unit as simply an attnbute and value pair, e g , if the comparison operator to be applied is always an implicit "is" operator As shown m Figure 2, the expression units specified by the filter expression tree leaf nodes may be logically connected to each other via Boolean operators specified by the non-leaf nodes of the filter expression tree Thus, the expression umts, together with the Boolean operators joining them, form a complete filter expression Figure 3 - Exemplary GUI Created from Filter Expression Tree Figure 3 illustrates an exemplary GUI created from a filter expression tree The GUI shown m Figure 3 corresponds to the filter expression tree of Figure 2 As shown, the GUI may include different types of user mterface components or controls, as appropnate for representmg particular expression units For example, the user mterface components or controls corresponding to the attnbute and companson operator portions of the expression units may be selection user mterface components or controls, that is, user interface components permitting a user to select one of several choices For example, m the Figure 3 GUI, in response to a user clicking on the user mterface components conespondmg to expression unit attnbutes, t e , the left column of user mterface components, a selectable list of attnbutes may be displayed, such as "sender", "date", "subject", etc The GUI may also compnse other types of user mterface components For example, the Figure 3 GUI includes text field user mterface components enablmg a user to enter free-form text for values of textual attnbutes and mcludes a date selector user mterface component enablmg a user to select a value for a "date" attnbute As descnbed below, GUIs for specifymg filter expressions, such as the GUI illustrated m Figure 3, may be systematically created from a filter expression tree. Figure 4 - Creating a GUI from a Filter Expression Tree Figure 4 is a flowchart diagram illustrating one embodunent of a method for systematically creating a GUI from a filter expression tree. The method shown m Figure 4 operates on particular filter expression tree nodes, starting with the root node, and may be applied recursively to child nodes, as discussed below. The Figure 4 method may be earned out by any of various application programs The Figure 4 method is descnbed m terms of user mterface "containers". A user mterface contamer is a user mterface object or structure on which user mterface components, such as the components shown m Figure 3, may be hosted. For example, m an embodiment implemented usmg the Java™ programming language, a user mterface contamer may be a Java™ Abstract Wmdow Toolkit (AWT) user mterface component, such as a java.awt.Panel user mterface component In other embodiments, a user interface contamer may be any of vanous other types of user mterface objects or structures able to host user mterface components or controls, such as wmdows, panels, etc. A user mterface contamer may be passed to the Figure 4 method As descnbed below, GUI components may be created and positioned on the contamer If recursion is necessary, child user mterface contamers may be created and placed on the parent contamer Such use of nested user mterface contamers may enable the Figure 4 method to be recursively applied so that user mterface components may always be laid out on the contamer passed m to the method m the same way, regardless of where the node lies m the filter expression tree. It is noted that m an alternative embodiment, the use of nested user mterface contamers may be omitted. For example, mformation regardmg the cunent position offsets may be passed m to the method, enablmg the method to conectly position user mterface components on a single user mterface contamer. In step 100 of Figure 4, the filter expression tree node is checked to determine whether it has child nodes. The child nodes of a given node are those nodes (if any) that are directly connected beneath the given node m the tree hierarchy One embodunent of step 100 is illustrated m more detail below. If the node does have child nodes, then the node compnses Boolean operator mformation logically connecting the node's child nodes, as discussed above In step 102 a user interface contamer for the current node may be created and added to the user mterface contamer passed m to the method. Dependmg on a particular embodunent, the user mterface contamer for the cunent node may be added to the user mterface contamer passed in to the method implicitly as a part of the creation process or may be explicitly added, e g., with an additional function or method call. In step 103, a user mterface component conespondmg to the node's Boolean operator may be created and added to the user mterface contamer for the cunent node. For example, a selection user interface component allowing a user to select from among Boolean operator entnes, such as "AND", "OR", "XOR", "NOT", etc., may be added, or radio button user interface components conespondmg to these operators may be added The value of the Boolean operator UI component may be set to conespond to the Boolean operator specified by the node information In step 104, the method may be recursively applied to each child node, passmg m the user mterface contamer for the cunent node, created in step 102, as the user mterface contamer method parameter to the child node If the node does not have child nodes, then the node is a leaf node and thus compnses information specifymg an expression unit In step 106, a user mterface contamer for the current node, I e , for the user mterface components representing the expression unit, may be created on the user mterface contamer passed m to the method In step 110, a user mterface component conespondmg to the "attnbute" portion of the node's expression unit may be added to the user mterface contamer for the cunent node One embodunent of step 110 is discussed below In step 112, a user mterface component conespondmg to the "compaπson operator" portion of the node's expression unit may be added to the user mterface contamer for the cunent node One embodiment of step 112 is discussed below In step 114, a user mterface component conespondmg to the "value" portion of the node's expression umt may be added to the user mterface contamer for the cunent node One embodiment of step 114 is discussed below As the user interface components are added in the steps descnbed above, the components may be positioned m any way appropnate For example, components may be positioned to appear as in the Figure 3 example, l e , horizontally beginning with the attnbute component on the left, the compaπson operator component in the middle, and the value component on the right As noted above, Figure 4 represents one embodiment of a method for systematically creatmg a GUI from a filter expression tree, and vanous steps of Figure 4 may be added, omitted, combined, altered, performed m different orders, etc For example, m some situations it may not be appropnate or desirable to enable users to specify which Boolean operators to use m a filter expression In such a case, the GUI may be labeled to illustrate fixed Boolean operators, mstead of addmg user mterface components enablmg users to specify particular Boolean operators In vaπous embodiments, the use of a method such as descnbed above to automatically create a GUI may advantageously decrease the size of an application program For example, as descnbed above, customized source code to create a GUI may compπse procedural operations for creatmg user mterface components or controls, setting vaπous attributes of the user mterface components as desired, positioning the user mterface components appropnately, etc A method for creating a GUI from a filter expression tree may enable these types of operations to be performed algonthmically, as descnbed above Additionally, the source code implementing the method may be usable to create multiple filter expression GUIs withm an application program Figure 5 - Determination of Child Nodes Step 100 of Figure 4 may be accomplished m any of vaπous ways Figure 5 illustrates one embodiment of step 100 In Figure 5, the filter expression tree node is checked to see whether it conesponds to a Boolean operator If so, then the node is a non-leaf node, and thus has child nodes In step 120, the node is checked to determine whether it is an AND Boolean operator node Step 120 may be performed in any of vanous ways, dependmg on a particular type of application or application implementation For example, an email program implemented usmg the Java™ programming language may utilize the standard javax.mail search SearchTerms classes to represent filter expression tree nodes In this example, step 120 may be performed via a statement such as if node instanceof ] avax .mail . search .AndTerm) If the node is determined to be an AND Boolean operator node, then in step 122, the child nodes of the node are obtamed The child nodes may then be traversed as described above Otherwise, in step 124, the node is checked to determine whether it is an OR Boolean operator node, similarly is described above for step 120 If the node is determined to be an OR Boolean operator node, then m step 126, the child nodes of the node are obtamed The child nodes may then be traversed as descnbed above Otherwise, in step 125, the node is checked to determine whether it is an XOR Boolean operator node, similarly is described above for step 120 If the node is determined to be an XOR Boolean operator node, then m step 127. the child nodes of the node are obtained The child nodes may then be traversed as described above Otherwise, in step 128, the node is checked to determine whether it is a NOT Boolean operator node, similarly is described above for step 120 If the node is determined to be a NOT Boolean operator node, then m step 130, the child node of the node is obtained (Note that NOT nodes may have a single child node ) The child node may then be traversed as described above If the node is not an AND, OR, or NOT Boolean node, then the node may a leaf node, as shown in Figure 5 Figure 6 - GUI Component Creation for Expression Units As descnbed above with reference to steps 110 - 114 of Figure 4, GUI components representing the elements of an expression unit may be created Figures 6A and 6B (refened to collectively as Figure 6) illustrate one embodiment of steps 1 10 - 114 m more detail The process of Figure 6 may be repeated for each expression unit of a filter expression tree Although Figure 6 is shown m terms of an application creating a GUI for an email filter expression, the idea behmd Figure 6 may readily be applied to other types of filter expressions In step 200, a selection user mterface component representing the "attπbute" portion of an expression unit is created Various attributes may be added to this selection component, as appropnate For example, as shown m Figure 6, for an email filter expression, attnbutes such as "subject", "sender", "date", "pπonty", etc. may be added Step 200 may be implemented usmg any of vanous types of selection user interface components For example, in an embodunent implemented using the Java™ programming language, step 200 may be implemented with source code such as ]ava . aw . Choice attributeComponent = new ]ava . awt . Choice ({"subject", "sender", "date", "priority"}); In step 202, the selection user interface component representmg the expression unit attribute is set to the appropnate attπbute, as specified by the node information For example, m an embodiment in which nodes are represented usmg javax mail search SearchTerms classes, step 202 may appear similar to Class nodeClass = node . getClass ( ι ; if (nodeClass . isAssignableFrom (-javax . mail, search. Sub] ectTerm. class) choice . select ("subject"); else if (...) In steps 204 - 212, a selection user interface component representmg the "companson operator" portion of an expression unit is created The selections placed in this selection user mterface component may depend on the attribute specified for the node's expression unit For example, as shown m steps 204 - 206, if the specified attribute is a "date" attribute, then the compaπson operator selection component may mclude entnes such as "is before", "is", "is not", "is after", etc As shown m steps 208 - 210, if the specified attnbute is a textual attnbute, e g , "subject" or "sender", then the comparison operator selection component may include entries such as "begins with", '"contams", "ends with", etc As shown in step 212, the entnes for the compaπson operator selection component may default to "is" and "is not" entries For example, if the expression umt attπbute is "pnonty", then these entnes may be added In step 214. the selection user interface component representing the expression unit compaπson operator is set to the appropnate compaπson operator, as specified by the node mformation, similarly as described above for step 202 As descnbed above, the type of user interface component created to represent the "value" portion of an expression unit may differ For example, as shown m steps 216 - 218, if the expression unit attnbute is a "date" attnbute, then a calendar user mterface component may be created As shown m steps 224 - 226, if the node attnbute is a "pnonty" attribute, then a selection user mterface component may be created, with entnes such as "low", "normal", "high", etc As shown in step 222, the default may be to create a text field user mterface component allowing a user to enter free-form text, e g , to specify the value for a "subject" or "sender" attnbute In step 228, the selection user mterface component representmg the expression unit value is set to the appropriate value, as specified by the node information, similarly as descnbed above for step 202 As noted above, Figure 6 represents one embodunent of a process of creatmg user mterface components conespondmg to expression unit elements, and various steps of Figure 6 may be added, omitted, combmed, altered, performed m different orders, etc For example, although Figure 6 is illustrated m terms of creatmg user mterface components for a particular type of expression unit related to email messages, the process may of course be generalized to enable user mterface components to be appropriately created for expression units related to any of various types of filter expressions For example, the Figure 6 process may be implemented in such a way that a caller can specify a list of entnes to be added to the attπbute selection user mterface component, can specify a list of companson operator entnes to associate with each attnbute, etc In particular embodiments, callers may be able to specify this type of mformation in any of various ways For example, data structures representing the information may be defined and passed as parameters to a function or method Use of Resulting Filter Expression GUI An application may create a filter expression tree, create a top-level user mterface contamer for the GUI to be created from the filter expression tree, such as a panel or window, and may pass this user interface contamer to a function or method that adds appropriate user interface structures and objects to the top-level user mterface contamer as described above Other parameters that specify mformation regardmg the filter expression GUI to be created, such as mformation descnbed above, may also be passed to the function or method Once a GUI has been created, the application may cause the GUI to be displayed, e g by calling a display method on a top-level user interface contamer for the GUI In another embodiment, the GUI may be inherently displayed as a result of creatmg the user interface structures and objects An application program that uses a filter expression may interact with a GUI created from a filter expression tree in any of vanous ways, dependmg on a particular implementation In one embodiment, user mterface information, such as references to user mterface components or controls, is added to the filter expression tree as a GUI is created For example, m Figure 3, the bottom Boolean operator user mterface component conesponds to the root node of the filter expression tree shown m Figure 2 Thus, a reference to this user mterface component may be added to the root node of the filter expression tree This user mterface mformation may then be used by the application to mteract with the GUI. similar to the interaction of an application with a filter expression GUI creating usmg conventional methods The application program may register event handlers for interactmg with the filter expression GUI, if appropnate The application may also add vaπous other user mterface components or controls to the GUI, such as an "OK" button and a "Cancel" button, and may register event handlers for these components For example, m response to a user pressmg an "OK" button, an application may be operable to retrieve the specified filter mformation from the filter expression tree and use the specified filter mformation to perform a filtering operation For example, an application for searching a database of street addresses may use the filter information to perform an operation such as looking up and returning a set of street addresses for display to a user If appropnate, the application may then store the retrieved information so that it can later be used to initialize a GUI to reflect the most recent filtering cπtena specified by the user, e g , the next time the user performs a database search Although the embodiments above have been described in considerable detail, numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated It is intended that the following claims be interpreted to embrace all such variations and modifications

Claims: WHAT IS CLAIMED IS: 1 A method for creatmg a graphical user mterface, the method compnsmg creatmg a filter expression tree with nodes representing a filter expression, traversing the filter expression tree, wherem said traversing the filter expression tree compnses processmg each tree node, wherem said processmg each tree node comprises determining whether the tree node is a leaf node, if the tree node is not a leaf node, recursively processing each child node of the tree node, if the tree node is a leaf node, creatmg graphical user interface components representing the expression unit specified by the leaf node 2 The method of claun 1, wherem said creating graphical user interface components representmg the expression unit specified by the leaf node comprises creating an "attribute" graphical user interface component, a "comparison operator" graphical user mterface component, and a "value" graphical user mterface component 3 The method of claim 2, wherem said creatmg an "attnbute" graphical user mterface component compnses setting the "attπbute" graphical user mterface component to the attribute specified by the tree node, wherem said creating a "comparison operator" graphical user mterface component compnses setting the "companson operator" graphical user interface component to the compaπson operator specified by the tree node, wherein said creatmg a "value" graphical user mterface component compnses setting the "value' graphical user interface component to the value specified by the tree node 4 The method of claim 2, wherein the filter expression is an expression for filtering electronic messages 5 The method of claim 2, wherein the filter expression is an expression for one of the group consisting of filtering database quenes, filtering database searches, and filtering document searches 6 The method of claim 4, wherem said creating an "attπbute" graphical user interface component compnses creatmg a selection graphical user mterface component, wherem said selection graphical user mterface component compnses one or more attnbutes from the group consisting of message subject, message sender, message date, and message pnonty 7 The method of claim 1 wherem each leaf node of the tree comprises information specifying an expression unit, wherem each expression umt compnses an attnbute, a compaπson operator, and a value, and wherem each non-leaf node of the tree comprises information representing a Boolean operator 8 A system comprising a processmg unit, memory coupled to the processmg unit, a program compπsed m the memory, wherem the program is executable to create a filter expression tree with nodes representing a filter expression, wherein the program is further executable to traverse the filter expression tree, wherem said traversing the filter expression tree compnses processmg each tree node, wherem said processing each tree node compnses determining whether the tree node is a leaf node, if the tree node is not a leaf node recursivelv processing each child node of the tree node, if the tree node is a leaf node, creating graphical user interface components representmg the expression unit specified by the leaf node 9 The system of claim 8, wherem said creatmg graphical user interface components representmg the expression unit specified by the leaf node comprises creatmg an "attπbute" graphical user interface component, a "compaπson operator" graphical user mterface component, and a "value" graphical user mterface component 10 The system of claim 9, wherem said creating an "attnbute" graphical user mterface component comprises setting the "attnbute" graphical user interface component to the attπbute specified by the tree node, wherem said creating a "compaπson operator" graphical user mterface component compnses setting the 'comparison operator" graphical user mterface component to the companson operator specified by the tree node, wherem said creating a "value" graphical user interface component compnses setting the "value" graphical user mterface component to the value specified by the tree node 11 The system of claim 9, wherem the filter expression is an expression for filtering electronic messages 12 The system of claim 9, wherein the filter expression is an expression for one of the group consisting of filtenng database queries, filtering database searches, and filteπng document searches 13 The system of claim 1 1, wherein said creating an "attribute" graphical user mterface component comprises creatmg a selection graphical user interface component, wherein said selection graphical user interface component compnses one or more attributes from the gioup consistmg of message subject, message sender, message date, and message pnonty 14 The system of claim 8. wherem each leaf node of the tree compnses information specifymg an expression unit, wherem each expression unit comprises an attnbute, a comparison operator, and a value, and wherein each non-leaf node of the tree compnses mformation representmg a Boolean operator 15 A memory medium comprising program instructions which implement creating a filter expression tree with nodes representing a filter expression, traversing the filter expression tree, wherein said traversing the filter expression tree compnses processmg each tree node, wherem said processing each tree node comprises determining whether the tree node is a leaf node, if the tree node is not a leaf node, recursively processing each child node of the tree node, if the tree node is a leaf node, creating graphical user mterface components representing the expression unit specified by the leaf node 16 The memory medium of claim 15 , wherem said creating graphical user interface components representmg the expression unit specified by the leaf node compnses creatmg an "attnbute" graphical user mterface component, a "companson operator" graphical user interface component, and a "value" graphical user mterface component 17 The memory medium of claim 16, wherem said creating an "attribute" graphical user interface component comprises setting the "attnbute" graphical user mterface component to the attribute specified by the tree node, wherem said creating a "compaπson operator" graphical user interface component compnses setting the "comparison operator" graphical user interface component to the comparison operator specified by the tree node, wherem said creatmg a "value" graphical user interface component compnses setting the "value" graphical user mterface component to the value specified by the tree node 18 The memory medium of claim 16, wherein the filter expression is an expression for filtenng electronic messages 19 The memory medium of claim 18 , wherem said creating an "attπbute" graphical user interface component compnses creating a selection graphical user mterface component, wherein said selection graphical user mterface component compnses one or more attributes from the group consisting of message subject, message sender, message date, and message priority. 20. The memory medium as recited in claun 15, wherem each leaf node of the tree comprises information specifying an expression unit, wherem each expression unit comprises an attnbute, a comparison operator, and a value, and wherein each non-leaf node of the tree comprises information representmg a Boolean operator.

Inventors: KRAUKLIS RALF UWE, KRAUKLIS, RALF, UWE
Applicants: SUN MICROSYSTEMS INC, SUN MICROSYSTEMS, INC.
Application year: 2000
Main classification: G06F9
IPC codes: G06F9