Ignore:
Timestamp:
Feb 24, 2012, 8:33:47 AM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #1655: GUI improvements

Show name of subtype if available in list with inherited annotations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/annotations/list_annotations.jsp

    r5946 r5984  
    3636  import="net.sf.basedb.core.Unit"
    3737  import="net.sf.basedb.core.Nameable"
     38  import="net.sf.basedb.core.Subtypable"
     39  import="net.sf.basedb.core.ItemSubtype"
    3840  import="net.sf.basedb.core.ItemQuery"
    3941  import="net.sf.basedb.core.ItemResultList"
     
    424426              Formatter formatter = FormatterFactory.getAnnotationFormatter(sc, ann, null);
    425427              Nameable aItem = null;
     428              String fromType = a.getItemType().toString();
    426429              try
    427430              {
     
    431434              catch (PermissionDeniedException ex)
    432435              {}
    433               %>
     436              if (aItem instanceof Subtypable)
     437              {
     438                try
     439                {
     440                  ItemSubtype subtype = ((Subtypable)aItem).getItemSubtype();
     441                  if (subtype != null) fromType = subtype.getName();
     442                }
     443                catch (PermissionDeniedException ex)
     444                {}
     445              }             %>
    434446              <tbl:row>
    435                 <tbl:cell column="annotation"><base:icon image="<%=icon%>" />&nbsp;<%=Base.getLinkedName(ID, at, at == null, true)%></tbl:cell>
    436                 <tbl:cell column="item"><%=Base.getLinkedName(ID, aItem, aItem == null, true)%><%=aItem != null ? " ["+aItem.getType()+"]" : ""%></tbl:cell>
     447                <tbl:cell column="annotation"><base:icon image="<%=icon%>" /><%=Base.getLinkedName(ID, at, at == null, true)%></tbl:cell>
     448                <tbl:cell column="item"><%=Base.getLinkedName(ID, aItem, aItem == null, true)%><%=aItem != null ? " <span class=\"itemsubtype\">("+fromType+")</span>" : ""%></tbl:cell>
    437449                <tbl:cell column="values">
    438450                  <%=values == null || values.size() == 0 ?
Note: See TracChangeset for help on using the changeset viewer.