package com.alexrnl.commons.translation;


/**
 * This class is defining the translation for a dialog.<br />
 * A standard dialog is composed of a title and a message, this class factorise the definition of
 * the keys for these data and uses the {@link #toString()} method to build the key.<br />
 * This class also implements the {@link ParametrableTranslation} interface which returns an empty
 * parameter array by default (i.e. no parameter are accepted by this dialog); override the method
 * {@link #getParameters()} if necessary.
 * Example of implementation (with the use of the parameters):
 * <pre>
 * public class HelloDialog extends AbstractDialog {
 * 	private helloKey;
 * 	private parameters;
 * 
 * 	public HelloDialog (String name) {
 * 		super();
 * 		this.helloKey = "commons.dialogs.hello";
 * 		this.parameters = new Object[1];
 * 		Object[0] = name;
 * 	}
 * 
 *	public String toString () {
 *		return helloKey;
 *	}
 *
 *	public Object[] getParameters () {
 *		return parameters
 *	}
 *	
 * }
 * </pre>
 * @author Alex
 */
public abstract class AbstractDialog implements ParametrableTranslation {
	
	/**
	 * The title of the dialog.
	 * @return the translation of the dialog's title.
	 */
	public String title () {
		return toString() + "." + "title";
	}
	
	/**
	 * The message of the dialog.
	 * @return the translation of the dialog's message.
	 */
	public String message () {
		return toString() + "." + "message";
	}

	/**
	 * Provide the key to the dialog, which allow to define the {@link #title()} and
	 * {@link #message()} method at this level.
	 */
	@Override
	public abstract String toString ();

	/**
	 * By default, all dialogs are parametrable
	 */
	@Override
	public Object[] getParameters () {
		return new Object[0];
	}
}

@@ -668,16 +668,23 @@
 private 
+String 
 helloKey
@@ -696,16 +696,25 @@
 %09private
+ Object%5B%5D
  paramet
@@ -864,22 +864,26 @@
 %5D;%0A * %09%09
-Object
+parameters
 %5B0%5D = na
@@ -990,24 +990,24 @@
 meters () %7B%0A
-
  *%09%09return p
@@ -1015,16 +1015,17 @@
 rameters
+;
 %0A *%09%7D%0A *

Fix class javadoc