Change parameters list upon read
chicofranchico
New Altair Community Member
Hi,
we currently have an operator that reads from a database the tables. We stipulated that there is a ParameterTypeCategory defined in the getParameterTypes method with a list of categories (take for reference the DatabaseHandler).
Is there a way to change this list of categories after I make a read from the database and populate it with my database table names?
I've tackled this problem but I've reached the point where I get to replace the parameters but that throws some Observer issues.
Can someone point me out a simple way to do what I'm trying?
Thanks
we currently have an operator that reads from a database the tables. We stipulated that there is a ParameterTypeCategory defined in the getParameterTypes method with a list of categories (take for reference the DatabaseHandler).
Is there a way to change this list of categories after I make a read from the database and populate it with my database table names?
I've tackled this problem but I've reached the point where I get to replace the parameters but that throws some Observer issues.
Can someone point me out a simple way to do what I'm trying?
Thanks
0
Answers
-
Hi,
for the ParameterTypeCategory, there is no such way. In fact I wouldn't expect this to be the right way to go. The right thing would probably be to make a ParameterTypeTableName (I think we have something like this for the Read Database operator.) You would also have to register an editor for this type by calling
PropertyPanel.registerPropertyValueCellEditor(Class<? extends ParameterType> typeClass, Class<? extends PropertyValueCellEditor> editor)
unless using the one provided by the ParameterTypeCategory works out for you.
Best,
Simon0 -
Hi!
Thanks a lot for the reply.
Where should I make the registration of my PropertyValueCellEditor implementation? If I do it on the initPlugin I get the following error:
The method registerPropertyValueCellEditor(Class<? extends ParameterType>, Class<? extends PropertyValueCellEditor>) in the type PropertyPanel is not applicable for the arguments (Class<DatabaseDataReader>, Class<MyDatabaseTableValueCellEditor>) where MyDatabaseTableValueCellEditor is my implementation.
Thanks again!0 -
Hi,
you should use initGui(MainFrame), but I don't think this will solve your problem. Isn't that a compile time error anyway?
Cheers,
Simon0 -
Hi.
Yeah, I don't know why the compile time error. If I put the declaration in the PropertyPanel static block (like the others) it works fine. Is there something I'm missing?
Thanks again!0