public class SwingSession extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SwingSession.Action |
static class |
SwingSession.RestoreStateAction |
static class |
SwingSession.SaveStateAction |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoSave |
protected File |
file |
protected Set<Component> |
registeredComponent |
protected Map<Class,State> |
stateManager
State object registered to get and set State.
|
protected Map<String,State> |
states
state of all component added with add method.
|
| Constructor and Description |
|---|
SwingSession(File file,
boolean autoSave) |
SwingSession(File file,
boolean autoSave,
Map<Class,State> additionalStates) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Component c) |
void |
add(Component c,
boolean replace) |
void |
addToStateManager(Class component,
State state) |
protected void |
finalize() |
protected String |
getComponentName(Component c) |
File |
getFile() |
State |
getStateManager(Class clazz) |
State |
getStates(String path) |
Map<String,State> |
loadStates(File file)
Loads the states from the file
|
static SwingSession |
newSession(File file,
boolean autoSave)
Create a new swing session with the given parameters.
|
static SwingSession |
newSession(File file,
boolean autoSave,
Map<Class,State> additionalStates)
Create a new swing session with the given parameters.
|
void |
remove(Component c)
Remove component from component to save
|
void |
save() |
void |
setStates(String path,
State state) |
void |
updateState() |
protected void |
walkThrowComponent(String path,
Collection<Component> roots,
SwingSession.Action action) |
protected File file
protected boolean autoSave
protected Map<Class,State> stateManager
public SwingSession(File file, boolean autoSave) throws IOException
IOExceptionpublic SwingSession(File file, boolean autoSave, Map<Class,State> additionalStates) throws IOException
IOExceptionpublic static SwingSession newSession(File file, boolean autoSave)
public static SwingSession newSession(File file, boolean autoSave, Map<Class,State> additionalStates)
public File getFile()
protected void finalize()
throws Throwable
public void save()
throws IOException
IOExceptionpublic Map<String,State> loadStates(File file) throws IOException
IOExceptionpublic void updateState()
public void add(Component c)
public void add(Component c, boolean replace)
public void remove(Component c)
c - protected void walkThrowComponent(String path, Collection<Component> roots, SwingSession.Action action)
Copyright © 2008–2014 CodeLutin. All rights reserved.