本文整理汇总了Java中com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditorListener类的典型用法代码示例。如果您正苦于以下问题:Java LibraryEditorListener类的具体用法?Java LibraryEditorListener怎么用?Java LibraryEditorListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LibraryEditorListener类属于com.intellij.openapi.roots.ui.configuration.libraryEditor包,在下文中一共展示了LibraryEditorListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LibrariesModifiableModel
import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditorListener; //导入依赖的package包/类
public LibrariesModifiableModel(final LibraryTable table, final Project project, LibraryEditorListener libraryEditorListener) {
myProject = project;
myTable = table;
myLibraryEditorListener = libraryEditorListener;
}
示例2: addLibraryEditorListener
import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditorListener; //导入依赖的package包/类
public void addLibraryEditorListener(LibraryEditorListener listener) {
myLibraryEditorListeners.addListener(listener);
}
示例3: init
import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditorListener; //导入依赖的package包/类
public void init(StructureConfigurableContext context, ModuleStructureConfigurable moduleStructureConfigurable,
ProjectLibrariesConfigurable projectLibrariesConfig, GlobalLibrariesConfigurable globalLibrariesConfig) {
super.init(context);
myPackagingEditorContext = new ArtifactsStructureConfigurableContextImpl(myContext, myProject, myDefaultSettings, new ArtifactAdapter() {
@Override
public void artifactAdded(@NotNull Artifact artifact) {
final MyNode node = addArtifactNode(artifact);
selectNodeInTree(node);
myContext.getDaemonAnalyzer().queueUpdate(myPackagingEditorContext.getOrCreateArtifactElement(artifact));
}
});
context.getModulesConfigurator().addAllModuleChangeListener(new ModuleEditor.ChangeListener() {
@Override
public void moduleStateChanged(ModifiableRootModel moduleRootModel) {
for (ProjectStructureElement element : getProjectStructureElements()) {
myContext.getDaemonAnalyzer().queueUpdate(element);
}
}
});
final ItemsChangeListener listener = new ItemsChangeListener() {
@Override
public void itemChanged(@Nullable Object deletedItem) {
if (deletedItem instanceof Library || deletedItem instanceof Module) {
onElementDeleted();
}
}
@Override
public void itemsExternallyChanged() {
}
};
moduleStructureConfigurable.addItemsChangeListener(listener);
projectLibrariesConfig.addItemsChangeListener(listener);
globalLibrariesConfig.addItemsChangeListener(listener);
context.addLibraryEditorListener(new LibraryEditorListener() {
@Override
public void libraryRenamed(@NotNull Library library, String oldName, String newName) {
final Artifact[] artifacts = myPackagingEditorContext.getArtifactModel().getArtifacts();
for (Artifact artifact : artifacts) {
updateLibraryElements(artifact, library, oldName, newName);
}
}
});
}
示例4: init
import com.intellij.openapi.roots.ui.configuration.libraryEditor.LibraryEditorListener; //导入依赖的package包/类
public void init(StructureConfigurableContext context, ModuleStructureConfigurable moduleStructureConfigurable,
ProjectLibrariesConfigurable projectLibrariesConfig) {
super.init(context);
myPackagingEditorContext = new ArtifactsStructureConfigurableContextImpl(myContext, myProject, myDefaultSettings, new ArtifactAdapter() {
@Override
public void artifactAdded(@Nonnull Artifact artifact) {
final MyNode node = addArtifactNode(artifact);
selectNodeInTree(node);
myContext.getDaemonAnalyzer().queueUpdate(myPackagingEditorContext.getOrCreateArtifactElement(artifact));
}
});
context.getModulesConfigurator().addAllModuleChangeListener(new ModuleEditor.ChangeListener() {
@Override
public void moduleStateChanged(ModifiableRootModel moduleRootModel) {
for (ProjectStructureElement element : getProjectStructureElements()) {
myContext.getDaemonAnalyzer().queueUpdate(element);
}
}
});
final ItemsChangeListener listener = new ItemsChangeListener() {
@Override
public void itemChanged(@Nullable Object deletedItem) {
if (deletedItem instanceof Library || deletedItem instanceof Module) {
onElementDeleted();
}
}
@Override
public void itemsExternallyChanged() {
}
};
moduleStructureConfigurable.addItemsChangeListener(listener);
projectLibrariesConfig.addItemsChangeListener(listener);
context.addLibraryEditorListener(new LibraryEditorListener() {
@Override
public void libraryRenamed(@Nonnull Library library, String oldName, String newName) {
final Artifact[] artifacts = myPackagingEditorContext.getArtifactModel().getArtifacts();
for (Artifact artifact : artifacts) {
updateLibraryElements(artifact, library, oldName, newName);
}
}
});
}