Changeset 3952


Ignore:
Timestamp:
Nov 5, 2010, 10:51:24 AM (13 years ago)
Author:
olle
Message:

Refs #704. Refs #585. Refs #287. Project table tool bar updated
to remove the "Delete" button coupled to action DeleteItems,
and rename button "Trash Project" coupled to action TrashProject
to new name "Delete":

  1. Class/file action/project/ListMyProjects.java in client/servlet/

updated:

  1. Public method void runMe() updated to remove the "Delete" button

coupled to action DeleteItems from the tool bar of the project table.

  1. Class/file gui/Toolbar.java in client/servlet/ updated:

a Public method void clear() updated to first check if instance
variable ArrayList<AbstractLink> toolbar differs from null,
before calling its clear() method.

  1. English dictionary file locale/en/dictionary in client/servlet/

updated by changing the string value for key TrashProject
from "Trash Project" to "Delete".

Location:
trunk/client/servlet/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/locale/en/dictionary

    r3933 r3952  
    838838TotalPeaks=Total Peaks
    839839Trashcan=Trashcan
    840 TrashProject=Trash Project
     840TrashProject=Delete
    841841Trash=Trash
    842842TransparentCompression=Transparent compression
  • trunk/client/servlet/src/org/proteios/action/project/ListMyProjects.java

    r2748 r3952  
    2929
    3030import org.proteios.AbstractLink;
     31import org.proteios.ActionLink;
    3132import org.proteios.action.ConfigureTableFactory2;
    3233import org.proteios.action.ProteiosAction;
     34import org.proteios.action.write.DeleteItems;
    3335import org.proteios.core.Project;
    3436import org.proteios.core.data.ProjectData;
     
    4042import se.lu.thep.waf.ActionException;
    4143import se.lu.thep.waf.constraints.InvalidParameterValue;
     44
     45import java.util.ArrayList;
     46import java.util.List;
    4247
    4348public class ListMyProjects
     
    7075      // Toolbar
    7176      Toolbar tb = tbl.getToolbar();
     77      // Remove DeleteItems action from tool bar,
     78      // as TrashProject action is used to delete projects
     79      if (tb != null && tb.list() != null)
     80      {
     81        List<AbstractLink> tbAbstractLinks = new ArrayList<AbstractLink>();
     82        for (AbstractLink abstractLink: tb.list())
     83        {
     84          if (abstractLink instanceof ActionLink)
     85          {
     86            ActionLink al = (ActionLink) abstractLink;
     87            // Skip original Delete action
     88            if (!al.getActionId().equals(DeleteItems.class.getName()))
     89            {
     90              tbAbstractLinks.add(al);
     91            }
     92          }
     93          else
     94          {
     95            // This case includes PopupLinks added via TableToolbarContext etc.
     96            tbAbstractLinks.add(abstractLink);
     97          }
     98        }
     99        // Replace original tool bar with modified one
     100        tb.clear();
     101        for (AbstractLink al: tbAbstractLinks)
     102        {
     103          tb.add(al);
     104        }
     105      }
    72106      // Add "new project" button
    73107      tb.add(getActionFactory().getActionLink(NewProject.class,
  • trunk/client/servlet/src/org/proteios/gui/Toolbar.java

    r1916 r3952  
    5151  public void clear()
    5252  {
    53     toolbar.clear();
     53    if (toolbar != null)
     54    {
     55      toolbar.clear();
     56    }
    5457  }
    5558
Note: See TracChangeset for help on using the changeset viewer.