Board index » jbuilder » Adding new JBuilder 2005 Preferences via OpenTools

Adding new JBuilder 2005 Preferences via OpenTools


2005-02-12 01:18:27 PM
jbuilder3
Hi-
I'm working on converting the JVI plugin (jvi.sourceforge.net) to
JBuilder 2005. Needless to say the API's changed quite a bit since this
project last actually worked with JBuilder. The old Tools menu in JBuilder
had IDE Options and Editor Options as separate menu items, and thus,
separate dialogs. In JB 2k5, the Tools>>Preferences dialog combines both
these dialogs and now uses a tree to itemize properties.
The PropertyPageFactory class (correctly) deprecates two methods regarding
the use of tabs in the old Editor Options pane but the other methods still
refer to tabs. Does anyone know:
1. How to add a new preferences branch to the tree?
2. If the OpenTools API has been updated in JB 2k5 to accomodate the new
preferences format?
Thanks.
-Adam
 
 

Re:Adding new JBuilder 2005 Preferences via OpenTools

If you wanted to add your own topic with subtopics, you would override the
PropertyPageFactory.getNestedFactories() method.
The "Editor" topic does that. It finds its nested factories by asking for
registered PropertyPageFactory instances that respond to
EditorManager.SUBTOPIC. So your registered factory would do something like:
public PropertyPageFactory getPageFactory(Object topic) {
if (topic == EditorManager.EDITOR_SUBTOPIC) {
return new PropertyPageFactory("My Page") {
public PropertyPage createPropertyPage() {
return new MyPropertyPage();
}
};
}
return null;
}
"Adam Gordon" < XXXX@XXXXX.COM >wrote in message
Quote
Hi-

I'm working on converting the JVI plugin (jvi.sourceforge.net) to
JBuilder 2005. Needless to say the API's changed quite a bit since this
project last actually worked with JBuilder. The old Tools menu in
JBuilder
had IDE Options and Editor Options as separate menu items, and thus,
separate dialogs. In JB 2k5, the Tools>>Preferences dialog combines
both
these dialogs and now uses a tree to itemize properties.

The PropertyPageFactory class (correctly) deprecates two methods regarding
the use of tabs in the old Editor Options pane but the other methods still
refer to tabs. Does anyone know:

1. How to add a new preferences branch to the tree?
2. If the OpenTools API has been updated in JB 2k5 to accomodate the new
preferences format?

Thanks.

-Adam


 

Re:Adding new JBuilder 2005 Preferences via OpenTools

To your PropertyPageFactory add :
---code---
public static final Object MY_SUBTOPIC = new Object();
public MyPropertyPageFactory() {
super("MyProps", "MyProps");
}
public PropertyPage createPropertyPage() {
return new MyPropertyPage();
}
public PropertyPageFactory[] getNestedFactories() {
return PropertyManager.getPageFactories(MY_SUBTOPIC);
}
---code---
To your PropertyGroup add:
---code---
public PropertyPageFactory getPageFactory(Object topic) {
// adds to the main topics list.
if (topic == null) {
return new MyPropertyPageFactory();
}
// adds a subtopic page to our main topic.
if (topic == MyPropertyPageFactory.MY_SUBTOPIC) {
return new PropertyPageFactory("My Subtopic") {
public PropertyPage createPropertyPage() {
return new MyPropertyPage();
}
};
}
return null;
}
---code---
The topics in the preference tree will display the following starting from
the root node:
?
??MyProps
? ?
??My Subtopic
Steph.
"Adam Gordon" < XXXX@XXXXX.COM >a écrit dans le message de
Quote
Hi-

I'm working on converting the JVI plugin (jvi.sourceforge.net) to
JBuilder 2005. Needless to say the API's changed quite a bit since this
project last actually worked with JBuilder. The old Tools menu in
JBuilder
had IDE Options and Editor Options as separate menu items, and thus,
separate dialogs. In JB 2k5, the Tools>>Preferences dialog combines
both
these dialogs and now uses a tree to itemize properties.

The PropertyPageFactory class (correctly) deprecates two methods regarding
the use of tabs in the old Editor Options pane but the other methods still
refer to tabs. Does anyone know:

1. How to add a new preferences branch to the tree?
2. If the OpenTools API has been updated in JB 2k5 to accomodate the new
preferences format?

Thanks.

-Adam


 

{smallsort}