本文整理汇总了Java中org.intellij.lang.xpath.XPathFileType类的典型用法代码示例。如果您正苦于以下问题:Java XPathFileType类的具体用法?Java XPathFileType怎么用?Java XPathFileType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XPathFileType类属于org.intellij.lang.xpath包,在下文中一共展示了XPathFileType类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
@Nullable
public XPathVariable resolve() {
if (getContainingFile().getLanguage() == XPathFileType.XPATH2.getLanguage()) {
XPathVariableHolder f = PsiTreeUtil.getParentOfType(this, XPathVariableHolder.class, true);
while (f != null) {
final XPathVariable variable = findVariable(f.getVariables(), getReferencedName());
if (variable != null) {
return variable;
}
f = PsiTreeUtil.getParentOfType(f, XPathVariableHolder.class, true);
}
}
final VariableContext context = getXPathContext().getVariableContext();
if (context == null) {
return null;
}
return context.resolve(this);
}
示例2: DefaultProvider
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
public DefaultProvider(XmlElement element, Language language) {
myContextElement = element;
myContextType = language == XPathFileType.XPATH2.getLanguage() ? ContextType.PLAIN_V2 : ContextType.PLAIN;
if (myContextElement != null) {
myNamespaceContext = XsltNamespaceContext.NAMESPACE_CONTEXT;
setXPathInjected(myContextElement.getContainingFile());
} else {
myNamespaceContext = NULL_NAMESPACE_CONTEXT;
}
}
示例3: EditContextDialog
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
public EditContextDialog(Project project,
Set<String> unresolvedPrefixes,
Collection<Namespace> namespaces,
Collection<Variable> variables,
ContextProvider contextProvider) {
super(project, false);
myUnresolvedPrefixes = unresolvedPrefixes;
setTitle("Edit XPath Context");
setModal(true);
myContextProvider = new MyContextProvider(contextProvider);
final List<Variable> m = copy(variables);
myVariableTableModel = new VariableTableModel(m, project, XPathFileType.XPATH);
myVariableTable = new Table(myVariableTableModel);
myVariableTable.setDefaultRenderer(String.class, new VariableCellRenderer(m));
myVariableTable.setDefaultRenderer(Expression.class, new ExpressionCellRenderer(project));
myVariableTable.setDefaultEditor(Expression.class, new ExpressionCellEditor(project));
int width = new JLabel("Name").getPreferredSize().width;
myVariableTable.getColumnModel().getColumn(0).setMinWidth(width);
myVariableTable.getColumnModel().getColumn(0).setMaxWidth(width * 5);
myVariableTable.setPreferredScrollableViewportSize(new Dimension(200, 130));
final List<Namespace> n = copy(namespaces);
myNamespaceTableModel = new NamespaceTableModel(n);
myNamespaceTable = new Table(myNamespaceTableModel);
myNamespaceTable.setDefaultRenderer(String.class, new NamespaceCellRenderer(n));
width = new JLabel("Prefix").getPreferredSize().width;
myNamespaceTable.getColumnModel().getColumn(0).setMinWidth(width);
myNamespaceTable.getColumnModel().getColumn(0).setMaxWidth(width * 4);
myNamespaceTable.setPreferredScrollableViewportSize(new Dimension(200, 150));
init();
}
示例4: acceptsLanguage
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
protected boolean acceptsLanguage(Language language) {
return language == XPathFileType.XPATH.getLanguage() || language == XPathFileType.XPATH2.getLanguage();
}
示例5: acceptsLanguage
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
protected boolean acceptsLanguage(Language language) {
return language == XPathFileType.XPATH.getLanguage();
}
示例6: getNamesValidator
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
public NamesValidator getNamesValidator() {
if (myNamesValidator == null) {
myNamesValidator = LanguageNamesValidation.INSTANCE.forLanguage(XPathFileType.XPATH.getLanguage());
}
return myNamesValidator;
}
示例7: acceptsLanguage
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
protected boolean acceptsLanguage(Language language) {
return language == XPathFileType.XPATH2.getLanguage();
}
示例8: isInputValid
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
public boolean isInputValid(String newName, PsiElement element, ProcessingContext context) {
return LanguageNamesValidation.INSTANCE.forLanguage(XPathFileType.XPATH.getLanguage())
.isIdentifier(newName, element.getProject());
}
示例9: actionPerformedImpl
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
@Override
protected boolean actionPerformedImpl(PsiFile file, Editor editor, XmlAttribute context, int offset) {
if (file.getLanguage() != XPathFileType.XPATH2.getLanguage()) return false;
return super.actionPerformedImpl(file, editor, context, offset);
}
示例10: isEnabledForLanguage
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
@Override
public boolean isEnabledForLanguage(Language l) {
return l == XPathFileType.XPATH.getLanguage() || l == XMLLanguage.INSTANCE || l == XsltLanguage.INSTANCE;
}
示例11: XsltDebuggerEditorsProvider
import org.intellij.lang.xpath.XPathFileType; //导入依赖的package包/类
public XsltDebuggerEditorsProvider(XsltChecker.LanguageLevel level) {
myFileType = level == XsltChecker.LanguageLevel.V2 ? XPathFileType.XPATH2 : XPathFileType.XPATH;
}