|
|
How do I write my own proxy classes for the Designer? |
| Here's a working example:
com.aravox.jwizard.WizardPanel is an abstract class which extends JPanel. This class is abstract because child classes must reimplement two methods which deal with the focus policy. To solve this problem, I must create a concrete version of the abstract parent class which will serve as the Designer's proxy for the abstract class.
public class WizardPanelProxy extends WizardPanel {
Once this builds and compiles, place it and everything it depends upon into a jar of its own. Copy this jar into jbuilder4/lib/ext. (Or, place a symlink there which points to the jar file, which is what I actually did.) Note that the code must only compile, it need not actually do anything useful! Edit your .jbuilder4/user.properties file and find the proxy section. I added the following line to mine:
designer;proxy.com.aravox.JWizard.WizardPanel=
com.aravox.unpackwizard.jbproxies.WizardPanelProxy
(This is all one line in the user.properties file, I split it here manually.) Now, bounce JBuilder. IE, exit, and restart. You must do this because JBuilder does not adjust its own classpath once it has launched, and jar files in lib/ext are discovered only at launch time. Placing the jar in jbuilder4/lib/ext is required because the Designer is running in JBuilder's JVM, not your project's JVM, so adding the proxy jar to your project's classpath is woefully insufficient.
Now, whenever I use Designer to build something which extends WizardPanel, Designer will stealthily substitute the proxy class for the abstract class. What I'll see in the designer is whatever the proxy class builds for me. | |
| See Also: 2001-Jul-08 10:13am gyles19@visi.com | |
| Gillmer Derge (TeamB) writes:
I've added my RedBeans OpenTool to CodeCentral at
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=17595 Instructions are included with the tool, but you basically need to package your class as an OpenTool by adding an entry to the jar's manifest file and add the following method to the proxy class.
// import com.gillmerderge.jbuilder.designer.DesignerProxyPropertyGroup
public void initOpenTools(int majorVersion, int minorVersion) {
if (majorVersion >= 4)
DesignerProxyPropertyGroup.registerProxyClass(
RFMPanel.class, RFMPanelProxie.class);
}
At that point the rest should happen automatically when you restart
JBuilder. Note that the tool includes a proxy class for PropertyPage, so
the example you downloaded from Joi's FAQ-O-Matic still might not work,
since it also deals with PropertyPage. | |
| [Append to This Answer] | |
| 2002-Mar-03 1:48pm |
| Previous: |
|
| Next: |
|
| ||||||||
|
Java Community
Java Tools |
Code Central JB OpenTools |
Community Recent Threads |
Borland Chat Chat FAQ |
||||||||||||||
|
Feature Matrices 3.0 | 3.5 | 4.0 5.0 | 6.0 | 7.0 |
Shop for JBuilder |
JBuilder Downloads and reg keys |
Report Piracy | ||||||||||||||
|
Online Manuals 4.0 | 5.0 | 6.0 7.0 |
Borland DevSupport's Bug/RFE Form Quality Central Client |
JB Patches & Updates |
JBuilder FAQs TIs | ||||||||||||||
|
JBuilder Newsgroups |
Tamaracka's News Archive |
Mr. Haki's JBuilder Machine |
JGuru's JBuilder FAQ |
||||||||||||||
|
Sun's Bug Parade |
|||||||||||||||||
|
|||||||||||||||||