General Interface Builder has built-in editors for creating and editing files. Editors are available for the following file types:
Working with FilesTo create a file, choose File > New and select the file type you'd like to create. A new untitled file tab opens in the work area. To save the file,
Work Area View SupportThe work area provides several views. The available views depend on what type of file is active in the work area. The views include:
These views are available from the work area toolbar to the lower right of the work area as shown in the following figure. Live Component ViewThe Live Component view Grid ViewThe Grid view For more information, see Dynamic Properties Files. See Properties Bundle Files and Internationalizing and Localizing Applications. Source ViewThe Source view Formatted Source XML (Read Only) ViewThe Formatted Source XML view Rendered HTML (Read Only) ViewThe Rendered HTML view When running General Interface Builder in HTML and XHTML mode, well-formed HTML, which is XHTML, is pretty-printed in the Rendered HTML (Read Only) view. If the markup isn't well-formed, pretty printing isn't used and a parsing error displays in the System Log palette. For example, if you entered HTML without a closing element in the Text/HTML property for a label, such as <b>My Label, a mismatched tag error message displays in the System Log palette and the Rendered HTML (Read Only) view isn't pretty-printed. If you entered valid XHTML with open and close elements, such as <b>My Label</b>, no error is reported and the Rendered HTML (Read Only) view is pretty-printed. Component Profile ViewThe Component Profile view Here you can assign a name, description, and icon URL for the component. This is useful if you're creating custom components and exporting them to the Component Libraries palette (workspace / prototypes). The icon displays next to the name of the component in the Component Libraries palette and the description displays as a tooltip. Modifying a Component at RuntimeThe onBeforeDeserialization and onAfterDeserialization text areas can be used to specify JavaScript to execute before or after the object is deserialized. If the component is loaded at runtime, the code is executed immediately before the XML is converted into JavaScript objects or after the JavaScript objects are instantiated and bound to the GUI model. Executing JavaScript code before an object is deserialized is useful when the runtime needs to be prepared before the component is loaded, such as preloading data for the component. Executing JavaScript code after an object is deserialized is useful when the component needs to be initialized with information only available at runtime. For example, you might want to modify the CDF for a Matrix list component and then re-populate the list after it displays on-screen. JavaScript code entered in the onBeforeDeserialization text area has access to the objXML context variable, which is an instance of jsx3.xml.Document. The objXML context variable represents the serialization file in-memory and the jsx1 namespace prefix resolves to the namespace for the file (in this case, urn:tibco.com/v3.0). For example, if you have a Block in your serialization file named foo and you want to change the background color to red, you could put the following code in the onBeforeDeserialize event: objXML.setSelectionNamespaces("xmlns:jsx1='" +
jsx3.app.Model.CURRENT_VERSION + "'");
var objNode =
objXML.selectSingleNode("//jsx1:object\[@type='jsx3.gui.Block']/
jsx1:strings\[@name='foo']");
if(objNode) {
objNode.setAttribute("jsxbgcolor","red");
}
The onAfterDeserialize event provides direct access to the actual model objects, after they are deserialized but before they are rendered on-screen. In this example code, the background of Block foo is rendered in red after the object is created: var objBlock = objJSX.getDescendantOfName("foo"); if(objBlock) { objBlock.setBackgroundColor("red"); }
For more examples, see Executing Code Before or After Deserialization. Dynamic Properties FilesDynamic properties are XML resource files that contain externalized strings as name-value pairs. This feature enables you to organize the styles and text used by the application in a centralized location for easier application maintenance. Dynamic properties can be used for localization and for IDE lookup values. Properties bundle files are also used for localization. For more information, see Properties Bundle Files.
General Interface has built-in dynamic properties that you can use. These built-in dynamic properties begin with an @ symbol. You can also create your own custom dynamic properties files using the Dynamic Properties editor. General Interface and custom dynamic properties are available on the context menu in the Properties Editor palette as shown in the following figure. To assign a dynamic property, right-click in the Properties Editor palette and select a dynamic property. You can also type the property key (ID) in the Value cell, such as @Dialog BG for the BG Color property. After a dynamic property is selected, the explicit value displays in the Value field next to the name of the dynamic property. Creating Dynamic Properties FilesTo create a dynamic properties file in General Interface Builder,
Loading and Using the Dynamic Properties FileTo load the dynamic properties file and apply properties to a component, complete the following steps:
Properties Bundle FilesThe Properties Bundle editor is used to create and edit properties bundle files, which are used to localize your application for a specific language and country. A locale is a region of the world that shares a common language, writing, calendar, and so on.
Properties bundle files, also known as resource bundles, contain locale-specific objects, such as menu and button labels in the application user interface. When these strings are externalized in the properties bundle files, it's easier to translate applications into other languages. The application simply loads the locale-specific resource appropriate for the user's locale. Mapping Rules FilesMapping rules files are XML files that define mappings between application objects and data elements or CDF documents and data elements. Mapping rules files are created with the XML Mapping Utility. For more information, see Communicating with Data Services. GIPP Test CasesGIPP test cases are used with the General Interface Test Recorder. For more information, see Using the Test Recorder. GITAK Test CasesGITAK test cases are used with the General Interface Test Recorder. For more information, see Using the Test Recorder. |
Contents
|





