]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Fix of "Me" user option presentation. getDisplayName is added to UserOption.
authorrkv <rkv@opencascade.com>
Wed, 17 Apr 2013 08:37:26 +0000 (08:37 +0000)
committerrkv <rkv@opencascade.com>
Wed, 17 Apr 2013 08:37:26 +0000 (08:37 +0000)
Workspace/Siman/src/org/splat/simer/ValidationFacade.java

index 065042a7e5d704e3558b1e8d90dbcc9a8c76e4f7..4dd4e573cafe866cda8e8bb800f0706c38ca4060 100644 (file)
@@ -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<BR>
+        * 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