public <B> void write(XElement element, ModeSettingsConverter<Location, B> converter) {
    Set<String> keys = new HashSet<String>();
    if (lastMaximizedLocation != null) {
      keys.addAll(lastMaximizedLocation.keySet());
    }
    if (lastMaximizedMode != null) {
      keys.addAll(lastMaximizedMode.keySet());
    }

    if (!keys.isEmpty()) {
      XElement xmaximized = element.addElement("maximized");

      for (String key : keys) {
        Path mode = lastMaximizedMode.get(key);
        Location location = lastMaximizedLocation.get(key);

        if (mode != null || location != null) {
          XElement xitem = xmaximized.addElement("item");
          xitem.addString("id", key);
          if (mode != null) {
            xitem.addElement("mode").setString(mode.toString());
          }
          if (location != null) {
            converter.writePropertyXML(
                converter.convertToSetting(location), xitem.addElement("location"));
          }
        }
      }
    }
  }
示例#2
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((name == null) ? 0 : name.hashCode());
   result = prime * result + ((parameters == null) ? 0 : parameters.hashCode());
   result = prime * result + ((type == null) ? 0 : type.hashCode());
   return result;
 }
示例#3
0
 @SuppressWarnings("rawtypes")
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   ExtensionName other = (ExtensionName) obj;
   if (name == null) {
     if (other.name != null) return false;
   } else if (!name.equals(other.name)) return false;
   if (parameters == null) {
     if (other.parameters != null) return false;
   } else if (!parameters.equals(other.parameters)) return false;
   if (type == null) {
     if (other.type != null) return false;
   } else if (!type.equals(other.type)) return false;
   return true;
 }