************* LIST ITEM ACTIONS ****************
500447
boolean appendCrossed(StringBuilderVar block) {
        int iMax = matchLength();
        for (int i = 0; i < iMax; i++) {
            block.append(CROSSED_OUT);
        }
        return true;
    }
1000122
public void apply(List items) {
        //If the list is empty avoid sorting and adding headers.
        int size = items.size();
        if (size > 0) {
            //sort beforehand
            if (comparator != null) {
                Collections.sort(items, comparator);
            }

            //we have to get the list size each time, as we will add the headers to it
            for (int i = -1; i < size; i++) {
                HeaderItem headerItem;
                if (i == -1) {
                    headerItem = groupingFunction.group(null, (Item) items.get(i + 1), i);
                } else if (i == size - 1) {
                    headerItem = groupingFunction.group((Item) items.get(i), null, i);
                } else {
                    headerItem = groupingFunction.group((Item) items.get(i), (Item) items.get(i + 1), i);
                }

                if (headerItem != null) {
                    items.add(i + 1, headerItem);
                    i = i + 1;
                    size = size + 1;
                }
            }
        }

        /**
         * set the sorted list to the modelAdapter if provided
         */
        if (modelAdapter != null) {
            modelAdapter.set(items);
        }
    }
825734
protected void addItem(ItemState item)
   {
      index.put(item.getData().getIdentifier(), item);
      index.put(item.getData().getQPath(), item);
      index.put(new ParentIDQPathBasedKey(item), item);
      index.put(new IDStateBasedKey(item.getData().getIdentifier(), item.getState()), item);

      if (item.getData().isNode())
      {
         Map<String, ItemState> children = lastChildNodeStates.get(item.getData().getParentIdentifier());
         if (children == null)
         {
            children = new HashMap<String, ItemState>();
            lastChildNodeStates.put(item.getData().getParentIdentifier(), children);
         }
         children.put(item.getData().getIdentifier(), item);

         List<ItemState> listItemState = childNodeStates.get(item.getData().getParentIdentifier());
         if (listItemState == null)
         {
            listItemState = new ArrayList<ItemState>();
            childNodeStates.put(item.getData().getParentIdentifier(), listItemState);
         }
         listItemState.add(item);
         if (item.isPathChanged())
         {
            if (allPathsChanged == null)
            {
               allPathsChanged = new ArrayList<ItemState>();
            }
            allPathsChanged.add(item);
         }
      }
      else
      {
         Map<String, ItemState> children = lastChildPropertyStates.get(item.getData().getParentIdentifier());
         if (children == null)
         {
            children = new HashMap<String, ItemState>();
            lastChildPropertyStates.put(item.getData().getParentIdentifier(), children);
         }
         children.put(item.getData().getIdentifier(), item);

         List<ItemState> listItemState = childPropertyStates.get(item.getData().getParentIdentifier());
         if (listItemState == null)
         {
            listItemState = new ArrayList<ItemState>();
            childPropertyStates.put(item.getData().getParentIdentifier(), listItemState);
         }
         listItemState.add(item);
      }

      if (item.isNode() && item.isPersisted())
      {
         int[] childInfo = childNodesInfo.get(item.getData().getParentIdentifier());
         if (childInfo == null)
         {
            childInfo = new int[2];
         }

         if (item.isDeleted())
         {
            --childInfo[CHILD_NODES_COUNT];
         }
         else if (item.isAdded())
         {
            ++childInfo[CHILD_NODES_COUNT];
            childInfo[CHILD_NODES_LAST_ORDER_NUMBER] = ((NodeData)item.getData()).getOrderNumber();

         }
         childNodesInfo.put(item.getData().getParentIdentifier(), childInfo);
      }
   }
552039
private void doList() throws PageException, SearchException {
	required("collection", action, "name", name);
	// if(StringUtil.isEmpty(name))throw new ApplicationException("for action list attribute name is
	// required");
	pageContext.setVariable(name, getSearchEngine().getCollectionsAsQuery());
    }
188955
def OnItemSelected(self, event):
        """"""

        value = event.m_itemIndex
        self.startIndex = value

        self.switching = True
        post_command_event(self, self.GridActionTableSwitchMsg, newtable=value)
        self.switching = False

        event.Skip()
1341664
public void addSubItem(WebMenuItem item){
		if (subMenu == null){
			subMenu = new ArrayList<WebMenuItem>();
		}
		subMenu.add(item);
	}
877914
function _updateListItemSelection(listItem, selectedFile) {
        var shouldBeSelected = (selectedFile && $(listItem).data(_FILE_KEY).fullPath === selectedFile.fullPath);
        ViewUtils.toggleClass($(listItem), "selected", shouldBeSelected);
    }
94691
def get_actions_from_items(self, items):
        """"""
        fromcursor_act = create_action(self, text=_('Go to cursor position'),
                                       icon=ima.icon('fromcursor'),
                                       triggered=self.go_to_cursor_position)
        fullpath_act = create_action(self, text=_('Show absolute path'),
                                     toggled=self.toggle_fullpath_mode)
        fullpath_act.setChecked(self.show_fullpath)
        allfiles_act = create_action(self, text=_('Show all files'),
                                     toggled=self.toggle_show_all_files)
        allfiles_act.setChecked(self.show_all_files)
        comment_act = create_action(self, text=_('Show special comments'),
                                    toggled=self.toggle_show_comments)
        comment_act.setChecked(self.show_comments)
        group_cells_act = create_action(self, text=_('Group code cells'),
                                        toggled=self.toggle_group_cells)
        group_cells_act.setChecked(self.group_cells)
        sort_files_alphabetically_act = create_action(
            self, text=_('Sort files alphabetically'),
            toggled=self.toggle_sort_files_alphabetically)
        sort_files_alphabetically_act.setChecked(
            self.sort_files_alphabetically)
        actions = [fullpath_act, allfiles_act, group_cells_act, comment_act,
                   sort_files_alphabetically_act, fromcursor_act]
        return actions
605313
def smart_listing_item_actions actions = []
      content_tag(:span) do
        actions.each do |action|
          next unless action.is_a?(Hash)

          locals = {
            :action_if => action.has_key?(:if) ? action[:if] : true,
            :url => action.delete(:url),
            :icon => action.delete(:icon),
            :title => action.delete(:title),
          }

          template = nil
          action_name = action[:name].to_sym

          case action_name
          when :show
            locals[:icon] ||= smart_listing_config.classes(:icon_show)
						template = 'action_show'
          when :edit
            locals[:icon] ||= smart_listing_config.classes(:icon_edit)
						template = 'action_edit'
          when :destroy
            locals[:icon] ||= smart_listing_config.classes(:icon_trash)
            locals.merge!(
              :confirmation => action.delete(:confirmation),
            )
            template = 'action_delete'
          when :custom
            locals.merge!(
              :html_options => action,
            )
            template = 'action_custom'
          end

          locals[:icon] = [locals[:icon], smart_listing_config.classes(:muted)] if !locals[:action_if]

          if template
            concat(render(:partial => "smart_listing/#{template}", :locals => locals))
          else
            concat(render(:partial => "smart_listing/action_#{action_name}", :locals => {:action => action}))
          end
        end
      end
    end
814388
private void addListItems(final WDefinitionList list) {
		// Example of adding multiple data items at once.
		list.addTerm("Colours", new WText("Red"), new WText("Green"), new WText("Blue"));

		// Example of adding multiple data items using multiple calls.
		list.addTerm("Shapes", new WText("Circle"));
		list.addTerm("Shapes", new WText("Square"), new WText("Triangle"));
	}
429653
function(oContext, oBindingInfo, iIndex) {
			var oItem = this.createListItem(oContext, oBindingInfo);
			this._oControl.insertAggregation("items", oItem, iIndex, true);
			this._aChunk.push(oItem);
		}
1284840
protected function actionListCart()
    {
        list($selected, $action) = $this->getPostedAction();

        $deleted = 0;
        foreach ($selected as $id) {
            if ($action === 'delete' && $this->access('cart_delete')) {
                $deleted += (int) $this->cart->delete($id);
            }
        }

        if ($deleted > 0) {
            $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
            $this->setMessage($message, 'success');
        }
    }
653832
@Override
    public void renderItem(Listitem item, Document doc) {
        log.trace("item render");
        item.setSelectable(true);
        item.addForward(Events.ON_DOUBLE_CLICK, item.getListbox(), Events.ON_DOUBLE_CLICK);
        addCell(item, "");
        addCell(item, doc.getDateTime());
        addCell(item, doc.getTitle());
        addCell(item, doc.getLocationName());
        addCell(item, doc.getAuthorName());
    }
330601
@Override
    protected void inflateItems(List<DrawerItem> items) {

        items.add(new IconDrawerItem.Builder(BOOKS.id())
                .text(R.string.drawer_books)
                .icon(R.drawable.ic_book_black_24dp)
                .build());

        items.add(new IconDrawerItem.Builder(BOOKMARKS.id())
                .text(R.string.drawer_bookmarks)
                .icon(R.drawable.ic_bookmark_black_24dp)
                .build());

        items.add(new IconDrawerItem.Builder(FAVORITES.id())
                .text(R.string.drawer_favs)
                .icon(R.drawable.ic_loyalty_black_24dp)
                .build());

        items.add(new SeperatorDrawerItem());

        items.add(new ActionDrawerItem(SETTINGS.ordinal(), R.string.action_settings, R.drawable.ic_settings_black_24dp));
        items.add(new ActionDrawerItem(HELP_FEEDBACK.ordinal(), R.string.action_help_feedback, R.drawable.ic_forum_black_24dp));

    }
500000
function(item) {
        var id = item.id || item;

        var removedItem;
        var index = Selectivity.findIndexById(this._data, id);
        if (index > -1) {
            removedItem = this._data[index];
            this._data.splice(index, 1);
        }

        if (this._value[index] !== id) {
            index = this._value.indexOf(id);
        }
        if (index > -1) {
            this._value.splice(index, 1);
        }

        if (removedItem) {
            this.triggerChange({ removed: removedItem });
        }

        if (id === this._highlightedItemId) {
            this._highlightedItemId = null;
        }

        this._updateInputWidth();
    }
1019872
@SuppressWarnings("unchecked")
    void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {

        if (!event.isCtrlKey() && !event.isShiftKey()) {

            if (event.getButton().equals(MouseButton.LEFT)) {
                setValue(null);
            }
            changeValueIfNotMultiSelect(itemId);
            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (propertyId == null)) {
                m_menu.removeAllItems();
                fillContextMenu((Set<Logger>)getValue());
                m_menu.openForTable(event, itemId, propertyId, this);
            }

        }
    }
411323
public void setItem(java.util.Collection<CampaignResponse> item) {
        if (item == null) {
            this.item = null;
            return;
        }

        this.item = new java.util.ArrayList<CampaignResponse>(item);
    }