Changeset 4094


Ignore:
Timestamp:
Jan 13, 2011, 12:57:33 PM (12 years ago)
Author:
olle
Message:

Refs #735. Class/file action/job/ListJobs.java in client/servlet/ updated to remove the automatically added "Delete" button coupled to action DeleteItems:

  1. Public method void runMe() updated to remove the automatically added "Delete" button coupled to action DeleteItems from the tool bar of the jobs table.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/action/job/ListJobs.java

    r4030 r4094  
    2828package org.proteios.action.job;
    2929
     30import org.proteios.AbstractLink;
    3031import org.proteios.ActionLink;
    3132import org.proteios.action.ConfigureTableFactory2;
    3233import org.proteios.action.ProteiosAction;
     34import org.proteios.action.write.DeleteItems;
    3335import org.proteios.action.write.DeleteJobs;
    3436import org.proteios.core.DbControl;
     
    6062import se.lu.thep.waf.constraints.InvalidParameterValue;
    6163
     64import java.util.ArrayList;
    6265import java.util.List;
    6366
     
    317320      // Get tool bar
    318321      tb = tbl.getToolbar();
     322      // Remove DeleteItems action from tool bar,
     323      // as DeleteJobs action is used to delete jobs
     324      if (tb != null && tb.list() != null)
     325      {
     326        List<AbstractLink> tbAbstractLinks = new ArrayList<AbstractLink>();
     327        for (AbstractLink abstractLink: tb.list())
     328        {
     329          if (abstractLink instanceof ActionLink)
     330          {
     331            ActionLink al = (ActionLink) abstractLink;
     332            // Skip original Delete action
     333            if (!al.getActionId().equals(DeleteItems.class.getName()))
     334            {
     335              tbAbstractLinks.add(al);
     336            }
     337          }
     338          else
     339          {
     340            // This case includes PopupLinks added via TableToolbarContext etc.
     341            tbAbstractLinks.add(abstractLink);
     342          }
     343        }
     344        // Replace original tool bar with modified one
     345        tb.clear();
     346        for (AbstractLink al: tbAbstractLinks)
     347        {
     348          tb.add(al);
     349        }
     350      }
    319351      // Button for putting job in high priority queue
    320352      putJobInHighPriorityQueueAction = getActionFactory().getActionLink(
Note: See TracChangeset for help on using the changeset viewer.