MCPcopy Create free account
hub / github.com/GateNLP/gate-core / TabHighlighter

Method TabHighlighter

src/main/java/gate/gui/TabHighlighter.java:31–50  ·  view source on GitHub ↗
(JTabbedPane pane, Component comp,
                        Color highlightColour)

Source from the content-addressed store, hash-verified

29 */
30public class TabHighlighter {
31 public TabHighlighter(JTabbedPane pane, Component comp,
32 Color highlightColour){
33 this.tPane = pane;
34 this.tab = tPane.indexOfComponent(comp);
35 this.highlightColour = highlightColour;
36 tPane.getModel().addChangeListener(new ChangeListener() {
37 @Override
38 public void stateChanged(ChangeEvent e) {
39 if(tPane.getSelectedIndex() == tab) removeHighlight();
40 }
41 });
42
43 tPane.addMouseListener(new MouseAdapter() {
44 @Override
45 public void mouseClicked(MouseEvent e) {
46 if(tPane.getSelectedIndex() == tab) removeHighlight();
47 }
48 });
49
50 }// TabBlinker(JTabbedPane pane, Component comp, Color blinkColor)
51
52 /**
53 * Highlights the tab unless is selected

Callers

nothing calls this directly

Calls 1

getModelMethod · 0.80

Tested by

no test coverage detected