com.realtime.crossfire.jxclient.window
Class DialogStateParser

java.lang.Object
  extended by com.realtime.crossfire.jxclient.window.DialogStateParser

public class DialogStateParser
extends java.lang.Object

Utility class to store or restore the dialog states to/from a file.


Field Summary
private static java.util.regex.Pattern PATTERN
          The pattern to split fields in the save file.
 
Constructor Summary
private DialogStateParser()
          Private constructor to prevent instantiation.
 
Method Summary
static void load(JXCSkin skin, JXCWindowRenderer windowRenderer)
          Load the dialogs state from a file.
static void save(JXCSkin skin, JXCWindowRenderer windowRenderer)
          Save the dialogs state to a file.
private static void saveDialog(Gui dialog, java.lang.String type, java.io.Writer bw)
          Save the state of one dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATTERN

@NotNull
private static final java.util.regex.Pattern PATTERN
The pattern to split fields in the save file.

Constructor Detail

DialogStateParser

private DialogStateParser()
Private constructor to prevent instantiation.

Method Detail

load

public static void load(@NotNull
                        JXCSkin skin,
                        @NotNull
                        JXCWindowRenderer windowRenderer)
Load the dialogs state from a file.

Parameters:
skin - the skin to update
windowRenderer - the window renderer instance to attach to

save

public static void save(@NotNull
                        JXCSkin skin,
                        @NotNull
                        JXCWindowRenderer windowRenderer)
Save the dialogs state to a file.

Parameters:
skin - the skin to update
windowRenderer - the window renderer instance to attach to

saveDialog

private static void saveDialog(@NotNull
                               Gui dialog,
                               @NotNull
                               java.lang.String type,
                               @NotNull
                               java.io.Writer bw)
                        throws java.io.IOException
Save the state of one dialog.

Parameters:
dialog - The dialog to save.
type - The dialog state; either "open" or "close".
bw - The writer to use.
Throws:
java.io.IOException - If an I/O error occurs.