X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=Workspace%2FSiman%2Fsrc%2Forg%2Fsplat%2Fsimer%2FValidationFacade.java;h=4dd4e573cafe866cda8e8bb800f0706c38ca4060;hb=73018f1bd5b4a3e7fb21e5b6d78e012e29cffb1d;hp=065042a7e5d704e3558b1e8d90dbcc9a8c76e4f7;hpb=70ad7aa273dbede7c157fc32c0db9b943012f0e2;p=tools%2Fsiman.git diff --git a/Workspace/Siman/src/org/splat/simer/ValidationFacade.java b/Workspace/Siman/src/org/splat/simer/ValidationFacade.java index 065042a..4dd4e57 100644 --- a/Workspace/Siman/src/org/splat/simer/ValidationFacade.java +++ b/Workspace/Siman/src/org/splat/simer/ValidationFacade.java @@ -8,53 +8,132 @@ import org.splat.dal.bo.som.ValidationCycle; import org.splat.dal.bo.som.ValidationStep; import org.splat.kernel.Name; +/** + * Validation cycle presentation facade. + */ public class ValidationFacade { + /** + * Icon name. + */ private transient String _myicon; + /** + * Document type name. + */ private transient String _myname; + /** + * Publisher name. + */ private transient Name _mypublisher; + /** + * Reviewer name. + */ private transient Name _myreviewer; + /** + * Approver name. + */ private transient Name _myapprover; + /** + * Option presentation in users lists. + */ protected static class UserOption implements Name { + /** + * User name. + */ protected transient String _name; + /** + * User id. + */ protected transient long _index; /** * Create a localized named user option. - * @param key option label key - * @param locale current locale + * + * @param key + * option label key + * @param locale + * current locale */ public UserOption(final String key, final Locale locale) { super(); _name = ResourceBundle.getBundle("labels", locale).getString(key); } + /** + * {@inheritDoc} + * + * @see org.splat.kernel.Name#getIndex() + */ public long getIndex() { return _index; } + /** + * {@inheritDoc} + * + * @see java.lang.Object#toString() + */ @Override public String toString() { return _name; } + + /** + * Get user's display name. + * + * @return user's display name + */ + public String getDisplayName() { + return _name; + } } + /** + * Not applicable user option presentation. For example, if there is no review
+ * step, then reviewer will be undefined. + */ protected static class NotRequired extends UserOption { + /** + * Constructor. + * + * @param locale + * current locale + */ protected NotRequired(final Locale locale) { super("label.skipped", locale); _index = 0; } } + /** + * Author presentation. + */ protected static class ByAuthor extends UserOption { + /** + * Constructor. + * + * @param locale + * current locale + */ protected ByAuthor(final Locale locale) { super("label.bytheauthor", locale); _index = 0; } } + /** + * Current user presentation ("Me"). + */ protected static class ByManager extends UserOption { + /** + * Constructor. + * + * @param manager + * current user + * @param locale + * current locale + */ protected ByManager(final User manager, final Locale locale) { super("label.me", locale); _index = manager.getIndex(); @@ -65,6 +144,14 @@ public class ValidationFacade { // Constructors // ============================================================================================================================== + /** + * Constructor. + * + * @param cycle + * the presented validation cycle + * @param locale + * the current locale + */ public ValidationFacade(final ValidationCycle cycle, final Locale locale) { _myicon = "icon.empty.png"; if (cycle.isDefault()) { @@ -96,35 +183,75 @@ public class ValidationFacade { // Getters // ============================================================================================================================== + /** + * Get the document type of the validation cycle. + * + * @return document type name + */ public String getDocumentType() { return _myname; } + /** + * Get the approver id. + * + * @return user id + */ public long getApproverIndex() { return _myapprover.getIndex(); } + /** + * Get the approver name. + * + * @return user name + */ public String getApproverName() { return _myapprover.toString(); } + /** + * Get icon name. + * + * @return the icon name + */ public String getIcon() { return _myicon; } - public long getPublisherIndex() { - return _mypublisher.getIndex(); - } - + /** + * Get the publisher id. + * + * @return user id + */ public String getPublisherName() { return _mypublisher.toString(); } - public long getReviewerIndex() { - return _myreviewer.getIndex(); + /** + * Get the publisher id. + * + * @return user id + */ + public long getPublisherIndex() { + return _mypublisher.getIndex(); } + /** + * Get the reviewer id. + * + * @return user id + */ public String getReviewerName() { return _myreviewer.toString(); } + + /** + * Get the reviewer id. + * + * @return user id + */ + public long getReviewerIndex() { + return _myreviewer.getIndex(); + } } \ No newline at end of file