當前位置: 首頁>>代碼示例>>Java>>正文


Java ServiceManager.getService方法代碼示例

本文整理匯總了Java中com.intellij.openapi.components.ServiceManager.getService方法的典型用法代碼示例。如果您正苦於以下問題:Java ServiceManager.getService方法的具體用法?Java ServiceManager.getService怎麽用?Java ServiceManager.getService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.components.ServiceManager的用法示例。


在下文中一共展示了ServiceManager.getService方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: refreshJarArtifactList

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@Override
public void refreshJarArtifactList(Project project) {
    view.logDebug("Refresh JAR-artifact list.");
    ProjectModel projectModel = ServiceManager.getService(ProjectModel.class);
    String lastSelectedJarArtifactName = connectorSettings.getLastSelectedJarArtifactName();
    ArtifactEntry selectedArtifactEntry = null;
    Collection<? extends ArtifactEntry> jarArtifacts = projectModel.getJarArtifacts(project);
    for(ArtifactEntry entry : jarArtifacts){
        if(entry.getName().equals(lastSelectedJarArtifactName)){
            selectedArtifactEntry = entry;
            break;
        }
    }
    view.setArtifactList(jarArtifacts, selectedArtifactEntry);
    ArtifactEntry artifactEntry = view.getSelectedArtifactEntry();
    if(artifactEntry == null) {
        view.logInfo("JAR-artifact is not selected.");
    } else {
        view.logInfo("Selected JAR-artifact: \"%s\"", artifactEntry.getName());
    }
    refreshStatus();
}
 
開發者ID:satr,項目名稱:intellij-idea-plugin-connector-for-aws-lambda,代碼行數:23,代碼來源:ConnectorPresenterImpl.java

示例2: findApplicationCommands

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@NotNull
@Override
public List<AppleScriptCommand> findApplicationCommands(@NotNull Project project, @NotNull String applicationName,
                                                        @NotNull String commandName) {
  AppleScriptProjectDictionaryService projectDictionaryRegistry =
      ServiceManager.getService(project, AppleScriptProjectDictionaryService.class);
  ApplicationDictionary dictionary = projectDictionaryRegistry.getDictionary(applicationName);
  //among dictionaries there should always be Standard Additions dictionaries checked BUT
  //if there was no command in that dictionaries found, we should initialize new dictionary here for the project
  //and do it only once!
  if (dictionary == null) {
    dictionary = projectDictionaryRegistry.createDictionary(applicationName);
  }
  if (dictionary != null) {
    return dictionary.findAllCommandsWithName(commandName);
  }
  return new ArrayList<>(0);// TODO: 29/11/15 use predefined empty list here
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:19,代碼來源:AppleScriptSystemDictionaryRegistryService.java

示例3: registerAntListener

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
private void registerAntListener(final Project project) {
    final CommonIdeaService commonIdeaService = ServiceManager.getService(CommonIdeaService.class);
    if (commonIdeaService.isHybrisProject(project)) {
        if (isPluginActive(ANT_SUPPORT_PLUGIN_ID)) {
            HybrisAntBuildListener.registerAntListener(project);
        }
    }
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:9,代碼來源:HybrisProjectManagerListener.java

示例4: getSpringConfigurator

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@NotNull
@Override
public SpringConfigurator getSpringConfigurator() {
    final SpringConfigurator springConfigurator = ServiceManager.getService(
        DefaultSpringConfigurator.class
    );

    return (null == springConfigurator) ? new DummySpringConfigurator() : springConfigurator;
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:10,代碼來源:DefaultConfiguratorFactory.java

示例5: findInDataContext

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@Nullable
@Override
public BpGraphNode findInDataContext(final DataContext dataContext) {
    final Project project = CommonDataKeys.PROJECT.getData(dataContext);
    final CommonIdeaService commonIdeaService = ServiceManager.getService(CommonIdeaService.class);
    if (!commonIdeaService.isHybrisProject(project)) {
        return null;
    }

    final VirtualFile virtualFile = CommonDataKeys.VIRTUAL_FILE.getData(dataContext);

    if (null == virtualFile) {
        return null;
    }

    if (!virtualFile.getName().endsWith("process.xml")) {
        return null;
    }

    final PsiFile psiFile = CommonDataKeys.PSI_FILE.getData(dataContext);

    if (!(psiFile instanceof XmlFile) ||
        psiFile instanceof HtmlFileImpl) { // but psiFile must not be html.
        return null;
    }

    final BpGraphService bpGraphService = ServiceManager.getService(BpGraphService.class);

    try {
        return bpGraphService.buildGraphFromXmlFile(virtualFile);
    } catch (UnmarshalException e) {
        return null;
    }
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:35,代碼來源:BpDiagramElementManagerIml.java

示例6: resetSpringGeneralSettings

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
private void resetSpringGeneralSettings(final Project project) {
    final CommonIdeaService commonIdeaService = ServiceManager.getService(CommonIdeaService.class);
    if (commonIdeaService.isHybrisProject(project)) {
        if (isPluginActive(SPRING_PLUGIN_ID)) {
            SpringGeneralSettings springGeneralSettings = SpringGeneralSettings.getInstance(project);
            springGeneralSettings.setShowMultipleContextsPanel(false);
            springGeneralSettings.setShowProfilesPanel(false);
        }
    }
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:11,代碼來源:HybrisProjectManagerListener.java

示例7: getInstance

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
public static Config getInstance() {
    return ServiceManager.getService(Config.class);
}
 
開發者ID:quietUncle,項目名稱:vartrans,代碼行數:4,代碼來源:Config.java

示例8: getInstance

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
static TSMetaModelAccess getInstance(final Project project) {
    return ServiceManager.getService(project, TSMetaModelAccess.class);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:4,代碼來源:TSMetaModelAccess.java

示例9: getInstance

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@NotNull
public static HybrisApplicationSettingsComponent getInstance() {
    return ServiceManager.getService(HybrisApplicationSettingsComponent.class);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:5,代碼來源:HybrisApplicationSettingsComponent.java

示例10: getInstance

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@NotNull
public static CompletionProvider<CompletionParameters> getInstance() {
    return ServiceManager.getService(ItemTypeCodeCompletionProvider.class);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:5,代碼來源:ItemTypeCodeCompletionProvider.java

示例11: CodeMakerGroup

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
public CodeMakerGroup() {
    settings = ServiceManager.getService(CodeMakerSettings.class);
}
 
開發者ID:zeng198821,項目名稱:CodeGenerate,代碼行數:4,代碼來源:CodeMakerGroup.java

示例12: getCompilerOutputPathsConfigurator

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@NotNull
@Override
public CompilerOutputPathsConfigurator getCompilerOutputPathsConfigurator() {
    return ServiceManager.getService(CompilerOutputPathsConfigurator.class);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:6,代碼來源:DefaultConfiguratorFactory.java

示例13: scanDirectoryForHybrisModules

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
protected void scanDirectoryForHybrisModules(
    @NotNull final File rootDirectory,
    @Nullable final TaskProgressProcessor<File> progressListenerProcessor,
    @Nullable final TaskProgressProcessor<List<File>> errorsProcessor
) throws InterruptedException, IOException {
    Validate.notNull(rootDirectory);

    this.foundModules.clear();

    LOG.info("Scanning for modules");
    final List<File> moduleRootDirectories = this.findModuleRoots(rootDirectory, progressListenerProcessor);
    if (externalExtensionsDirectory != null) {
        LOG.info("Scanning for external modules");
        moduleRootDirectories.addAll(
            this.findModuleRoots(externalExtensionsDirectory, progressListenerProcessor)
        );
    }

    final List<HybrisModuleDescriptor> moduleDescriptors = newArrayList();
    final List<File> pathsFailedToImport = newArrayList();

    addRootModule(rootDirectory, moduleDescriptors, pathsFailedToImport);

    final HybrisModuleDescriptorFactory hybrisModuleDescriptorFactory = ServiceManager.getService(
        HybrisModuleDescriptorFactory.class
    );

    for (File moduleRootDirectory : moduleRootDirectories) {
        try {
            final HybrisModuleDescriptor moduleDescriptor = hybrisModuleDescriptorFactory.createDescriptor(
                moduleRootDirectory, this
            );
            moduleDescriptors.add(moduleDescriptor);
        } catch (HybrisConfigurationException e) {
            LOG.error("Can not import a module using path: " + pathsFailedToImport, e);

            pathsFailedToImport.add(moduleRootDirectory);
        }
    }

    if (null != errorsProcessor) {
        if (errorsProcessor.shouldContinue(pathsFailedToImport)) {
            throw new InterruptedException("Modules scanning has been interrupted.");
        }
    }

    Collections.sort(moduleDescriptors);

    this.buildDependencies(moduleDescriptors);

    this.foundModules.addAll(moduleDescriptors);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:53,代碼來源:DefaultHybrisProjectDescriptor.java

示例14: getLoadedConfigurator

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@NotNull
@Override
public LoadedConfigurator getLoadedConfigurator() {
    return ServiceManager.getService(LoadedConfigurator.class);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:6,代碼來源:DefaultConfiguratorFactory.java

示例15: getModuleSettingsConfigurator

import com.intellij.openapi.components.ServiceManager; //導入方法依賴的package包/類
@NotNull
@Override
public ModuleSettingsConfigurator getModuleSettingsConfigurator() {
    return ServiceManager.getService(ModuleSettingsConfigurator.class);
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:6,代碼來源:DefaultConfiguratorFactory.java


注:本文中的com.intellij.openapi.components.ServiceManager.getService方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。