Package net.sourceforge.syncyoursecrets.xmlmapping

Examples of net.sourceforge.syncyoursecrets.xmlmapping.MappingElement


    if (obj instanceof StringElement) {
      StringElement stringElement = (StringElement) obj;
      return stringElement.getElementName();
    }
    if (obj instanceof MappingElement) {
      MappingElement element = (MappingElement) obj;
      return element.getName();
    }

    return obj.toString();
  }
View Full Code Here


   * @param toRemove
   *            the to remove
   */
  public void removeEntry(Object toRemove) {
    if (toRemove instanceof MappingElement) {
      MappingElement removeElement = (MappingElement) toRemove;
      this.list.remove(removeElement);
    } // TODO: error handling otherwise?
    viewer.refresh();
  }
View Full Code Here

  public String getText(Object obj) {
    if (obj instanceof StringElement) {
      StringElement stringElement = (StringElement) obj;
      return stringElement.getElementName();
    } else if (obj instanceof MappingElement) {
      MappingElement element = (MappingElement) obj;
      return element.getName();
    } else {
      logger.warn("Cannot provide label for unknown type " + obj);
    }

    return obj.toString();
View Full Code Here

   */
  public void removeEntry(Object toRemove) {
    logger.debug("entering removeEntry for " + toRemove);

    if (toRemove instanceof MappingElement) {
      MappingElement removeElement = (MappingElement) toRemove;
      this.list.remove(removeElement);
    } else {
      String msg = ("Attempting to delete an unexpected object. "
          + "This is a bug.");
      MessageDialog.showUnexpectedErrorMessage(msg, logger);
View Full Code Here

  public void testMerge() throws Exception {
    ListElement left = listFromProperties(leftNames, leftTimes);
    ListElement right = listFromProperties(rightNames, rightTimes);

    // deletion is handled programatically here:
    MappingElement rightDelete = right.getElements().get(6L);
    right.remove(rightDelete);
    rightDelete.setLastModified(NEWEST_TIME_STAMP);

    MappingElement leftDelete = left.getElements().get(7L);
    left.remove(leftDelete);
    leftDelete.setLastModified(NEWEST_TIME_STAMP);

    // actually do the merge
    ListElement merged = (ListElement) left.merge(right);

    // check deletion
View Full Code Here

TOP

Related Classes of net.sourceforge.syncyoursecrets.xmlmapping.MappingElement

Copyright © 2018 www.massapicom. 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.