com.intellij.openapi.roots.ui.configuration.ProjectSettingsService Java Examples

The following examples show how to use com.intellij.openapi.roots.ui.configuration.ProjectSettingsService. 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: PsiDirectoryNode.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
@RequiredUIAccess
public void navigate(final boolean requestFocus) {
  Module module = ModuleUtil.findModuleForPsiElement(getValue());
  if (module != null) {
    final VirtualFile file = getVirtualFile();
    final Project project = getProject();
    ProjectSettingsService service = ProjectSettingsService.getInstance(myProject);
    if (ProjectRootsUtil.isModuleContentRoot(file, project)) {
      service.openModuleSettings(module);
    }
    else if (ProjectRootsUtil.isLibraryRoot(file, project)) {
      final OrderEntry orderEntry = LibraryUtil.findLibraryEntry(file, module.getProject());
      if (orderEntry != null) {
        service.openLibraryOrSdkSettings(orderEntry);
      }
    }
    else {
      service.openContentEntriesSettings(module);
    }
  }
}
 
Example #2
Source File: SetupUnitySDKProvider.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
@Nonnull
private static EditorNotificationPanel createPanel(@Nullable String name, @Nonnull final Module rootModule)
{
	EditorNotificationPanel panel = new EditorNotificationPanel();
	if(StringUtil.isEmpty(name))
	{
		panel.setText(Unity3dBundle.message("unity.sdk.is.not.defiled"));
	}
	else
	{
		panel.setText(Unity3dBundle.message("unity.0.sdk.is.not.defined", name));
	}
	panel.createActionLabel("Open Settings", () -> ProjectSettingsService.getInstance(rootModule.getProject()).openModuleSettings(rootModule));
	return panel;
}
 
Example #3
Source File: CSharpPreprocessorLightVariable.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Override
public void navigate(boolean requestFocus)
{
	if(myModule == null)
	{
		((Navigatable) myTarget).navigate(requestFocus);
	}
	else
	{
		ProjectSettingsService.getInstance(getProject()).openContentEntriesSettings(myModule);
	}
}
 
Example #4
Source File: MoveModulesToGroupAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static void doMove(final Module[] modules, final ModuleGroup group, @Nullable final DataContext dataContext) {
  Project project = modules[0].getProject();
  for (final Module module : modules) {
    ModifiableModuleModel model = dataContext != null
                                  ? dataContext.getData(LangDataKeys.MODIFIABLE_MODULE_MODEL)
                                  : null;
    if (model != null){
      model.setModuleGroupPath(module, group == null ? null : group.getGroupPath());
    } else {
      ModuleManagerImpl.getInstanceImpl(project).setModuleGroupPath(module, group == null ? null : group.getGroupPath());
    }
  }

  AbstractProjectViewPane pane = ProjectView.getInstance(project).getCurrentProjectViewPane();
  if (pane != null) {
    pane.updateFromRoot(true);
  }

  if (!ProjectSettingsService.getInstance(project).processModulesMoved(modules, group) && pane != null) {
    if (group != null) {
      pane.selectModuleGroup(group, true);
    }
    else {
      pane.selectModule(modules[0], true);
    }
  }
}
 
Example #5
Source File: PsiDirectoryNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public boolean canNavigate() {
  VirtualFile file = getVirtualFile();
  Project project = getProject();

  ProjectSettingsService service = ProjectSettingsService.getInstance(myProject);
  return file != null && ((ProjectRootsUtil.isModuleContentRoot(file, project) && service.canOpenModuleSettings()) ||
                          (ProjectRootsUtil.isModuleSourceRoot(file, project)  && service.canOpenContentEntriesSettings()) ||
                          (ProjectRootsUtil.isLibraryRoot(file, project) && service.canOpenModuleLibrarySettings()));
}
 
Example #6
Source File: PsiFileNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void navigate(boolean requestFocus) {
  final VirtualFile jarRoot = getArchiveRoot();
  final Project project = getProject();
  if (requestFocus && jarRoot != null && ProjectRootsUtil.isLibraryRoot(jarRoot, project)) {
    final OrderEntry orderEntry = LibraryUtil.findLibraryEntry(jarRoot, project);
    if (orderEntry != null) {
      ProjectSettingsService.getInstance(project).openLibraryOrSdkSettings(orderEntry);
      return;
    }
  }

  super.navigate(requestFocus);
}
 
Example #7
Source File: AbstractModuleNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void navigate(final boolean requestFocus) {
  Module module = getValue();
  if (module != null) {
    ProjectSettingsService.getInstance(myProject).openModuleSettings(module);
  }
}
 
Example #8
Source File: ModulesDependenciesPanel.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void navigate(boolean requestFocus) {
  ProjectSettingsService.getInstance(myModule.getProject()).openModuleSettings(myModule);
}
 
Example #9
Source File: ModuleNavigatable.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void navigate(boolean requestFocus) {
  ProjectSettingsService.getInstance(module.getProject()).openContentEntriesSettings(module);
}
 
Example #10
Source File: OrderEntryNavigatable.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void navigate(boolean requestFocus) {
  ProjectSettingsService.getInstance(myModule.getProject()).openModuleDependenciesSettings(myModule, myOrderEntry);
}
 
Example #11
Source File: OrderEntryNavigatable.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public boolean canNavigate() {
  return ProjectSettingsService.getInstance(myModule.getProject()).canOpenModuleDependenciesSettings();
}
 
Example #12
Source File: LibraryNavigatable.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void navigate(boolean requestFocus) {
  ProjectSettingsService.getInstance(module.getProject()).openLibraryOrSdkSettings(element);
}
 
Example #13
Source File: ModuleNode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void navigate(boolean focus) {
  ProjectSettingsService.getInstance(myModule.getProject()).openModuleSettings(myModule);
}
 
Example #14
Source File: LibraryGroupNode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public boolean canNavigate() {
  return ProjectSettingsService.getInstance(myProject).canOpenModuleLibrarySettings();
}
 
Example #15
Source File: LibraryGroupNode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void navigate(final boolean requestFocus) {
  Module module = getValue().getModule();
  ProjectSettingsService.getInstance(myProject).openModuleLibrarySettings(module);
}
 
Example #16
Source File: AbstractModuleNode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public boolean canNavigate() {
  return ProjectSettingsService.getInstance(myProject).canOpenModuleSettings() && getValue() != null;
}