本文整理匯總了Java中com.intellij.lang.javascript.JavaScriptSupportLoader.isFlexMxmFile方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaScriptSupportLoader.isFlexMxmFile方法的具體用法?Java JavaScriptSupportLoader.isFlexMxmFile怎麽用?Java JavaScriptSupportLoader.isFlexMxmFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.lang.javascript.JavaScriptSupportLoader
的用法示例。
在下文中一共展示了JavaScriptSupportLoader.isFlexMxmFile方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getClassFromTagNameInMxml
import com.intellij.lang.javascript.JavaScriptSupportLoader; //導入方法依賴的package包/類
public static JSClass getClassFromTagNameInMxml(final PsiElement psiElement)
{
XmlTag tag = psiElement != null ? PsiTreeUtil.getNonStrictParentOfType(psiElement, XmlTag.class) : null;
if(tag != null && (tag.getNamespacePrefix().length() > 0 || JavaScriptSupportLoader.isFlexMxmFile(tag.getContainingFile())))
{
if(isScriptContextTag(tag))
{
tag = ((XmlFile) tag.getContainingFile()).getDocument().getRootTag();
}
final XmlElementDescriptor descriptor = tag.getDescriptor();
if(descriptor != null)
{
PsiElement decl = descriptor.getDeclaration();
if(decl instanceof JSClass)
{
return ((JSClass) decl);
}
else if(decl instanceof XmlFile)
{
return XmlBackedJSClassImpl.getXmlBackedClass((XmlFile) decl);
}
}
}
return null;
}
示例2: findScriptNs
import com.intellij.lang.javascript.JavaScriptSupportLoader; //導入方法依賴的package包/類
public static String findScriptNs(XmlTag rootTag)
{
String ns = rootTag.getNamespace();
if(JavaScriptSupportLoader.isFlexMxmFile(rootTag.getContainingFile()))
{
ns = "";
for(String testNs : JavaScriptSupportLoader.MXML_URIS)
{
if(rootTag.getPrefixByNamespace(testNs) != null)
{
ns = testNs;
break;
}
}
}
return ns;
}
示例3: actionPerformed
import com.intellij.lang.javascript.JavaScriptSupportLoader; //導入方法依賴的package包/類
@Override
public void actionPerformed(final AnActionEvent e)
{
Editor editor = e.getData(PlatformDataKeys.EDITOR);
PsiFile psifile = e.getData(LangDataKeys.PSI_FILE);
Project project = e.getData(PlatformDataKeys.PROJECT);
final VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
if(JavaScriptSupportLoader.isFlexMxmFile(file))
{
editor = BaseCodeInsightAction.getInjectedEditor(project, editor);
psifile = PsiUtilBase.getPsiFileInEditor(editor, project);
}
new JavaScriptGenerateAccessorHandler(getGenerationMode()).invoke(project, editor, psifile);
}
示例4: update
import com.intellij.lang.javascript.JavaScriptSupportLoader; //導入方法依賴的package包/類
@Override
public void update(final AnActionEvent e)
{
final VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
boolean status = false;
if(file != null)
{
if(file.getFileType() == JavaScriptFileType.INSTANCE)
{
final Editor editor = e.getData(PlatformDataKeys.EDITOR);
final PsiFile psifile = e.getData(LangDataKeys.PSI_FILE);
if(editor != null && psifile != null)
{
status = psifile.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4;
}
}
else if(JavaScriptSupportLoader.isFlexMxmFile(file))
{
status = true;
}
}
e.getPresentation().setEnabled(status);
e.getPresentation().setVisible(status);
}
示例5: isNewResolveAndCompletion
import com.intellij.lang.javascript.JavaScriptSupportLoader; //導入方法依賴的package包/類
public static boolean isNewResolveAndCompletion(PsiFile psiFile)
{
return psiFile.getLanguage().isKindOf(JavaScriptSupportLoader.ECMA_SCRIPT_L4) || JavaScriptSupportLoader.isFlexMxmFile(psiFile);
}
示例6: supports
import com.intellij.lang.javascript.JavaScriptSupportLoader; //導入方法依賴的package包/類
@Override
public boolean supports(PsiFile file)
{
return file.getLanguage() == JavaScriptSupportLoader.ECMA_SCRIPT_L4 || JavaScriptSupportLoader.isFlexMxmFile(file);
}