本文整理匯總了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"));
}