Property Classes in Oracle Developer
This evening, I am helping my daughter finish her algebra homework, and am amazed at how she thinks something so easy can be so difficult. When I rephrased some of the questions, she immediately saw their solutions. Property classes in Form Builder, a part of Oracle Developer, can be the same way. If you try and read Oracle's obfuscated description of them in the online documentation, you might not understand how they can help you. However, after the description is rephrased or an example given, they become very easy to understand.
In helping my daughter with her homework, I had the most success when I used an example. Rather than doing something complicated with Form Builder, let's start with a couple of shapes. Figure 1 shows a red square and a green circle that we will be using in the example.
Figure 1 Red square and green circle in Forms Developer to help demonstrate property classes.
Now, you want to create a property class that consists of the background color property. This is done by following these steps:
Click on one of the two shape objects in the Layout Editor (that's the window that holds the shapes where you can see them).
Make sure the Property Palette is open. If not, open it by clicking on the Tools, Property Palette menu item in the Layout Editor menu.
Select the Background Color Property in the Property Palette.
Create a property class by clicking on the Property Class icon (the fifth icon to the right in the Property Palette's toolbar).
You will see a dialog box, saying Form Builder is creating a new property class. You can then see the class in the object navigator (the third window not yet mentioned).
Select the newly created property class found in the object navigator window (you may have to expand the Property Classes hierarchical tree).
Now look in the Property Palette; you have your property class with some derived name. Change the name property to SHAPE_CLASS.
Now the class name is more descriptive.
You have created a property class. Now you want both shapes on the form to derive their background colors from the SHAPE_CLASS. Select the red square in the Layout Editor. Under the General section is a property called Subclass Information. If you click on it, the property value has a More button. Click the button, and you see a Subclass Information dialog box. Notice that the Object option is selected. What you really want to happen is have the Property Class option selected, which changes some of the dialog box pull-down list choices. Choose SHAPE_CLASS from the Property Class Name pull-down list, as shown in Figure 2. You can dismiss the dialog box by clicking the OK button.
Figure 2 Subclass Information dialog box used to associate property classes with form objects.
Now derive the background color for the green circle from the SHAPE_CLASS using the same steps described previously. When you are done, the green circle should now be a red circle, as shown in Figure 3.
Figure 3 Square and circle in Forms Developer that are now receiving the background property value from a property class.
Now, if you want to change the background color for both shape objects, you only need to make the change in one place: the SHAPE_CLASS background color property.