本文整理汇总了Java中com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectStructureConfigurable.getInstance方法的具体用法?Java ProjectStructureConfigurable.getInstance怎么用?Java ProjectStructureConfigurable.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable
的用法示例。
在下文中一共展示了ProjectStructureConfigurable.getInstance方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performFix
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Override
public void performFix() {
final LibraryTable.ModifiableModel libraryTable = myContext.getModifiableLibraryTable(myLibrary.getTable());
if (libraryTable instanceof LibrariesModifiableModel) {
for (String invalidRoot : myInvalidUrls) {
final ExistingLibraryEditor libraryEditor = ((LibrariesModifiableModel)libraryTable).getLibraryEditor(myLibrary);
libraryEditor.removeRoot(invalidRoot, myType);
}
myContext.getDaemonAnalyzer().queueUpdate(LibraryProjectStructureElement.this);
final ProjectStructureConfigurable structureConfigurable = ProjectStructureConfigurable.getInstance(myContext.getProject());
navigate().doWhenDone(new Runnable() {
@Override
public void run() {
final NamedConfigurable configurable = structureConfigurable.getConfigurableFor(myLibrary).getSelectedConfigurable();
if (configurable instanceof LibraryConfigurable) {
((LibraryConfigurable)configurable).updateComponent();
}
}
});
}
}
示例2: navigate
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Override
public void navigate(boolean openLibraryEditor) {
final OrderEntry entry = getSelectedEntry();
final ProjectStructureConfigurable rootConfigurable = ProjectStructureConfigurable.getInstance(myState.getProject());
if (entry instanceof ModuleOrderEntry){
Module module = ((ModuleOrderEntry)entry).getModule();
if (module != null) {
rootConfigurable.select(module.getName(), null, true);
}
}
else if (entry instanceof LibraryOrderEntry){
if (!openLibraryEditor && !((LibraryOrderEntry)entry).getLibraryLevel().equals(LibraryTableImplUtil.MODULE_LEVEL)) {
rootConfigurable.select((LibraryOrderEntry)entry, true);
}
else {
doEdit();
}
}
else if (entry instanceof JdkOrderEntry) {
Sdk jdk = ((JdkOrderEntry)entry).getJdk();
if (jdk != null) {
rootConfigurable.select(jdk, true);
}
}
}
示例3: run
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Override
public void run() {
final Set<String> sdkNames = getSdkNamesFromModules(myProblemModules);
if (sdkNames.size() == 1) {
final Sdk sdk = ProjectJdkTable.getInstance().findJdk(sdkNames.iterator().next());
if (sdk != null && sdk.getSdkType() instanceof AndroidSdkType) {
final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(myProject);
if (ShowSettingsUtil.getInstance().editConfigurable(myProject, config, new Runnable() {
@Override
public void run() {
config.select(sdk, true);
}
})) {
askAndRebuild(myProject);
}
return;
}
}
final String moduleToSelect = myProblemModules.size() > 0
? myProblemModules.iterator().next().getName()
: null;
if (ModulesConfigurator.showDialog(myProject, moduleToSelect, ClasspathEditor.NAME)) {
askAndRebuild(myProject);
}
}
示例4: navigate
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Override
public void navigate(boolean openLibraryEditor) {
final OrderEntry entry = getSelectedEntry();
final ProjectStructureConfigurable rootConfigurable = ProjectStructureConfigurable.getInstance(myState.getProject());
if (entry instanceof ModuleOrderEntry){
Module module = ((ModuleOrderEntry)entry).getModule();
if (module != null) {
rootConfigurable.select(module.getName(), null, true);
}
}
else if (entry instanceof LibraryOrderEntry){
if (!openLibraryEditor) {
rootConfigurable.select((LibraryOrderEntry)entry, true);
}
else {
myEditButton.actionPerformed(null);
}
}
else if (entry instanceof JdkOrderEntry) {
Sdk jdk = ((JdkOrderEntry)entry).getJdk();
if (jdk != null) {
rootConfigurable.select(jdk, true);
}
}
}
示例5: navigate
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Override
public void navigate(boolean openLibraryEditor) {
final OrderEntry entry = getSelectedEntry();
final ProjectStructureConfigurable rootConfigurable = ProjectStructureConfigurable.getInstance(myState.getProject());
if (entry instanceof ModuleOrderEntry) {
Module module = ((ModuleOrderEntry)entry).getModule();
if (module != null) {
rootConfigurable.select(module.getName(), null, true);
}
}
else if (entry instanceof LibraryOrderEntry) {
if (!openLibraryEditor) {
rootConfigurable.select((LibraryOrderEntry)entry, true);
}
else {
myEditButton.actionPerformed(null);
}
}
else if (entry instanceof ModuleExtensionWithSdkOrderEntry) {
Sdk jdk = ((ModuleExtensionWithSdkOrderEntry)entry).getSdk();
if (jdk != null) {
rootConfigurable.select(jdk, true);
}
}
}
示例6: getProjectStructureContext
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Nullable
private static StructureConfigurableContext getProjectStructureContext(Project project) {
if (ApplicationManager.getApplication().isHeadlessEnvironment()) return null;
final ProjectStructureConfigurable structureConfigurable = ProjectStructureConfigurable.getInstance(project);
return structureConfigurable.isUiInitialized() ? structureConfigurable.getContext() : null;
}
示例7: validateExistingModuleName
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
public void validateExistingModuleName(Project project) throws ConfigurationException {
final String moduleName = getModuleName();
final Module module;
final ProjectStructureConfigurable fromConfigurable = ProjectStructureConfigurable.getInstance(project);
if (fromConfigurable != null) {
module = fromConfigurable.getModulesConfig().getModule(moduleName);
}
else {
module = ModuleManager.getInstance(project).findModuleByName(moduleName);
}
if (module != null) {
throw new ConfigurationException("Module \'" + moduleName + "\' already exist in project. Please, specify another name.");
}
}
示例8: validateExistingModuleName
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
private void validateExistingModuleName() throws ConfigurationException {
final String moduleName = getModuleName();
final Module module;
final ProjectStructureConfigurable fromConfigurable = ProjectStructureConfigurable.getInstance(myWizardContext.getProject());
if (fromConfigurable != null) {
module = fromConfigurable.getModulesConfig().getModule(moduleName);
}
else {
module = ModuleManager.getInstance(myWizardContext.getProject()).findModuleByName(moduleName);
}
if (module != null) {
throw new ConfigurationException("Module \'" + moduleName + "\' already exist in project. Please, specify another name.");
}
}
示例9: navigate
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Override
public void navigate(@Nonnull final ModuleExtensionWithSdkOrderEntryImpl orderEntry) {
final Sdk sdk = orderEntry.getSdk();
if (sdk == null) {
return;
}
Project project = orderEntry.getModuleRootLayer().getProject();
final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(project);
ProjectStructureDialog.show(project, new Consumer<ProjectStructureConfigurable>() {
@Override
public void consume(ProjectStructureConfigurable configurable) {
config.select(sdk, true);
}
});
}
示例10: navigate
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
default void navigate(@Nonnull final T orderEntry) {
Project project = orderEntry.getOwnerModule().getProject();
final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(project);
ProjectStructureDialog.show(project, new Consumer<ProjectStructureConfigurable>() {
@Override
public void consume(ProjectStructureConfigurable configurable) {
config.selectOrderEntry(orderEntry.getOwnerModule(), orderEntry);
}
});
}
示例11: show
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
public static boolean show(@Nonnull Project project, final Consumer<ProjectStructureConfigurable> configurableConsumer) {
final ProjectStructureConfigurable configurable = ProjectStructureConfigurable.getInstance(project);
ProjectStructureDialog dialog =
new ProjectStructureDialog(project, configurable, OptionsEditorDialog.DIMENSION_KEY, true, IdeModalityType.PROJECT, configurable);
if (configurableConsumer != null) {
new UiNotifyConnector.Once(dialog.getContentPane(), new Activatable() {
@Override
public void showNotify() {
configurableConsumer.consume(configurable);
}
});
}
return dialog.showAndGet();
}
示例12: getProjectStructureContext
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Nullable
private static StructureConfigurableContext getProjectStructureContext(Project project) {
final ProjectStructureConfigurable structureConfigurable = ProjectStructureConfigurable.getInstance(project);
return structureConfigurable.isUiInitialized() ? structureConfigurable.getContext() : null;
}
示例13: getProjectStructureContext
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable; //导入方法依赖的package包/类
@Nullable
private static StructureConfigurableContext getProjectStructureContext(Project project) {
final ProjectStructureConfigurable structureConfigurable = ProjectStructureConfigurable.getInstance(project);
return structureConfigurable.getContext() ;
}