本文整理汇总了Java中com.intellij.ide.fileTemplates.ui.ConfigureTemplatesDialog类的典型用法代码示例。如果您正苦于以下问题:Java ConfigureTemplatesDialog类的具体用法?Java ConfigureTemplatesDialog怎么用?Java ConfigureTemplatesDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigureTemplatesDialog类属于com.intellij.ide.fileTemplates.ui包,在下文中一共展示了ConfigureTemplatesDialog类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.ide.fileTemplates.ui.ConfigureTemplatesDialog; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e){
Project project = e.getData(PlatformDataKeys.PROJECT);
String fileText = e.getData(PlatformDataKeys.FILE_TEXT);
VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
String extension = file.getExtension();
String nameWithoutExtension = file.getNameWithoutExtension();
AllFileTemplatesConfigurable fileTemplateOptions = new AllFileTemplatesConfigurable();
ConfigureTemplatesDialog dialog = new ConfigureTemplatesDialog(project, fileTemplateOptions);
PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE);
for(SaveFileAsTemplateHandler handler: Extensions.getExtensions(SaveFileAsTemplateHandler.EP_NAME)) {
String textFromHandler = handler.getTemplateText(psiFile, fileText, nameWithoutExtension);
if (textFromHandler != null) {
fileText = textFromHandler;
break;
}
}
fileTemplateOptions.createNewTemplate(nameWithoutExtension, extension, fileText);
dialog.show();
}
示例2: actionPerformed
import com.intellij.ide.fileTemplates.ui.ConfigureTemplatesDialog; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(@Nonnull AnActionEvent e){
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
String fileText = e.getData(PlatformDataKeys.FILE_TEXT);
VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
String extension = file.getExtension();
String nameWithoutExtension = file.getNameWithoutExtension();
AllFileTemplatesConfigurable fileTemplateOptions = new AllFileTemplatesConfigurable(project);
ConfigureTemplatesDialog dialog = new ConfigureTemplatesDialog(project, fileTemplateOptions);
PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE);
for(SaveFileAsTemplateHandler handler: Extensions.getExtensions(SaveFileAsTemplateHandler.EP_NAME)) {
String textFromHandler = handler.getTemplateText(psiFile, fileText, nameWithoutExtension);
if (textFromHandler != null) {
fileText = textFromHandler;
break;
}
}
fileTemplateOptions.createNewTemplate(nameWithoutExtension, extension, fileText);
dialog.show();
}
示例3: actionPerformed
import com.intellij.ide.fileTemplates.ui.ConfigureTemplatesDialog; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e){
ConfigureTemplatesDialog dialog = new ConfigureTemplatesDialog(CommonDataKeys.PROJECT.getData(e.getDataContext()));
dialog.show();
}
示例4: actionPerformed
import com.intellij.ide.fileTemplates.ui.ConfigureTemplatesDialog; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e){
ConfigureTemplatesDialog dialog = new ConfigureTemplatesDialog(PlatformDataKeys.PROJECT.getData(e.getDataContext()));
dialog.show();
}
示例5: actionPerformed
import com.intellij.ide.fileTemplates.ui.ConfigureTemplatesDialog; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e){
ConfigureTemplatesDialog dialog = new ConfigureTemplatesDialog(e.getDataContext().getData(CommonDataKeys.PROJECT));
dialog.show();
}