| 1 19 20 package edu.umd.cs.findbugs.gui2; 21 22 import java.awt.BorderLayout ; 23 import java.awt.event.KeyEvent ; 24 25 import javax.swing.JMenu ; 26 import javax.swing.JSplitPane ; 27 import javax.swing.JTabbedPane ; 28 import javax.swing.UIManager ; 29 30 33 public class TabbedLayout implements FindBugsLayoutManager { 34 35 final MainFrame frame; 36 37 private JTabbedPane mainTabs = null; 38 41 public TabbedLayout(MainFrame frame) { 42 this.frame = frame; 43 } 44 45 48 public JMenu createWindowMenu() { 49 return null; 50 } 51 52 55 public void initialize() { 56 if(Driver.getFontSize() > 15 && System.getProperty("os.name").startsWith("Mac")){ 58 UIManager.put("TabbedPaneUI", "javax.swing.plaf.basic.BasicTabbedPaneUI"); 59 UIManager.put("FileChooserUI", "javax.swing.plaf.metal.MetalFileChooserUI"); 60 } 61 62 mainTabs = bottomTabs(); 63 64 JSplitPane split = new JSplitPane (JSplitPane.VERTICAL_SPLIT, 65 frame.bugListPanel(), mainTabs); 66 split.setOneTouchExpandable(true); 67 split.setDividerLocation(275); 68 69 frame.setLayout(new BorderLayout ()); 70 frame.add(split, BorderLayout.CENTER); 71 frame.add(frame.statusBar(), BorderLayout.SOUTH); 72 73 } 74 75 78 public void makeCommentsVisible() { 79 mainTabs.setSelectedIndex(1); 80 81 } 82 83 86 public void makeSourceVisible() { 87 mainTabs.setSelectedIndex(2); 88 89 } 90 91 94 public void saveState() { 95 97 } 98 99 102 public void setSourceTitle(String title) { 103 mainTabs.setTitleAt(2, title); 104 105 } 106 110 JTabbedPane bottomTabs() 111 { 112 JTabbedPane bottomTabs = new JTabbedPane (); 113 114 bottomTabs.addTab("Bug Summary", frame.summaryTab()); 115 bottomTabs.addTab("Comments", null, frame.createCommentsInputPanel(), 116 "User defined comments of current bug."); 117 bottomTabs.addTab("Source", null, frame.createSourceCodePanel(), 118 "Source code of current bug if available."); 119 120 bottomTabs.setMnemonicAt(0, KeyEvent.VK_B); 122 bottomTabs.setMnemonicAt(1, KeyEvent.VK_C); 123 bottomTabs.setMnemonicAt(2, KeyEvent.VK_S); 124 125 return bottomTabs; 126 } 127 } 128 | Popular Tags |