예제 #1
0
  private void readProperties(Element element) {
    final String typeId = element.getAttributeValue(LIBRARY_TYPE_ATTR);
    if (typeId == null) return;

    myKind = (PersistentLibraryKind<?>) LibraryKind.findById(typeId);
    if (myKind == null) return;

    myProperties = myKind.createDefaultProperties();
    final Element propertiesElement = element.getChild(PROPERTIES_ELEMENT);
    if (propertiesElement != null) {
      ComponentSerializationUtil.loadComponentState(myProperties, propertiesElement);
    }
  }
예제 #2
0
 LibraryImpl(LibraryTable table, Element element, ModifiableRootModel rootModel)
     throws InvalidDataException {
   this(
       table,
       rootModel,
       null,
       element.getAttributeValue(LIBRARY_NAME_ATTR),
       (PersistentLibraryKind<?>)
           LibraryKind.findById(element.getAttributeValue(LIBRARY_TYPE_ATTR)));
   readProperties(element);
   myJarDirectories.readExternal(element);
   readRoots(element);
   myRootsWatcher.updateWatchedRoots();
 }