📄 findbugsframe.java
字号:
return cmp; return a.compareTo(b); } } /** * The instance of BugTypeByTypeComparator. */ private static final Comparator<BugInstance> bugInstanceByTypeComparator = new FindBugsFrame.BugInstanceByTypeComparator(); /** * Swing FileFilter class for file selection dialogs for FindBugs project files. */ private static class ProjectFileFilter extends FileFilter { public boolean accept(File file) { return file.isDirectory() || file.getName().endsWith(".fb"); } public String getDescription() { return L10N.getLocalString("dlg.findbugsprojects_lbl", "FindBugs projects (*.fb)"); } } /** * The instance of ProjectFileFilter. */ private static final FileFilter projectFileFilter = new ProjectFileFilter(); /** * Swing FileFilter for choosing an auxiliary classpath entry. * Both Jar files and directories can be chosen. */ private static class AuxClasspathEntryFileFilter extends FileFilter { public boolean accept(File file) { return file.isDirectory() || file.getName().endsWith(".jar"); } public String getDescription() { return L10N.getLocalString("dlg.jarsanddirectories_lbl", "Jar files and directories"); } } /** * The instance of AuxClasspathEntryFileFilter. */ private static final FileFilter auxClasspathEntryFileFilter = new AuxClasspathEntryFileFilter(); /** * Swing FileFilter for choosing XML saved bug files. */ private static class XMLFileFilter extends FileFilter { public boolean accept(File file) { return file.isDirectory() || file.getName().endsWith(".xml"); } public String getDescription() { return L10N.getLocalString("dlg.xmlsavedbugs_lbl", "XML saved bug files"); } } /** * The instance of XMLFileFilter. */ private static final FileFilter xmlFileFilter = new XMLFileFilter(); /** * Set of archive file extensions. */ private static final HashSet<String> archiveExtensionSet = new HashSet<String>(); static { archiveExtensionSet.add(".jar"); archiveExtensionSet.add(".zip"); archiveExtensionSet.add(".ear"); archiveExtensionSet.add(".war"); } /** * File filter for choosing archives and directories. */ private static class ArchiveAndDirectoryFilter extends FileFilter { public boolean accept(File file) { if (file.isDirectory()) return true; String fileName = file.getName(); int dot = fileName.lastIndexOf('.'); if (dot < 0) return false; String extension = fileName.substring(dot); return archiveExtensionSet.contains(extension); } public String getDescription() { return L10N.getLocalString("dlg.javaarchives_lbl", "Java archives (*.jar,*.zip,*.ear,*.war)"); } }; /** * The instance of ArchiveAndDirectoryFilter. */ private static final FileFilter archiveAndDirectoryFilter = new ArchiveAndDirectoryFilter(); /* ---------------------------------------------------------------------- * Constants * ---------------------------------------------------------------------- */ private static final String GROUP_BY_CLASS = "By class"; private static final String GROUP_BY_PACKAGE = "By package"; private static final String GROUP_BY_BUG_TYPE = "By bug type"; private static final String[] GROUP_BY_ORDER_LIST = { GROUP_BY_CLASS, GROUP_BY_PACKAGE, GROUP_BY_BUG_TYPE }; /** * A fudge value required in our hack to get the REAL maximum * divider location for a JSplitPane. Experience suggests that * the value "1" would work here, but setting it a little higher * makes the code a bit more robust. */ private static final int DIVIDER_FUDGE = 3; private static final boolean BUG_COUNT = Boolean.getBoolean("findbugs.gui.bugCount"); /* ---------------------------------------------------------------------- * Member fields * ---------------------------------------------------------------------- */ Component selectedComponent = null; /* ---------------------------------------------------------------------- * Constructor * ---------------------------------------------------------------------- */ /** * Creates new form FindBugsFrame. */ public FindBugsFrame() { String dirProp = System.getProperty("user.dir"); if (dirProp != null) { currentDirectory = new File(dirProp); } UserPreferences prefs = UserPreferences.getUserPreferences(); prefs.read(); prefs.loadUserDetectorPreferences(); initComponents(); postInitComponents(); } /* ---------------------------------------------------------------------- * Component initialization and event handlers * ---------------------------------------------------------------------- */ /** * This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents java.awt.GridBagConstraints gridBagConstraints; priorityButtonGroup = new javax.swing.ButtonGroup(); consoleSplitter = new javax.swing.JSplitPane(); viewPanel = new javax.swing.JPanel(); emptyPanel = new javax.swing.JPanel(); reportPanel = new javax.swing.JPanel(); editProjectPanel = new javax.swing.JPanel(); jarFileLabel = new javax.swing.JLabel(); jarNameTextField = new javax.swing.JTextField(); addJarButton = new javax.swing.JButton(); jarFileListLabel = new javax.swing.JLabel(); sourceDirLabel = new javax.swing.JLabel(); srcDirTextField = new javax.swing.JTextField(); addSourceDirButton = new javax.swing.JButton(); sourceDirListLabel = new javax.swing.JLabel(); removeJarButton = new javax.swing.JButton(); removeSrcDirButton = new javax.swing.JButton(); jSeparator1 = new javax.swing.JSeparator(); browseJarButton = new javax.swing.JButton(); browseSrcDirButton = new javax.swing.JButton(); editProjectLabel = new javax.swing.JLabel(); jSeparator2 = new javax.swing.JSeparator(); findBugsButton = new javax.swing.JButton(); jSeparator4 = new javax.swing.JSeparator(); jarFileListScrollPane = new javax.swing.JScrollPane(); jarFileList = new javax.swing.JList(); sourceDirListScrollPane = new javax.swing.JScrollPane(); sourceDirList = new javax.swing.JList(); classpathEntryLabel = new javax.swing.JLabel(); classpathEntryListLabel = new javax.swing.JLabel(); classpathEntryTextField = new javax.swing.JTextField(); browseClasspathEntryButton = new javax.swing.JButton(); addClasspathEntryButton = new javax.swing.JButton(); removeClasspathEntryButton = new javax.swing.JButton(); classpathEntryListScrollPane = new javax.swing.JScrollPane(); classpathEntryList = new javax.swing.JList(); jSeparator5 = new javax.swing.JSeparator(); sourceUpButton = new javax.swing.JButton(); sourceDownButton = new javax.swing.JButton(); classpathUpButton = new javax.swing.JButton(); classpathDownButton = new javax.swing.JButton(); bugTreePanel = new javax.swing.JPanel(); bugTreeBugDetailsSplitter = new javax.swing.JSplitPane(); groupByTabbedPane = new javax.swing.JTabbedPane(); byClassScrollPane = new javax.swing.JScrollPane(); byClassBugTree = new javax.swing.JTree(); byPackageScrollPane = new javax.swing.JScrollPane(); byPackageBugTree = new javax.swing.JTree(); byBugTypeScrollPane = new javax.swing.JScrollPane(); byBugTypeBugTree = new javax.swing.JTree(); bySummary = new javax.swing.JScrollPane(); bugSummaryEditorPane = new javax.swing.JEditorPane(); bugDetailsTabbedPane = new javax.swing.JTabbedPane(); bugDescriptionScrollPane = new javax.swing.JScrollPane(); bugDescriptionEditorPane = new javax.swing.JEditorPane(); sourceTextAreaScrollPane = new javax.swing.JScrollPane(); sourceTextArea = new javax.swing.JTextArea(); annotationTextAreaScrollPane = new javax.swing.JScrollPane(); annotationTextArea = new javax.swing.JTextArea(); consoleScrollPane = new javax.swing.JScrollPane(); consoleMessageArea = new javax.swing.JTextArea(); urlLabel = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); logoLabel = new javax.swing.JLabel(); growBoxSpacer = new javax.swing.JLabel(); theMenuBar = new javax.swing.JMenuBar(); fileMenu = new javax.swing.JMenu(); newProjectItem = new javax.swing.JMenuItem(); openProjectItem = new javax.swing.JMenuItem(); recentProjectsMenu = new javax.swing.JMenu(); jSeparator9 = new javax.swing.JSeparator(); closeProjectItem = new javax.swing.JMenuItem(); saveProjectItem = new javax.swing.JMenuItem(); saveProjectAsItem = new javax.swing.JMenuItem(); reloadProjectItem = new javax.swing.JMenuItem(); jSeparator3 = new javax.swing.JSeparator(); loadBugsItem = new javax.swing.JMenuItem(); saveBugsItem = new javax.swing.JMenuItem(); jSeparator6 = new javax.swing.JSeparator(); exitItem = new javax.swing.JMenuItem(); editMenu = new javax.swing.JMenu(); cutItem = new javax.swing.JMenuItem(); copyItem = new javax.swing.JMenuItem(); pasteItem = new javax.swing.JMenuItem(); jSeparator10 = new javax.swing.JSeparator(); selectAllItem = new javax.swing.JMenuItem(); viewMenu = new javax.swing.JMenu(); viewConsoleItem = new javax.swing.JCheckBoxMenuItem(); viewBugDetailsItem = new javax.swing.JCheckBoxMenuItem(); fullDescriptionsItem = new javax.swing.JCheckBoxMenuItem(); jSeparator7 = new javax.swing.JSeparator(); filterWarningsMenu = new javax.swing.JMenu(); expPriorityButton = new javax.swing.JRadioButtonMenuItem(); lowPriorityButton = new javax.swing.JRadioButtonMenuItem(); mediumPriorityButton = new javax.swing.JRadioButtonMenuItem(); highPriorityButton = new javax.swing.JRadioButtonMenuItem(); jSeparator11 = new javax.swing.JSeparator(); jSeparator8 = new javax.swing.JSeparator(); viewProjectItem = new javax.swing.JRadioButtonMenuItem(); viewBugsItem = new javax.swing.JRadioButtonMenuItem(); settingsMenu = new javax.swing.JMenu(); configureDetectorsItem = new javax.swing.JMenuItem(); helpMenu = new javax.swing.JMenu(); aboutItem = new javax.swing.JMenuItem(); getContentPane().setLayout(new java.awt.GridBagLayout()); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); consoleSplitter.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); consoleSplitter.setResizeWeight(1.0); consoleSplitter.setOneTouchExpandable(true); consoleSplitter.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { consoleSplitterPropertyChange(evt); } }); viewPanel.setLayout(new java.awt.CardLayout()); viewPanel.add(emptyPanel, "EmptyPanel"); viewPanel.add(reportPanel, "ReportPanel"); editProjectPanel.setLayout(new java.awt.GridBagLayout()); jarFileLabel.setFont(new java.awt.Font("Dialog", 0, 12)); jarFileLabel.setText("Archive or directory:"); jarFileLabel.setText(L10N.getLocalString("dlg.jarfile_lbl", "Archive or Directory:")); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 3);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -