本文整理汇总了Java中org.intellij.lang.regexp.RegExpLanguage类的典型用法代码示例。如果您正苦于以下问题:Java RegExpLanguage类的具体用法?Java RegExpLanguage怎么用?Java RegExpLanguage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegExpLanguage类属于org.intellij.lang.regexp包,在下文中一共展示了RegExpLanguage类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: injectLanguages
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
@Override
@RequiredReadAction
public void injectLanguages(@NotNull MultiHostRegistrar registrar, @NotNull PsiElement context)
{
if(context instanceof JSSimpleLiteralExpression)
{
IElementType literalElementType = ((JSSimpleLiteralExpression) context).getLiteralElementType();
if(literalElementType == JSTokenTypes.REGEXP_LITERAL)
{
int textLength = context.getTextLength() - 1;
String text = context.getText();
if(text.charAt(textLength) != '/')
{
textLength --;
}
registrar.startInjecting(RegExpLanguage.INSTANCE).addPlace(null, null, (PsiLanguageInjectionHost) context, new TextRange(1, textLength)).doneInjecting();
}
}
}
开发者ID:consulo,项目名称:consulo-javascript,代码行数:21,代码来源:JavaScriptRegexpMultiHostInjector.java
示例2: isAvailable
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
Pair<PsiElement, TextRange> pair = getRangePair(file, editor);
if (pair != null && pair.first != null) {
Language language = pair.first.getLanguage();
return language.isKindOf(RegExpLanguage.INSTANCE);
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CheckRegExpIntentionAction.java
示例3: createUIComponents
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
private void createUIComponents() {
myValuePattern = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getValuePattern(), new LanguageTextField.SimpleDocumentCreator() {
public void customizePsiFile(PsiFile psiFile) {
psiFile.putCopyableUserData(ValueRegExpAnnotator.KEY, Boolean.TRUE);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AdvancedPanel.java
示例4: createUIComponents
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
private void createUIComponents() {
myLanguagePanel = new LanguagePanel(myProject, myOrigInjection);
myTagPanel = new TagPanel(myProject, myOrigInjection);
myAdvancedPanel = new AdvancedXmlPanel(myProject, myOrigInjection);
myLocalName = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getAttributeName());
myNamespace = new ComboBox(200);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:XmlAttributePanel.java
示例5: ConfigUI
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
/**
* Constructor.
*
* @param config Configuration for this UI to display.
* @param project
*/
public ConfigUI(Config config, Project project) {
super(new BorderLayout());
filterFieldName = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterFieldName());
filterFieldType = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterFieldType());
filterMethodName = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterMethodName());
filterMethodType = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterMethodType());
init();
setConfig(config);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ConfigUI.java
示例6: isAvailable
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
final Pair<PsiElement, TextRange> pair = getRangePair(file, editor);
/*super.isAvailable(project, editor, file) && */
if (pair != null && pair.first != null) {
Language language = pair.first.getLanguage();
Language baseLanguage = language.getBaseLanguage();
return language == RegExpLanguage.INSTANCE || baseLanguage == RegExpLanguage.INSTANCE;
}
return false;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:CheckRegExpIntentionAction.java
示例7: getLanguagesToInject
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
@Override
public void getLanguagesToInject(@NotNull PsiLanguageInjectionHost host, @NotNull InjectedLanguagePlaces injectionPlacesRegistrar) {
if (host instanceof HaxeRegularExpression) {
final String text = host.getText();
final TextRange textRange = new TextRange(text.indexOf('/') + 1, text.lastIndexOf('/'));
injectionPlacesRegistrar.addPlace(RegExpLanguage.INSTANCE, textRange, null, null);
}
}
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:9,代码来源:RegexLanguageInjector.java
示例8: ConfigUI
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
/**
* Constructor.
*
* @param config Configuration for this UI to display.
* @param project
*/
public ConfigUI(Config config, Project project)
{
super(new BorderLayout());
filterFieldName = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterFieldName());
filterFieldType = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterFieldType());
filterMethodName = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterMethodName());
filterMethodType = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterMethodType());
init();
setConfig(config);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:ConfigUI.java
示例9: PythonVerboseRegexpLanguage
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
public PythonVerboseRegexpLanguage() {
super(RegExpLanguage.INSTANCE, "PythonVerboseRegExp");
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PythonVerboseRegexpLanguage.java
示例10: PythonRegexpLanguage
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
public PythonRegexpLanguage() {
super(RegExpLanguage.INSTANCE, "PythonRegExp");
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PythonRegexpLanguage.java
示例11: getLanguage
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
@NotNull
public Language getLanguage() {
return RegExpLanguage.INSTANCE;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:RegExpElementImpl.java
示例12: getIcon
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
@Override
public Icon getIcon(int flags) {
//noinspection ConstantConditions
return RegExpLanguage.INSTANCE.getAssociatedFileType().getIcon();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CheckRegExpIntentionAction.java
示例13: createUIComponents
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
private void createUIComponents() {
myProject = myRegexpFile.getProject();
Document document = PsiDocumentManager.getInstance(myProject).getDocument(myRegexpFile);
myRegExp = new EditorTextField(document, myProject, RegExpLanguage.INSTANCE.getAssociatedFileType());
myRegExp.setPreferredWidth(Math.max(300, myRegExp.getPreferredSize().width));
final String sampleText = PropertiesComponent.getInstance(myProject).getValue(LAST_EDITED_REGEXP, "Sample Text");
mySampleText = new EditorTextField(sampleText, myProject, PlainTextFileType.INSTANCE);
mySampleText.setBorder(
new CompoundBorder(new EmptyBorder(2, 2, 2, 4), new LineBorder(UIUtil.isUnderDarcula() ? Gray._100 : JBColor.border())));
mySampleText.setOneLineMode(false);
myRootPanel = new JPanel(new BorderLayout()) {
Disposable disposable;
@Override
public void addNotify() {
super.addNotify();
disposable = Disposer.newDisposable();
IdeFocusManager.getGlobalInstance().requestFocus(mySampleText, true);
new AnAction(){
@Override
public void actionPerformed(AnActionEvent e) {
IdeFocusManager.findInstance().requestFocus(myRegExp.getFocusTarget(), true);
}
}.registerCustomShortcutSet(CustomShortcutSet.fromString("shift TAB"), mySampleText);
final Alarm updater = new Alarm(Alarm.ThreadToUse.SWING_THREAD, disposable);
DocumentAdapter documentListener = new DocumentAdapter() {
@Override
public void documentChanged(DocumentEvent e) {
updater.cancelAllRequests();
if (!updater.isDisposed()) {
updater.addRequest(new Runnable() {
@Override
public void run() {
updateBalloon();
}
}, 200);
}
}
};
myRegExp.addDocumentListener(documentListener);
mySampleText.addDocumentListener(documentListener);
updateBalloon();
mySampleText.selectAll();
}
@Override
public void removeNotify() {
super.removeNotify();
Disposer.dispose(disposable);
PropertiesComponent.getInstance(myProject).setValue(LAST_EDITED_REGEXP, mySampleText.getText());
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:60,代码来源:CheckRegExpForm.java
示例14: createUIComponents
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
private void createUIComponents() {
myLocalName = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getTagName());
myNamespace = new ComboBox(200);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TagPanel.java
示例15: PhpRegexpCommentModeLanguage
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
private PhpRegexpCommentModeLanguage() {
super(RegExpLanguage.INSTANCE, "PhpRegExpCommentMode");
}
开发者ID:dryabov,项目名称:phpregexp,代码行数:4,代码来源:PhpRegexpCommentModeLanguage.java
示例16: PhpRegexpLanguage
import org.intellij.lang.regexp.RegExpLanguage; //导入依赖的package包/类
private PhpRegexpLanguage() {
super(RegExpLanguage.INSTANCE, "PhpRegExp");
}
开发者ID:dryabov,项目名称:phpregexp,代码行数:4,代码来源:PhpRegexpLanguage.java
注:本文中的org.intellij.lang.regexp.RegExpLanguage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论