2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.openapi
.roots
.impl
;
18 import com
.intellij
.openapi
.module
.Module
;
19 import com
.intellij
.openapi
.module
.ModuleComponent
;
20 import com
.intellij
.openapi
.util
.InvalidDataException
;
21 import com
.intellij
.openapi
.util
.JDOMExternalizable
;
22 import com
.intellij
.openapi
.util
.WriteExternalException
;
23 import org
.jdom
.Element
;
25 import java
.util
.Iterator
;
26 import java
.util
.List
;
31 public class OldModuleRootsKeeper
implements ModuleComponent
, JDOMExternalizable
{
32 private Element myElement
;
34 public static OldModuleRootsKeeper
getInstance(Module module
) {
35 return module
.getComponent(OldModuleRootsKeeper
.class);
38 public OldModuleRootsKeeper(Module module
) {
42 public String
getComponentName() {
43 return "ModuleRootManager";
46 public void initComponent() { }
48 public void disposeComponent() {
51 public void readExternal(Element element
) throws InvalidDataException
{
52 myElement
= (Element
)element
.clone();
56 public void writeExternal(Element element
) throws WriteExternalException
{
57 if (myElement
!= null) {
58 final List children
= myElement
.getChildren();
59 for (final Object aChildren
: children
) {
60 Element child
= (Element
)aChildren
;
61 element
.addContent((Element
)child
.clone());
66 public void projectOpened() {
69 public void projectClosed() {
72 public void moduleAdded() {