Examples of containsId()


Examples of com.elasticinbox.core.model.LabelMap.containsId()

    // set labels' counters
    Map<Integer, LabelCounters> counters = LabelCounterPersistence.getAll(mailbox.getId());

    for (int labelId : counters.keySet())
    {
      if (labels.containsId(labelId) && counters.containsKey(labelId)) {
        labels.get(labelId).setCounters(counters.get(labelId));
      } else if (labels.containsId(labelId) && !counters.containsKey(labelId)) {
        // assume zeros for all counters if not yet initialised
        labels.get(labelId).setCounters(new LabelCounters());
      } else if (!labels.containsId(labelId) && counters.containsKey(labelId)) {
View Full Code Here

Examples of com.elasticinbox.core.model.LabelMap.containsId()

    for (int labelId : counters.keySet())
    {
      if (labels.containsId(labelId) && counters.containsKey(labelId)) {
        labels.get(labelId).setCounters(counters.get(labelId));
      } else if (labels.containsId(labelId) && !counters.containsKey(labelId)) {
        // assume zeros for all counters if not yet initialised
        labels.get(labelId).setCounters(new LabelCounters());
      } else if (!labels.containsId(labelId) && counters.containsKey(labelId)) {
        logger.warn("Found counters for label {}/{}, but label does not exist.", mailbox.getId(), labelId);
      }
View Full Code Here

Examples of com.elasticinbox.core.model.LabelMap.containsId()

      if (labels.containsId(labelId) && counters.containsKey(labelId)) {
        labels.get(labelId).setCounters(counters.get(labelId));
      } else if (labels.containsId(labelId) && !counters.containsKey(labelId)) {
        // assume zeros for all counters if not yet initialised
        labels.get(labelId).setCounters(new LabelCounters());
      } else if (!labels.containsId(labelId) && counters.containsKey(labelId)) {
        logger.warn("Found counters for label {}/{}, but label does not exist.", mailbox.getId(), labelId);
      }
    }

    return labels;
View Full Code Here

Examples of com.elasticinbox.core.model.LabelMap.containsId()

    if (ReservedLabels.contains(label.getId())) {
      throw new ExistingLabelException("This is reserved label and can't be modified");
    }

    // check if label id exists
    if (!existingLabels.containsId(label.getId())) {
      throw new IllegalLabelException("Label does not exist");
    }

    // begin batch operation
    Mutator<String> mutator = createMutator(keyspace, strSe);
View Full Code Here

Examples of com.elasticinbox.core.model.LabelMap.containsId()

        Message message = messages.get(messageId);

        // add counters for each of the labels
        for (int labelId : message.getLabels())
        {
          if (!labels.containsId(labelId)) {
            Label label = new Label(labelId).setCounters(message.getLabelCounters());
            labels.put(label);
          } else {
            labels.get(labelId).incrementCounters(message.getLabelCounters());
          }
View Full Code Here

Examples of com.elasticinbox.core.model.LabelMap.containsId()

      {
        Set<Integer> messageLabels = this.messages.get(messageId).getLabels();
 
        for (int labelId : messageLabels)
        {
          if (!labels.containsId(labelId)) {
            Label label = new Label(labelId).
                setCounters(this.messages.get(messageId).getLabelCounters());
            labels.put(label);
          } else {
            labels.get(labelId).getCounters().add(
View Full Code Here

Examples of com.elasticinbox.core.model.LabelMap.containsId()

      {
        // set label name
        Integer labelId = Integer.parseInt(a.getKey().split(CN_SEPARATOR)[1]);
        String labelName = (String) a.getValue();
       
        if (labels.containsId(labelId)) {
          labels.get(labelId).setName(labelName);
        } else {
          Label label = new Label(labelId, labelName);
          labels.put(label);
        }
View Full Code Here

Examples of com.elasticinbox.core.model.LabelMap.containsId()

        String[] attrKeys = a.getKey().split(CN_SEPARATOR);
        Integer labelId = Integer.parseInt(attrKeys[1]);
        String attrName = attrKeys[2];
        String attrValue = (String) a.getValue();
       
        if (labels.containsId(labelId)) {
          labels.get(labelId).addAttribute(attrName, attrValue);
        } else {
          Label label = new Label(labelId);
          label.addAttribute(attrName, attrValue);
          labels.put(label);
View Full Code Here

Examples of com.vaadin.ui.ComboBox.containsId()

        Item i = s.addItem(DEFAULT_ITEMID);
        i.getItemProperty("caption").setValue(
                "Default (" + TimeZone.getDefault().getID() + ")");
        for (String id : TimeZone.getAvailableIDs()) {
            if (!s.containsId(id)) {
                i = s.addItem(id);
                i.getItemProperty("caption").setValue(id);
            }
        }
View Full Code Here

Examples of com.vaadin.ui.ComboBox.containsId()

        s.addContainerProperty("caption", String.class, "");
        s.setItemCaptionPropertyId("caption");
        s.setFilteringMode(FilteringMode.CONTAINS);

        for (Locale l : Locale.getAvailableLocales()) {
            if (!s.containsId(l)) {
                Item i = s.addItem(l);
                i.getItemProperty("caption").setValue(getLocaleItemCaption(l));
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.