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
.libraries
;
18 import com
.intellij
.openapi
.Disposable
;
19 import com
.intellij
.openapi
.roots
.OrderRootType
;
20 import com
.intellij
.openapi
.roots
.RootProvider
;
21 import com
.intellij
.openapi
.util
.JDOMExternalizable
;
22 import com
.intellij
.openapi
.vfs
.VirtualFile
;
23 import org
.jetbrains
.annotations
.NotNull
;
28 public interface Library
extends JDOMExternalizable
, Disposable
{
31 @NotNull String
[] getUrls(@NotNull OrderRootType rootType
);
33 @NotNull VirtualFile
[] getFiles(@NotNull OrderRootType rootType
);
36 * As soon as you obtaining modifiable model you will have to commit it or call Disposer.dispose(model)!
38 @NotNull ModifiableModel
getModifiableModel();
40 LibraryTable
getTable();
42 @NotNull RootProvider
getRootProvider();
44 boolean isJarDirectory(@NotNull String url
);
46 boolean isValid(@NotNull String url
, @NotNull OrderRootType rootType
);
48 interface ModifiableModel
extends Disposable
{
49 @NotNull String
[] getUrls(@NotNull OrderRootType rootType
);
51 void setName(@NotNull String name
);
55 void addRoot(@NotNull String url
, @NotNull OrderRootType rootType
);
57 void addJarDirectory(@NotNull String url
, boolean recursive
);
59 void addRoot(@NotNull VirtualFile file
, @NotNull OrderRootType rootType
);
61 void addJarDirectory(@NotNull VirtualFile file
, boolean recursive
);
63 void moveRootUp(@NotNull String url
, @NotNull OrderRootType rootType
);
65 void moveRootDown(@NotNull String url
, @NotNull OrderRootType rootType
);
67 boolean removeRoot(@NotNull String url
, @NotNull OrderRootType rootType
);
71 @NotNull VirtualFile
[] getFiles(@NotNull OrderRootType rootType
);
75 boolean isJarDirectory(@NotNull String url
);
77 boolean isValid(@NotNull String url
, @NotNull OrderRootType rootType
);