本文整理汇总了Java中consulo.javascript.lang.BaseJavaScriptLanguageVersion类的典型用法代码示例。如果您正苦于以下问题:Java BaseJavaScriptLanguageVersion类的具体用法?Java BaseJavaScriptLanguageVersion怎么用?Java BaseJavaScriptLanguageVersion使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseJavaScriptLanguageVersion类属于consulo.javascript.lang包,在下文中一共展示了BaseJavaScriptLanguageVersion类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NodeJSModuleExtensionPanel
import consulo.javascript.lang.BaseJavaScriptLanguageVersion; //导入依赖的package包/类
@RequiredDispatchThread
public NodeJSModuleExtensionPanel(final NodeJSMutableModuleExtension extension, Runnable runnable)
{
super(new VerticalFlowLayout(true, false));
add(ModuleExtensionSdkBoxBuilder.createAndDefine(extension, runnable).build());
List<JavaScriptLanguageVersion> validLanguageVersions = StandardJavaScriptVersions.getInstance().getValidLanguageVersions();
ComboBox languageVersionComboBox = new ComboBox(new CollectionComboBoxModel(validLanguageVersions, extension.getLanguageVersion()));
languageVersionComboBox.addItemListener(new ItemListener()
{
@Override
public void itemStateChanged(ItemEvent e)
{
if(e.getStateChange() == ItemEvent.SELECTED)
{
//noinspection unchecked
extension.setLanguageVersion((LanguageVersion) e.getItem());
}
}
});
languageVersionComboBox.setRenderer(new ColoredListCellRenderer<BaseJavaScriptLanguageVersion>()
{
@Override
protected void customizeCellRenderer(JList list, BaseJavaScriptLanguageVersion value, int index, boolean selected, boolean hasFocus)
{
append(value.getPresentableName());
}
});
add(LabeledComponent.create(languageVersionComboBox, "Language Version"));
}
示例2: byElement
import consulo.javascript.lang.BaseJavaScriptLanguageVersion; //导入依赖的package包/类
@NotNull
public static JavaScriptQuickFixFactory byElement(PsiElement element)
{
LanguageVersion languageVersion = element.getLanguageVersion();
if(languageVersion instanceof BaseJavaScriptLanguageVersion)
{
JavaScriptQuickFixFactory quickFixFactory = EP.findSingle(languageVersion.getName());
if(quickFixFactory != null)
{
return quickFixFactory;
}
}
return ourDefaultImpl;
}
示例3: getSyntaxHighlighter
import consulo.javascript.lang.BaseJavaScriptLanguageVersion; //导入依赖的package包/类
@NotNull
@Override
public SyntaxHighlighter getSyntaxHighlighter(@NotNull LanguageVersion languageVersion)
{
if(languageVersion instanceof BaseJavaScriptLanguageVersion)
{
return ((BaseJavaScriptLanguageVersion) languageVersion).getSyntaxHighlighter();
}
throw new IllegalArgumentException(languageVersion.toString());
}
示例4: ClientJavaScriptModuleExtensionPanel
import consulo.javascript.lang.BaseJavaScriptLanguageVersion; //导入依赖的package包/类
public ClientJavaScriptModuleExtensionPanel(final JavaScriptMutableModuleExtension<?> extension)
{
super(new VerticalFlowLayout(true, false));
List<JavaScriptLanguageVersion> validLanguageVersions = StandardJavaScriptVersions.getInstance().getValidLanguageVersions();
ComboBox languageVersionComboBox = new ComboBox(new CollectionComboBoxModel(validLanguageVersions, extension.getLanguageVersion()));
languageVersionComboBox.addItemListener(new ItemListener()
{
@Override
public void itemStateChanged(ItemEvent e)
{
if(e.getStateChange() == ItemEvent.SELECTED)
{
//noinspection unchecked
extension.setLanguageVersion((LanguageVersion) e.getItem());
}
}
});
languageVersionComboBox.setRenderer(new ColoredListCellRenderer<BaseJavaScriptLanguageVersion>()
{
@Override
protected void customizeCellRenderer(@NotNull JList list, BaseJavaScriptLanguageVersion value, int index, boolean selected, boolean hasFocus)
{
append(value.getPresentableName());
}
});
add(LabeledComponent.left(languageVersionComboBox, "Language Version"));
}