The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Change parameters list upon read

chicofranchicochicofranchico Member Posts: 3 Contributor I
edited November 2018 in Help
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
Tagged:

Answers

  • fischerfischer Member Posts: 439 Maven
    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
  • chicofranchicochicofranchico Member Posts: 3 Contributor I
    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!
  • fischerfischer Member Posts: 439 Maven
    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
  • chicofranchicochicofranchico Member Posts: 3 Contributor I
    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!
Sign In or Register to comment.