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


Java Project.getName方法代碼示例

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


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

示例1: getWizard

import com.intellij.openapi.project.Project; //導入方法依賴的package包/類
private AddModuleWizard getWizard(final Project project) throws ConfigurationException {
    final HybrisProjectImportProvider provider = getHybrisProjectImportProvider();
    final String basePath = project.getBasePath();
    final String projectName = project.getName();
    final Sdk jdk = ProjectRootManager.getInstance(project).getProjectSdk();
    final String compilerOutputUrl = CompilerProjectExtension.getInstance(project).getCompilerOutputUrl();
    final HybrisProjectSettings settings = HybrisProjectSettingsComponent.getInstance(project).getState();

    final AddModuleWizard wizard = new AddModuleWizard(null, basePath, provider) {

        protected void init() {
            // non GUI mode
        }
    };
    final WizardContext wizardContext = wizard.getWizardContext();
    wizardContext.setProjectJdk(jdk);
    wizardContext.setProjectName(projectName);
    wizardContext.setCompilerOutputDirectory(compilerOutputUrl);
    final StepSequence stepSequence = wizard.getSequence();
    for (ModuleWizardStep step : stepSequence.getAllSteps()) {
        if (step instanceof NonGuiSupport) {
            ((NonGuiSupport) step).nonGuiModeImport(settings);
        }
    }
    return wizard;
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:27,代碼來源:ProjectRefreshAction.java

示例2: getProjectTitle

import com.intellij.openapi.project.Project; //導入方法依賴的package包/類
@Override
public String getProjectTitle(@NotNull Project project) {

    String projectCustomTitle;
    try {
        String projectDefaultTitle = defaultBuilder.getProjectTitle(project);
        String projectName = project.getName();
        String projectPath = project.getBasePath();

        projectCustomTitle = engine.eval("projectTemplate({" +
                "projectDefaultTitle: '" + projectDefaultTitle + "'," +
                "projectName: '" + projectName + "'," +
                "projectPath: '" + projectPath + "'" +
                "})").toString();

    } catch (Exception e) {
        projectCustomTitle = defaultBuilder.getProjectTitle(project);
    }

    return projectCustomTitle;
}
 
開發者ID:mabdurrahman,項目名稱:custom-title-plugin,代碼行數:22,代碼來源:CustomFrameTitleBuilder.java

示例3: init

import com.intellij.openapi.project.Project; //導入方法依賴的package包/類
@Override
public void init(ToolWindow window) {
    Project project = ProjectChecker.getFirstOpenedProject();
    String title = "Configuration";
    if (project != null) {
        title += " for '" + project.getName() + "'";
        PsiManager.getInstance(project).addPsiTreeChangeListener(this);
    }
    window.setTitle(title);
    componentList.add(new Triple<>(new String[]{"languages", "translations"}, Boolean.class, cbTranslationEnabled));
    componentList.add(new Triple<>(new String[]{"languages", "http_accept_language"}, Boolean.class, cbActiveLanguageBrowser));
    componentList.add(new Triple<>(new String[]{"languages", "include_default_lang"}, Boolean.class, cbIncludeDefaultLang));

    try {
        refreshComponents(true);
    } catch (Exception e) {
        errorOccurred = true;
    }
}
 
開發者ID:PioBeat,項目名稱:GravSupport,代碼行數:20,代碼來源:SystemSettingsToolWindowFactory.java

示例4: getFileTitle

import com.intellij.openapi.project.Project; //導入方法依賴的package包/類
@Override
public String getFileTitle(@NotNull Project project, @NotNull VirtualFile virtualFile) {

    String fileCustomTitle;
    try {
        Module fileModule = FileIndexFacade.getInstance(project).getModuleForFile(virtualFile);

        String projectDefaultTitle = defaultBuilder.getProjectTitle(project);
        String projectName = project.getName();
        String projectPath = project.getBasePath();

        String fileDefaultTitle = defaultBuilder.getFileTitle(project, virtualFile);
        String fileName = virtualFile.getName();
        String filePath = virtualFile.getPath();
        String fileExt = virtualFile.getExtension();

        String moduleName = null;
        String modulePath = null;
        if (fileModule != null) {
            moduleName = fileModule.getName();
            modulePath = fileModule.getModuleFilePath();
        }

        fileCustomTitle = engine.eval("fileTemplate({" +
                "projectDefaultTitle: '" + projectDefaultTitle + "'," +
                "projectName: '" + projectName + "'," +
                "projectPath: '" + projectPath + "'," +
                "fileDefaultTitle: '" + fileDefaultTitle + "'," +
                "fileName: '" + fileName + "'," +
                "filePath: '" + filePath + "'," +
                "fileExt: '" + fileExt + "'," +
                "moduleName: '" + moduleName + "'," +
                "modulePath: '" + modulePath + "'" +
                "})").toString();

    } catch (Exception e) {
        fileCustomTitle = defaultBuilder.getFileTitle(project, virtualFile);
    }

    return fileCustomTitle;
}
 
開發者ID:mabdurrahman,項目名稱:custom-title-plugin,代碼行數:42,代碼來源:CustomFrameTitleBuilder.java


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