How to use a TableToolbarDecorator

I'm developing a custom file editor plugin. On the EditorWindow main panel I want to place some text entry fields and an editable listbox that prompts the user to choose from a set of predefined values. I am using as my guide the copyright plugin as found in the source for IntelliJ 11 CE edition.

On initiation of the file editor, a listbox panel is displayed and the toolbar ("+  -  ^  v") is also displayed, however all buttons including the Add ("+") button are disabled. When I single step debug through the code I can see the button being enabled in However when displayed it is grey'ed out. As I understand it the default TableToolbar should provide an add action by default which will add a selected Object to the model behind the table view.

Apart from not understanding why the Add button is disabled, I'm unsure on a few other things. Firstly the role of the ElementProducer which can be passed to the ToolbarDecorator constructor and secondly I'm also a little shaky on whether I am providing the list of options to the Table row with JBComboBoxTableCellEditorComponent correctly. However as I can't click "add" I haven't got to that section of code yet.

I've attached a simplified source file, as I said before the panel is initially created for a specific file with a FileEditorProvider.

Any pointers would be appreciated.


1 comment

Problem was I was creating the TableToolbarDecorator in the FileEditor getParentWindow. Moved it to constructor


Please sign in to leave a comment.