JSwingRipples2016 / jswingripples

Port of JRipples Eclipse Plugin to Swing
1 stars 3 forks source link

Issue #34: Make all JTabbedPanes implement the right click close option #58

Closed amorenocb closed 7 years ago

amorenocb commented 7 years ago

Im sure there must be a more elegant solution, but things got a little bit tricky when I realised every component inside a tab had its own process of closing whatever was inside of them. This works for now. If anyone comes up with an idea for a more elegant solution please do post it.

amorenocb commented 7 years ago

Mouse listeners are now added in a private method. It looks kind of ugly, but for now it works. Im thinking a more elegant solution could be maybe using a template method inside a CloseableJTabbedPane class that extends JTabbedPane. Then maybe implement two subclasses, one for the view area of the main program and one for the text editor, each filling the template method accordingly? Im not sure if this is going to be easy to do though, because in the case of the text editor tabs you would need to have a reference to the openFiles array.