package org.skyve.metadata.controller;

import javax.xml.bind.annotation.XmlType;

import org.skyve.impl.util.XMLMetaData;
import org.skyve.util.Util;

/**
 * Actions implicit to skyve.
 */
@XmlType(namespace = XMLMetaData.VIEW_NAMESPACE)
public enum ImplicitActionName {
	/**
	 * Produce default button for the view type
	 */
	DEFAULTS("Defaults"),
	
	/**
	 * OK on edit view
	 */
	OK("OK"),
	
	/**
	 * Save on edit view
	 */
	Save("Save"),
	
	/**
	 * Delete on edit view
	 */
	Delete("Delete"),
	
	/**
	 * Add on child edit view
	 */
	Add("Add"),
	
	/**
	 * Change on child edit view
	 */
	ZoomOut("Zoom Out"),
	
	/**
	 * Cancel on edit view and child edit view
	 */
	Cancel("Cancel"),
	
	/**
	 * Remove on child edit view
	 */
	Remove("Remove"),
	
	/**
	 * Add new item in list view
	 */
	New("New"),
	
	/**
	 * Edit an item in list view
	 */
	Edit("Edit"),
	
	/**
	 * Fire up a report dialog from a button
	 */
	Report("Report"),
	
	/**
	 * Navigate to a binding within a conversation
	 */
	Navigate("Navigate"),
	
	/**
	 * Import data using the BizPort capability
	 */
	BizImport("Import"),
	
	/**
	 * Export data using the BizPort capability
	 */
	BizExport("Export"),
	
	/**
	 * Create and stream a file for Download
	 */
	Download("Download"),

	/**
	 * Upload and process a file
	 */
	Upload("Upload"),

	/**
	 * Prints the current view
	 */
	Print("Print");
	
	private String displayName;

	/**
	 * 
	 * @param displayName
	 */
	private ImplicitActionName(String displayName) {
		this.displayName = displayName;
	}

	/**
	 * 
	 * @return
	 */
	public String getDisplayName() {
		return displayName;
	}
	
	public String getLocalisedDisplayName() {
		return Util.i18n(displayName);
	}
}

@@ -331,17 +331,46 @@
 FAULTS(%22
-D
+resources.implicitActionName.d
 efaults%22
@@ -409,18 +409,47 @@
 */%0A%09OK(%22
-OK
+resources.implicitActionName.ok
 %22),%0A%09%0A%09/
@@ -485,17 +485,46 @@
 %0A%09Save(%22
-S
+resources.implicitActionName.s
 ave%22),%0A%09
@@ -567,17 +567,46 @@
 Delete(%22
-D
+resources.implicitActionName.d
 elete%22),
@@ -651,17 +651,46 @@
 /%0A%09Add(%22
-A
+resources.implicitActionName.a
 dd%22),%0A%09%0A
@@ -743,13 +743,41 @@
 ut(%22
-Zoom 
+resources.implicitActionName.zoom
 Out%22
@@ -844,17 +844,46 @@
 Cancel(%22
-C
+resources.implicitActionName.c
 ancel%22),
@@ -934,17 +934,46 @@
 Remove(%22
-R
+resources.implicitActionName.r
 emove%22),
@@ -1021,17 +1021,46 @@
 /%0A%09New(%22
-N
+resources.implicitActionName.n
 ew%22),%0A%09%0A
@@ -1106,17 +1106,46 @@
 %0A%09Edit(%22
-E
+resources.implicitActionName.e
 dit%22),%0A%09
@@ -1206,17 +1206,46 @@
 Report(%22
-R
+resources.implicitActionName.r
 eport%22),
@@ -1316,17 +1316,46 @@
 vigate(%22
-N
+resources.implicitActionName.n
 avigate%22
@@ -1426,17 +1426,46 @@
 Import(%22
-I
+resources.implicitActionName.i
 mport%22),
@@ -1534,17 +1534,46 @@
 Export(%22
-E
+resources.implicitActionName.e
 xport%22),
@@ -1638,17 +1638,46 @@
 wnload(%22
-D
+resources.implicitActionName.d
 ownload%22
@@ -1729,17 +1729,46 @@
 Upload(%22
-U
+resources.implicitActionName.u
 pload%22),
@@ -1815,17 +1815,46 @@
 %09Print(%22
-P
+resources.implicitActionName.p
 rint%22);%0A

Use i18n keys in implicit names.