本文整理匯總了Java中com.intellij.openapi.module.Module.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java Module.getName方法的具體用法?Java Module.getName怎麽用?Java Module.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.module.Module
的用法示例。
在下文中一共展示了Module.getName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: update
import com.intellij.openapi.module.Module; //導入方法依賴的package包/類
@Override
public void update(final AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Presentation presentation = e.getPresentation();
final boolean enabled = isAvailable(dataContext);
presentation.setVisible(enabled);
presentation.setEnabled(enabled);
if (enabled) {
final Module module = LangDataKeys.MODULE.getData(dataContext);
String moduleName = module == null ? "" : module.getName();
presentation.setText(Text + " (" + moduleName + ")");
}
}
示例2: computeIJDependencyFingerprint
import com.intellij.openapi.module.Module; //導入方法依賴的package包/類
private FP64 computeIJDependencyFingerprint( Project project )
{
List<String> strings = new ArrayList<>();
Module[] ijModules = ModuleManager.getInstance( project ).getModules();
for( Module ijModule : ijModules )
{
String s = ijModule.getName() + ARROW;
for( Module child : ModuleRootManager.getInstance( ijModule ).getDependencies() )
{
s += child.getName() + (ManProject.isExported( ijModule, child ) ? EXPORT : NOT_EXPORT);
}
strings.add( s );
}
return computeOrderIndependentFingerprint( strings );
}
示例3: getFileTitle
import com.intellij.openapi.module.Module; //導入方法依賴的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;
}
示例4: createTheme
import com.intellij.openapi.module.Module; //導入方法依賴的package包/類
private void createTheme(@NotNull Project project, Module module) {
String[] commands = {"echo", "0", "|", "php", "bin/plugin", "devtools", "new-theme",
"--name", themeData.getName(),
"--description", themeData.getDescription(),
"--developer", themeData.getDeveloper(),
"--email", themeData.getEmail()};
GravProjectSettings settings = GravProjectSettings.getInstance(project);
ModuleRootManager root = ModuleRootManager.getInstance(module);
VirtualFile srcFile = null;
for (VirtualFile file : root.getSourceRoots()) {
if (file.isDirectory() && file.getName().contentEquals("src")) {
srcFile = file;
break;
}
}
if (srcFile == null) {
if (settings != null && settings.withSrcDirectory) {
NotificationHelper.showBaloon("No source root found in module '" + module.getName() + "'",
MessageType.ERROR, project);
return;
} else {
srcFile = FileCreateUtil.getParentDirectory(module.getModuleFile(), module.getName());
}
}
VirtualFile finalSrcFile = srcFile;
ProcessUtils processUtils = new ProcessUtils(commands, new File(finalSrcFile.getPath()));
Task.Backgroundable t = new Task.Backgroundable(project, "Create New Grav Theme in Module '" + module.getName() + "'") {
@Override
public boolean shouldStartInBackground() {
return true;
}
@Override
public void onSuccess() {
super.onSuccess();
String output = processUtils.getOutputAsString();
if (processUtils.getErrorOutput() != null) {
NotificationHelper.showBaloon(processUtils.getErrorOutput(), MessageType.ERROR, project);
} else {
NotificationHelper.showBaloon("Theme '" + themeData.getName() + "' was created", MessageType.INFO, project);
}
}
@Override
public void run(@NotNull ProgressIndicator indicator) {
processUtils.execute();
}
};
ProgressManager.getInstance().run(t);
}