本文整理汇总了Java中com.intellij.lang.refactoring.InlineActionHandler类的典型用法代码示例。如果您正苦于以下问题:Java InlineActionHandler类的具体用法?Java InlineActionHandler怎么用?Java InlineActionHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InlineActionHandler类属于com.intellij.lang.refactoring包,在下文中一共展示了InlineActionHandler类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: invoke
import com.intellij.lang.refactoring.InlineActionHandler; //导入依赖的package包/类
@Override
public void invoke(@NotNull Project project, @NotNull PsiElement[] elements, DataContext dataContext) {
LOG.assertTrue(elements.length == 1);
if (dataContext == null) {
dataContext = DataManager.getInstance().getDataContext();
}
final Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
for(InlineActionHandler handler: Extensions.getExtensions(InlineActionHandler.EP_NAME)) {
if (handler.canInlineElement(elements[0])) {
handler.inlineElement(project, editor, elements [0]);
return;
}
}
invokeInliner(editor, elements[0]);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:InlineRefactoringActionHandler.java
示例2: invoke
import com.intellij.lang.refactoring.InlineActionHandler; //导入依赖的package包/类
@Override
public void invoke(@NotNull Project project, @NotNull PsiElement[] elements, DataContext dataContext) {
LOG.assertTrue(elements.length == 1);
if (dataContext == null) {
dataContext = DataManager.getInstance().getDataContext();
}
final Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
for(InlineActionHandler handler: Extensions.getExtensions(InlineActionHandler.EP_NAME)) {
if (handler.canInlineElement(elements[0])) {
handler.inlineElement(project, editor, elements [0]);
return;
}
}
invokeInliner(editor, elements[0]);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:InlineRefactoringActionHandler.java
示例3: invoke
import com.intellij.lang.refactoring.InlineActionHandler; //导入依赖的package包/类
@Override
public void invoke(@Nonnull Project project, @Nonnull PsiElement[] elements, DataContext dataContext) {
LOG.assertTrue(elements.length == 1);
if (dataContext == null) {
dataContext = DataManager.getInstance().getDataContext();
}
final Editor editor = dataContext.getData(PlatformDataKeys.EDITOR);
for(InlineActionHandler handler: Extensions.getExtensions(InlineActionHandler.EP_NAME)) {
if (handler.canInlineElement(elements[0])) {
handler.inlineElement(project, editor, elements [0]);
return;
}
}
invokeInliner(editor, elements[0]);
}
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:InlineRefactoringActionHandler.java
示例4: hasInlineActionHandler
import com.intellij.lang.refactoring.InlineActionHandler; //导入依赖的package包/类
private static boolean hasInlineActionHandler(PsiElement element, @Nullable Language editorLanguage, Editor editor) {
for(InlineActionHandler handler: Extensions.getExtensions(InlineActionHandler.EP_NAME)) {
if (handler.isEnabledOnElement(element, editor)) {
return true;
}
}
return InlineHandlers.getInlineHandlers(
editorLanguage != null ? editorLanguage :element.getLanguage()
).size() > 0;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:InlineAction.java
示例5: isAvailableForLanguage
import com.intellij.lang.refactoring.InlineActionHandler; //导入依赖的package包/类
@Override
protected boolean isAvailableForLanguage(Language language) {
for(InlineActionHandler handler: Extensions.getExtensions(InlineActionHandler.EP_NAME)) {
if (handler.isEnabledForLanguage(language)) {
return true;
}
}
return InlineHandlers.getInlineHandlers(language).size() > 0;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:InlineAction.java
示例6: inlineElement
import com.intellij.lang.refactoring.InlineActionHandler; //导入依赖的package包/类
private void inlineElement(final PsiElement element){
if (element == null) return;
if (!(element instanceof PsiModifierListOwner)) return;
boolean isPublic = ((PsiModifierListOwner) element).hasModifierProperty("public");
if (isPublic) return;
for (final InlineActionHandler handler : Extensions.getExtensions(InlineActionHandler.EP_NAME)) {
if (handler.canInlineElement(element)) {
handler.inlineElement(element.getProject(), null, element);
return;
}
}
}
开发者ID:elusive-code,项目名称:shuffler,代码行数:16,代码来源:InliningVisitor.java
注:本文中的com.intellij.lang.refactoring.InlineActionHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论