本文整理了Java中com.intellij.openapi.project.Project.getName()
方法的一些代码示例,展示了Project.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getName()
方法的具体详情如下:
包路径:com.intellij.openapi.project.Project
类名称:Project
方法名:getName
暂无
代码示例来源:origin: jshiell/checkstyle-idea
private void putReadmeFile(@NotNull final Project project, @NotNull final File pTempDir)
throws IOException {
final Path tempDir = Paths.get(pTempDir.toURI());
final Path readme = tempDir.resolve(README_FILE);
if (!Files.isRegularFile(readme)) {
String template = readTemplate();
if (template != null) {
template = MessageFormat.format(template, project.getName(), CheckStylePlugin.ID_PLUGIN);
template = template.replaceAll("[\r\n]+", System.lineSeparator());
Files.write(readme, template.getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE);
}
}
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
synchronized public static void cleanInstance(Project project){
if(instance.containsKey(project)) {
Symfony2ProjectComponent.getLogger().info("clean ServiceXmlParserFactory for " + project.getName());
instance.remove(project);
}
}
代码示例来源:origin: jshiell/checkstyle-idea
CheckerFactoryCacheKey(@NotNull final ConfigurationLocation location, @Nullable final Module module) {
this.projectName = module != null ? module.getProject().getName() : "noProject";
this.moduleName = module != null ? module.getName() : "noModule";
this.location = location;
}
代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin
public static void runWriteCommand(Project project, Runnable cmd, String description) {
CommandProcessor.getInstance().executeCommand(project, new WriteAction(cmd), description, project.getName());
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
@Nullable
public static Object run(@NotNull Project project, @NotNull String className, @NotNull String serviceJsNameStrategy) throws ScriptException {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("className", className);
jsonObject.addProperty("projectName", project.getName());
jsonObject.addProperty("projectBasePath", project.getBasePath());
jsonObject.addProperty("defaultNaming", new DefaultServiceNameStrategy().getServiceName(new ServiceNameStrategyParameter(project, className)));
PhpClass aClass = PhpElementsUtil.getClass(project, className);
if(aClass != null) {
String relativePath = VfsUtil.getRelativePath(aClass.getContainingFile().getVirtualFile(), project.getBaseDir(), '/');
if(relativePath != null) {
jsonObject.addProperty("relativePath", relativePath);
}
jsonObject.addProperty("absolutePath", aClass.getContainingFile().getVirtualFile().toString());
}
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
if(engine == null) {
return null;
}
return engine.eval("var __p = eval(" + jsonObject.toString() + "); result = function(args) { " + serviceJsNameStrategy + " }(__p)");
}
代码示例来源:origin: jshiell/checkstyle-idea
@BeforeClass
public static void setup() {
Mockito.when(PROJECT.getName()).thenReturn("project-TempDirProviderTest");
Mockito.when(PROJECT.getLocationHash()).thenReturn("f2d57494");
}
代码示例来源:origin: protostuff/protobuf-jetbrains-plugin
@Override
public void projectClosed() {
LOGGER.info("projectClosed " + project.getName());
}
代码示例来源:origin: Haehnchen/idea-php-toolbox
@Nullable
public static Project getProject(@NotNull String name) {
for(Project project: ProjectManager.getInstance().getOpenProjects()) {
if(name.equals(project.getName())) {
return project;
}
}
return null;
}
}
代码示例来源:origin: SonarSource/sonarlint-intellij
private List<String> getOpenProjectNames(Project[] openProjects, SonarQubeServer server) {
List<String> openProjectNames = new LinkedList<>();
for (Project p : openProjects) {
SonarLintProjectSettings projectSettings = SonarLintUtils.get(p, SonarLintProjectSettings.class);
if (server.getName().equals(projectSettings.getServerId())) {
openProjectNames.add(p.getName());
}
}
return openProjectNames;
}
}
代码示例来源:origin: SonarSource/sonarlint-intellij
EventWatcher() {
this.setDaemon(true);
this.setName("sonarlint-auto-trigger-" + myProject.getName());
}
代码示例来源:origin: antlr/intellij-plugin-v4
public InputPanel getEditorPanel() {
LOG.info("createEditorPanel"+" "+project.getName());
return new InputPanel(this);
}
代码示例来源:origin: liias/monkey
protected String getPrgName() {
return getEnvironment().getProject().getName() + ".prg";
}
代码示例来源:origin: liias/monkey
@Nullable
private static VirtualFile findSettingsJsonFile(Module module) {
VirtualFile moduleOutputDir = CompilerPaths.getModuleOutputDirectory(module, false);
// moduleOutputDir is null if the output directories don't exist yet (e.g module has not been built)
if (moduleOutputDir == null) {
return null;
}
String projectName = module.getProject().getName();
String settingsFilename = projectName + "-settings.json";
return moduleOutputDir.findChild(settingsFilename);
}
代码示例来源:origin: antlr/intellij-plugin-v4
public static ANTLRv4PluginController getInstance(Project project) {
if ( project==null ) {
LOG.error("getInstance: project is null");
return null;
}
ANTLRv4PluginController pc = project.getComponent(ANTLRv4PluginController.class);
if ( pc==null ) {
LOG.error("getInstance: getComponent() for "+project.getName()+" returns null");
}
return pc;
}
代码示例来源:origin: neueda/jetbrains-plugin-graph-database-support
public static VirtualFile getScratchFile(Project project, String fileName) throws IOException {
return ScratchFileService.getInstance().findFile(
ParameterRootType.getInstance(),
project.getName() + fileName,
ScratchFileService.Option.create_if_missing
);
}
代码示例来源:origin: sonar-intellij-plugin/sonar-intellij-plugin
private static String replacePlaceHolders(String template,Project project) {
String processedTemplate = template;
String projectName = "";
String projectBaseDir = "";
String projectBaseDirName = "";
if (null != project) {
projectName = project.getName();
projectBaseDir = project.getBasePath();
projectBaseDirName = project.getBaseDir().getName();
}
processedTemplate = processedTemplate.replace(PROJECT_NAME.getVariableName(),projectName);
processedTemplate = processedTemplate.replace(PROJECT_BASE_DIR_NAME.getVariableName(),projectBaseDirName);
processedTemplate = processedTemplate.replace(PROJECT_BASE_DIR.getVariableName(),projectBaseDir);
return processedTemplate;
}
代码示例来源:origin: antlr/intellij-plugin-v4
public void grammarFileSavedEvent(VirtualFile grammarFile) {
LOG.info("grammarFileSavedEvent "+grammarFile.getPath()+" "+project.getName());
updateGrammarObjectsFromFile(grammarFile); // force reload
if ( previewPanel!=null ) {
previewPanel.grammarFileSaved(grammarFile);
}
else {
LOG.error("grammarFileSavedEvent called before preview panel created");
}
runANTLRTool(grammarFile);
}
代码示例来源:origin: kornilova-l/FlameViewer
@Override
public void actionPerformed(ActionEvent e) {
FileSaverDialog dialog = FileChooserFactory.getInstance().createSaveFileDialog(
new FileSaverDescriptor("Export Configuration", "Export to"),
project
);
VirtualFileWrapper targetFile = dialog.save(project.getBaseDir(), project.getName() + "-profiler.config");
if (targetFile != null) {
exportToFile(targetFile.getFile());
}
}
代码示例来源:origin: antlr/intellij-plugin-v4
public void closeGrammar(VirtualFile grammarFile) {
String grammarFileName = grammarFile.getPath();
LOG.info("closeGrammar "+grammarFileName+" "+project.getName());
inputPanel.resetStartRuleLabel();
inputPanel.clearErrorConsole();
clearParseTree(); // wipe tree
ANTLRv4PluginController controller = ANTLRv4PluginController.getInstance(project);
PreviewState previewState = controller.getPreviewState(grammarFile);
inputPanel.releaseEditor(previewState);
}
代码示例来源:origin: antlr/intellij-plugin-v4
public JTabbedPane createParseTreeAndProfileTabbedPanel() {
JBTabbedPane tabbedPane = new JBTabbedPane();
LOG.info("createParseTreePanel" + " " + project.getName());
Pair<UberTreeViewer, JPanel> pair = createParseTreePanel();
treeViewer = pair.a;
setupContextMenu(treeViewer);
tabbedPane.addTab("Parse tree", pair.b);
hierarchyViewer = new HierarchyViewer(null, this);
tabbedPane.addTab("Hierarchy", hierarchyViewer);
profilerPanel = new ProfilerPanel(project, this);
tabbedPane.addTab("Profiler", profilerPanel.$$$getRootComponent$$$());
return tabbedPane;
}
内容来源于网络,如有侵权,请联系作者删除!