Package edu.umd.cs.findbugs.gui2
Class GUISaveState
- java.lang.Object
-
- edu.umd.cs.findbugs.gui2.GUISaveState
-
public class GUISaveState extends java.lang.ObjectSaves all the stuff that should be saved for each run, like recent projects, previous comments, the current docking layout and the sort order For project related things, look in ProjectSettings
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]COMMENTKEYSprivate static java.lang.StringCUSTOM_PLUGINSprivate java.util.LinkedHashSet<java.net.URI>customPluginsprivate static Sortables[]DEFAULT_COLUMN_HEADERSprivate static java.lang.StringDISABLED_PLUGINSprivate java.util.List<java.lang.String>disabledPluginsprivate byte[]dockingLayoutprivate static java.lang.StringDOCKINGLAYOUTprivate static java.lang.StringENABLED_PLUGINSprivate java.util.List<java.lang.String>enabledPluginsprivate static java.lang.StringEXTENDED_WINDOW_STATEprivate intextendedWindowStateFor Windows mainly - whether the window was maximized or notprivate static java.lang.StringFONT_SIZEprivate floatfontSizeprivate static java.lang.StringFRAME_BOUNDSprivate java.awt.RectangleframeBoundsprivate static GUISaveStateinstanceprivate static intMAXNUMPREVCOMMENTS(package private) static intMAXNUMRECENTPROJECTSprivate static java.lang.StringNUMPROJECTSprivate static java.lang.StringPACKAGE_PREFIX_SEGEMENTSprivate intpackagePrefixSegmentsprivate static java.lang.StringPREVCOMMENTSSIZEprivate java.util.LinkedList<java.lang.String>previousCommentsList of previous comments by the user.private java.util.ArrayList<java.io.File>recentFilesprivate static java.lang.String[]RECENTPROJECTKEYSprivate Sortables[]sortColumnsprivate static java.lang.StringSORTERTABLELENGTHprivate static java.lang.StringSPLIT_MAINprivate static java.lang.StringSPLIT_SUMMARY_NEWprivate static java.lang.StringSPLIT_TOPprivate static java.lang.StringSPLIT_TREE_COMMENTSprivate intsplitMainprivate intsplitSummaryprivate intsplitTopprivate intsplitTreeCommentsprivate static java.lang.StringSTARTERDIRECTORYprivate java.io.FilestarterDirectoryForLoadBugsprivate SorterTableColumnModelstarterTableprivate static java.lang.StringTAB_SIZEprivate inttabSizeprivate booleanuseDefault
-
Constructor Summary
Constructors Modifier Constructor Description privateGUISaveState()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddCustomPlugin(java.net.URL u)voidaddRecentFile(java.io.File f)This should be the method used to add a file for the recent menu.(package private) static voidclear()voidfileNotFound(java.io.File f)Call to remove a file from the list.voidfileReused(java.io.File f)This should be the method called to add a reused file for the recent menu.private static java.lang.String[]generateSorterKeys(int numSorters)java.util.Collection<java.net.URI>getCustomPlugins()java.util.List<java.lang.String>getDisabledPlugins()byte[]getDockingLayout()java.util.List<java.lang.String>getEnabledPlugins()intgetExtendedWindowState()floatgetFontSize()java.awt.RectanglegetFrameBounds()static GUISaveStategetInstance()intgetPackagePrefixSegments()java.util.LinkedList<java.lang.String>getPreviousComments()java.util.ArrayList<java.io.File>getRecentFiles()Returns the list of recent files.intgetSplitMain()intgetSplitSummary()intgetSplitTop()java.io.FilegetStarterDirectoryForLoadBugs()The file to start the loading of Bugs from.(package private) SorterTableColumnModelgetStarterTable()intgetTabSize()static voidloadInstance()booleanremoveCustomPlugin(java.net.URL pluginId)voidsave()voidsetDockingLayout(byte[] dockingLayout)voidsetExtendedWindowState(int extendedWindowState)voidsetFontSize(float fontSize)voidsetFrameBounds(java.awt.Rectangle frameBounds)voidsetPackagePrefixSegments(int packagePrefixSegments)voidsetPluginEnabled(java.lang.String url)voidsetPluginsEnabled(java.util.List<java.lang.String> enabledPlugins, java.util.List<java.lang.String> disabledPlugins)voidsetPreviousComments(java.util.LinkedList<java.lang.String> previousComments)voidsetSplitMain(int splitMain)voidsetSplitSummary(int splitSummary)voidsetSplitTop(int splitTop)voidsetStarterDirectoryForLoadBugs(java.io.File f)voidsetTabSize(int tabSize)
-
-
-
Field Detail
-
instance
private static GUISaveState instance
-
SORTERTABLELENGTH
private static final java.lang.String SORTERTABLELENGTH
- See Also:
- Constant Field Values
-
PREVCOMMENTSSIZE
private static final java.lang.String PREVCOMMENTSSIZE
- See Also:
- Constant Field Values
-
DOCKINGLAYOUT
private static final java.lang.String DOCKINGLAYOUT
- See Also:
- Constant Field Values
-
FRAME_BOUNDS
private static final java.lang.String FRAME_BOUNDS
- See Also:
- Constant Field Values
-
EXTENDED_WINDOW_STATE
private static final java.lang.String EXTENDED_WINDOW_STATE
- See Also:
- Constant Field Values
-
MAXNUMRECENTPROJECTS
static final int MAXNUMRECENTPROJECTS
- See Also:
- Constant Field Values
-
DEFAULT_COLUMN_HEADERS
private static final Sortables[] DEFAULT_COLUMN_HEADERS
-
RECENTPROJECTKEYS
private static final java.lang.String[] RECENTPROJECTKEYS
-
MAXNUMPREVCOMMENTS
private static final int MAXNUMPREVCOMMENTS
- See Also:
- Constant Field Values
-
COMMENTKEYS
private static final java.lang.String[] COMMENTKEYS
-
NUMPROJECTS
private static final java.lang.String NUMPROJECTS
- See Also:
- Constant Field Values
-
STARTERDIRECTORY
private static final java.lang.String STARTERDIRECTORY
- See Also:
- Constant Field Values
-
SPLIT_MAIN
private static final java.lang.String SPLIT_MAIN
- See Also:
- Constant Field Values
-
SPLIT_TREE_COMMENTS
private static final java.lang.String SPLIT_TREE_COMMENTS
- See Also:
- Constant Field Values
-
SPLIT_TOP
private static final java.lang.String SPLIT_TOP
- See Also:
- Constant Field Values
-
SPLIT_SUMMARY_NEW
private static final java.lang.String SPLIT_SUMMARY_NEW
- See Also:
- Constant Field Values
-
TAB_SIZE
private static final java.lang.String TAB_SIZE
- See Also:
- Constant Field Values
-
FONT_SIZE
private static final java.lang.String FONT_SIZE
- See Also:
- Constant Field Values
-
PACKAGE_PREFIX_SEGEMENTS
private static final java.lang.String PACKAGE_PREFIX_SEGEMENTS
- See Also:
- Constant Field Values
-
ENABLED_PLUGINS
private static final java.lang.String ENABLED_PLUGINS
- See Also:
- Constant Field Values
-
DISABLED_PLUGINS
private static final java.lang.String DISABLED_PLUGINS
- See Also:
- Constant Field Values
-
CUSTOM_PLUGINS
private static final java.lang.String CUSTOM_PLUGINS
- See Also:
- Constant Field Values
-
splitMain
private int splitMain
-
splitTreeComments
private int splitTreeComments
-
splitTop
private int splitTop
-
splitSummary
private int splitSummary
-
starterDirectoryForLoadBugs
private java.io.File starterDirectoryForLoadBugs
-
previousComments
private java.util.LinkedList<java.lang.String> previousComments
List of previous comments by the user.
-
useDefault
private boolean useDefault
-
starterTable
private SorterTableColumnModel starterTable
-
sortColumns
private Sortables[] sortColumns
-
recentFiles
private java.util.ArrayList<java.io.File> recentFiles
-
dockingLayout
private byte[] dockingLayout
-
frameBounds
private java.awt.Rectangle frameBounds
-
extendedWindowState
private int extendedWindowState
For Windows mainly - whether the window was maximized or not
-
tabSize
private int tabSize
-
fontSize
private float fontSize
-
packagePrefixSegments
private int packagePrefixSegments
-
enabledPlugins
private java.util.List<java.lang.String> enabledPlugins
-
disabledPlugins
private java.util.List<java.lang.String> disabledPlugins
-
customPlugins
private final java.util.LinkedHashSet<java.net.URI> customPlugins
-
-
Method Detail
-
generateSorterKeys
private static java.lang.String[] generateSorterKeys(int numSorters)
-
getInstance
public static GUISaveState getInstance()
-
loadInstance
public static void loadInstance()
-
clear
static void clear()
-
getTabSize
public int getTabSize()
-
setTabSize
public void setTabSize(int tabSize)
-
getPackagePrefixSegments
public int getPackagePrefixSegments()
-
setPackagePrefixSegments
public void setPackagePrefixSegments(int packagePrefixSegments)
-
getDockingLayout
public byte[] getDockingLayout()
-
setDockingLayout
public void setDockingLayout(byte[] dockingLayout)
-
fileReused
public void fileReused(java.io.File f)
This should be the method called to add a reused file for the recent menu.
-
addRecentFile
public void addRecentFile(java.io.File f)
This should be the method used to add a file for the recent menu.- Parameters:
f-
-
getRecentFiles
public java.util.ArrayList<java.io.File> getRecentFiles()
Returns the list of recent files.- Returns:
- the list of recent files
-
fileNotFound
public void fileNotFound(java.io.File f)
Call to remove a file from the list.- Parameters:
f-
-
getStarterDirectoryForLoadBugs
public java.io.File getStarterDirectoryForLoadBugs()
The file to start the loading of Bugs from.- Returns:
- Returns the starterDirectoryForLoadBugs.
-
setStarterDirectoryForLoadBugs
public void setStarterDirectoryForLoadBugs(java.io.File f)
- Parameters:
f- The starterDirectoryForLoadBugs to set.
-
save
public void save()
-
getPreviousComments
public java.util.LinkedList<java.lang.String> getPreviousComments()
- Returns:
- Returns the previousComments.
-
setPreviousComments
public void setPreviousComments(java.util.LinkedList<java.lang.String> previousComments)
- Parameters:
previousComments- The previousComments to set.
-
getFrameBounds
public java.awt.Rectangle getFrameBounds()
- Returns:
- Returns the frame bounds Rectangle.
-
setFrameBounds
public void setFrameBounds(java.awt.Rectangle frameBounds)
- Parameters:
frameBounds- The frame bourds Rectangle to set.
-
getExtendedWindowState
public int getExtendedWindowState()
-
setExtendedWindowState
public void setExtendedWindowState(int extendedWindowState)
-
getFontSize
public float getFontSize()
- Returns:
- Returns the fontSize.
-
setFontSize
public void setFontSize(float fontSize)
- Parameters:
fontSize- The fontSize to set.
-
getSplitMain
public int getSplitMain()
- Returns:
- Returns the location of the main divider.
-
setSplitMain
public void setSplitMain(int splitMain)
- Parameters:
splitMain- The location of the main divider to set.
-
getSplitSummary
public int getSplitSummary()
- Returns:
- Returns the location of the summary divider.
-
setSplitSummary
public void setSplitSummary(int splitSummary)
- Parameters:
splitSummary- The location of the summary divider to set.
-
getSplitTop
public int getSplitTop()
- Returns:
- Returns the location of the top divider.
-
setSplitTop
public void setSplitTop(int splitTop)
- Parameters:
splitTop- The location of the top divider to set.
-
setPluginsEnabled
public void setPluginsEnabled(java.util.List<java.lang.String> enabledPlugins, java.util.List<java.lang.String> disabledPlugins)
-
setPluginEnabled
public void setPluginEnabled(java.lang.String url)
-
getEnabledPlugins
public java.util.List<java.lang.String> getEnabledPlugins()
-
getCustomPlugins
public java.util.Collection<java.net.URI> getCustomPlugins()
-
addCustomPlugin
public boolean addCustomPlugin(java.net.URL u)
-
getDisabledPlugins
public java.util.List<java.lang.String> getDisabledPlugins()
-
removeCustomPlugin
public boolean removeCustomPlugin(java.net.URL pluginId)
-
getStarterTable
SorterTableColumnModel getStarterTable()
-
-