🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Change parameters list upon read

User: "chicofranchico"
New Altair Community Member
Updated by Jocelyn
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

Find more posts tagged with

Sort by:
1 - 4 of 41
    User: "fischer"
    New Altair Community Member
    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,
    Simon
    User: "chicofranchico"
    New Altair Community Member
    OP
    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!
    User: "fischer"
    New Altair Community Member
    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,
    Simon
    User: "chicofranchico"
    New Altair Community Member
    OP
    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!