com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor Java Examples

The following examples show how to use com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LibraryConfigurable.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public JComponent createOptionsPanel() {
  myLibraryEditorComponent = new LibraryRootsComponent(myProject, new Computable<LibraryEditor>() {
    @Override
    public LibraryEditor compute() {
      return getLibraryEditor();
    }
  });
  myLibraryEditorComponent.addListener(new Runnable() {
    @Override
    public void run() {
      myContext.getDaemonAnalyzer().queueUpdate(myProjectStructureElement);
      updateName();
    }
  });
  return myLibraryEditorComponent.getComponent();
}
 
Example #2
Source File: MuleLibraryDescription.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public void addRoots(@NotNull LibraryEditor editor)
{
    final List<File> libs = muleSdk.getLibraryEntries();
    for (File file : libs)
    {
        editor.addRoot(VfsUtil.getUrlForLibraryRoot(file), OrderRootType.CLASSES);
    }
}
 
Example #3
Source File: HaxeLibraryRootsComponentDescriptor.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
@Override
public VirtualFile[] selectFiles(@NotNull JComponent parent,
                                 @Nullable VirtualFile initialSelection,
                                 @Nullable Module contextModule,
                                 @NotNull LibraryEditor libraryEditor) {
  final VirtualFile vFile = Util.showSpecifyJavadocUrlDialog(parent);
  if (vFile != null) {
    return new VirtualFile[]{vFile};
  }
  return VirtualFile.EMPTY_ARRAY;
}
 
Example #4
Source File: ChooserBasedAttachRootButtonDescriptor.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public VirtualFile[] selectFiles(final @Nonnull JComponent parent, @Nullable VirtualFile initialSelection,
                                 final @Nullable Module contextModule, @Nonnull LibraryEditor libraryEditor) {
  final FileChooserDescriptor chooserDescriptor = createChooserDescriptor();
  chooserDescriptor.setTitle(getChooserTitle(libraryEditor.getName()));
  chooserDescriptor.setDescription(getChooserDescription());
  if (contextModule != null) {
    chooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, contextModule);
  }
  return FileChooser.chooseFiles(chooserDescriptor, parent, contextModule != null ? contextModule.getProject() : null, initialSelection);
}
 
Example #5
Source File: LibrariesModifiableModel.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isChanged() {
  for (LibraryEditor libraryEditor : myLibrary2EditorMap.values()) {
    if (libraryEditor.hasChanges()) return true;
  }
  return getLibrariesModifiableModel().isChanged();
}
 
Example #6
Source File: LibraryTypeServiceImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static <P extends LibraryProperties<?>> NewLibraryConfiguration doCreate(final LibraryType<P> type, final String name, final List<OrderRoot> roots) {
  return new NewLibraryConfiguration(name, type, type != null ? type.getKind().createDefaultProperties() : null) {
    @Override
    public void addRoots(@Nonnull LibraryEditor editor) {
      editor.addRoots(roots);
    }
  };
}
 
Example #7
Source File: AttachRootButtonDescriptor.java    From consulo with Apache License 2.0 4 votes vote down vote up
public abstract VirtualFile[] selectFiles(@Nonnull JComponent parent, @Nullable VirtualFile initialSelection,
@Nullable Module contextModule, @Nonnull LibraryEditor libraryEditor);
 
Example #8
Source File: LibraryConfigurable.java    From consulo with Apache License 2.0 4 votes vote down vote up
protected LibraryEditor getLibraryEditor() {
  return myModel.getModifiableModel().getLibraryEditor(myLibrary);
}
 
Example #9
Source File: NewLibraryConfiguration.java    From consulo with Apache License 2.0 votes vote down vote up
public abstract void addRoots(@Nonnull LibraryEditor editor); 
Example #10
Source File: LibraryEditorComponent.java    From consulo with Apache License 2.0 votes vote down vote up
LibraryEditor getLibraryEditor();