Class MainFrame

All Implemented Interfaces:
LogSync, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class MainFrame extends FBFrame implements LogSync
See Also:
  • Field Details

    • GUI2_DEBUG

      public static final boolean GUI2_DEBUG
    • MAC_OS_X

      public static final boolean MAC_OS_X
    • SEARCH_TEXT_FIELD_SIZE

      private static final int SEARCH_TEXT_FIELD_SIZE
      See Also:
    • TITLE_START_TXT

      public static final String TITLE_START_TXT
      See Also:
    • WINDOW_MODIFIED

      private static final String WINDOW_MODIFIED
      See Also:
    • USE_WINDOWS_LAF

      public static final boolean USE_WINDOWS_LAF
      See Also:
    • instance

      private static MainFrame instance
    • guiCallback

      private final MainFrame.MyGuiCallback guiCallback
    • bugCollection

      private BugCollection bugCollection
    • currentSelectedBugAspects

      private BugAspects currentSelectedBugAspects
    • curProject

      private volatile Project curProject
    • newProject

      private volatile boolean newProject
    • projectPackagePrefixes

      private final ProjectPackagePrefixes projectPackagePrefixes
    • logger

      private final Logger logger
    • saveFile

      @CheckForNull private File saveFile
    • backgroundExecutor

      private final ExecutorService backgroundExecutor
    • mainFrameInitialized

      private final CountDownLatch mainFrameInitialized
    • waitCount

      private int waitCount
    • waitLock

      private final Object waitLock
    • errorMsg

      private volatile String errorMsg
    • projectChanged

      private boolean projectChanged
    • guiLayout

      private final FindBugsLayoutManager guiLayout
    • statusBarLabel

      private final JLabel statusBarLabel
    • sourceSearchTextField

      private final JTextField sourceSearchTextField
    • findButton

      private final JButton findButton
    • findNextButton

      private final JButton findNextButton
    • findPreviousButton

      private final JButton findPreviousButton
    • sourceCodeTextPane

      private final NavigableTextPane sourceCodeTextPane
    • summaryTopPanel

      private JPanel summaryTopPanel
    • summaryHtmlArea

      JEditorPane summaryHtmlArea
    • summaryHtmlScrollPane

      private final JScrollPane summaryHtmlScrollPane
    • displayer

      private final SourceCodeDisplay displayer
    • viewFilter

      private final ViewFilter viewFilter
    • saveType

      private SaveType saveType
    • mainFrameLoadSaveHelper

      private final MainFrameLoadSaveHelper mainFrameLoadSaveHelper
    • mainFrameTree

      final MainFrameTree mainFrameTree
    • mainFrameMenu

      final MainFrameMenu mainFrameMenu
    • mainFrameComponentFactory

      private final MainFrameComponentFactory mainFrameComponentFactory
    • previousDecrementToZero

      volatile Exception previousDecrementToZero
  • Constructor Details

  • Method Details

    • makeInstance

      public static void makeInstance(FindBugsLayoutManagerFactory factory)
    • getInstance

      public static MainFrame getInstance()
    • showMessageDialog

      public void showMessageDialog(String message)
    • showConfirmDialog

      public int showConfirmDialog(String message, String title, String ok, String cancel)
    • getGuiCallback

      public IGuiCallback getGuiCallback()
    • acquireDisplayWait

      public void acquireDisplayWait()
    • releaseDisplayWait

      public void releaseDisplayWait()
    • waitUntilReady

      public void waitUntilReady() throws InterruptedException
      Throws:
      InterruptedException
    • getTree

      public JTree getTree()
    • getBugTreeModel

      public BugTreeModel getBugTreeModel()
    • getProject

      @Nonnull public Project getProject()
    • setProject

      public void setProject(Project p)
    • setProjectChanged

      public void setProjectChanged(boolean b)
      Called when something in the project is changed and the change needs to be saved. This method should be called instead of using projectChanged = b.
    • error

      public void error(String message)
      Show an error dialog.
      Specified by:
      error in interface LogSync
    • writeToLog

      public void writeToLog(String message)
      Write a message to stdout.
      Specified by:
      writeToLog in interface LogSync
    • showConfirmDialog

      public int showConfirmDialog(String message, String title, int optionType)
    • getAvailableSortables

      public Sortables[] getAvailableSortables()
    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class FBFrame
    • updateStatusBar

      void updateStatusBar()
    • callOnClose

      void callOnClose()
      This method is called when the application is closing. This is either by the exit menuItem or by clicking on the window's system menu.
    • createRecentItem

      JMenuItem createRecentItem(File f, SaveType localSaveType)
    • openAnalysis

      public boolean openAnalysis(File f, SaveType saveType)
      Opens the analysis. Also clears the source and summary panes. Makes comments enabled false. Sets the saveType and adds the file to the recent menu.
      Parameters:
      f -
      Returns:
      whether the operation was successful
    • openBugCollection

      public void openBugCollection(SortedBugCollection bugs)
    • clearBugCollection

      void clearBugCollection()
    • setBugCollection

      void setBugCollection(BugCollection bugCollection)
    • setProjectAndBugCollectionInSwingThread

      void setProjectAndBugCollectionInSwingThread(Project project, BugCollection bc)
    • setProjectAndBugCollection

      private void setProjectAndBugCollection(@CheckForNull Project project, @CheckForNull BugCollection bugCollection)
    • updateProjectAndBugCollection

      void updateProjectAndBugCollection(BugCollection bugCollection)
    • shouldDisplayIssue

      boolean shouldDisplayIssue(BugInstance b)
    • createNewProjectFromMenuItem

      public void createNewProjectFromMenuItem()
    • newProject

      void newProject()
    • about

      void about()
    • preferences

      void preferences()
    • redoAnalysis

      void redoAnalysis()
    • syncBugInformation

      void syncBugInformation()
    • clearSourcePane

      void clearSourcePane()
    • initializeGUI

      private void initializeGUI()
    • statusBar

      JPanel statusBar()
    • summaryTab

      JSplitPane summaryTab()
    • createSourceCodePanel

      JPanel createSourceCodePanel()
    • createSourceSearchPanel

      JPanel createSourceSearchPanel()
    • setSourceTab

      void setSourceTab(String title, @CheckForNull BugInstance bug)
      Sets the title of the source tabs for either docking or non-docking versions.
    • getSorter

    • getActionWithoutSavingMsg

      private String getActionWithoutSavingMsg(String action)
    • updateBugTree

      public void updateBugTree()
    • resetViewCache

      public void resetViewCache()
    • updateTitle

      public void updateTitle()
      Changes the title based on curProject and saveFile.
    • shouldDisplayIssueIgnoringPackagePrefixes

      private boolean shouldDisplayIssueIgnoringPackagePrefixes(BugInstance b)
    • selectPackagePrefixByProject

      public void selectPackagePrefixByProject()
    • join

      private static String join(String s1, String s2)
    • updateSummaryTab

      private void updateSummaryTab(BugLeafNode node)
    • clearSummaryTab

      public void clearSummaryTab()
    • searchSource

      public void searchSource(int type)
    • createProjectSettings

      public void createProjectSettings()
    • addFileToRecent

      public void addFileToRecent(File xmlFile)
    • setSaveType

      public void setSaveType(SaveType saveType)
    • getSaveType

      public SaveType getSaveType()
    • getCurrentSelectedBugLeaf

      public BugLeafNode getCurrentSelectedBugLeaf()
    • getCurrentSelectedBugAspects

      public BugAspects getCurrentSelectedBugAspects()
    • getSourceCodeTextPane

      public NavigableTextPane getSourceCodeTextPane()
    • getBugCollection

      public BugCollection getBugCollection()
    • isProjectChanged

      public boolean isProjectChanged()
    • getSaveFile

      public File getSaveFile()
    • getCurrentProject

      public Project getCurrentProject()
    • getSaveMenuItem

      public JMenuItem getSaveMenuItem()
    • setSaveFile

      public void setSaveFile(File saveFile)
    • getBackgroundExecutor

      public ExecutorService getBackgroundExecutor()
    • getReconfigMenuItem

      public JMenuItem getReconfigMenuItem()
    • getSourceCodeDisplayer

      public SourceCodeDisplay getSourceCodeDisplayer()
    • getProjectPackagePrefixes

      public ProjectPackagePrefixes getProjectPackagePrefixes()
    • enableRecentMenu

      public void enableRecentMenu(boolean enable)
    • setCurrentSelectedBugAspects

      public void setCurrentSelectedBugAspects(BugAspects currentSelectedBugAspects)
    • getViewFilter

      public ViewFilter getViewFilter()
    • getCurProject

      public Project getCurProject()
    • getMainFrameLoadSaveHelper

      public MainFrameLoadSaveHelper getMainFrameLoadSaveHelper()
    • getGuiLayout

      public FindBugsLayoutManager getGuiLayout()
    • getMainFrameTree

      public MainFrameTree getMainFrameTree()
    • projectChanged

      public boolean projectChanged()
    • getMainFrameMenu

      public MainFrameMenu getMainFrameMenu()
    • getSummaryHtmlArea

      public JEditorPane getSummaryHtmlArea()
    • getStatusBarLabel

      public JLabel getStatusBarLabel()
    • getFindNextButton

      public JButton getFindNextButton()
    • getSummaryHtmlScrollPane

      public JScrollPane getSummaryHtmlScrollPane()
    • getFindPreviousButton

      public JButton getFindPreviousButton()
    • getSourceSearchTextField

      public JTextField getSourceSearchTextField()
    • getFindButton

      public JButton getFindButton()
    • getSummaryTopPanel

      public JPanel getSummaryTopPanel()
    • setSummaryTopPanel

      public void setSummaryTopPanel(JPanel summaryTopPanel)
    • waitForMainFrameInitialized

      void waitForMainFrameInitialized()