当前位置: 首页>>代码示例>>Java>>正文


Java BaseJavaScriptLanguageVersion类代码示例

本文整理汇总了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"));
}
 
开发者ID:consulo,项目名称:consulo-nodejs,代码行数:34,代码来源:NodeJSModuleExtensionPanel.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:15,代码来源:JavaScriptQuickFixFactory.java

示例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());
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:11,代码来源:JavaScriptSyntaxHighlightFactory.java

示例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"));
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:31,代码来源:ClientJavaScriptModuleExtensionPanel.java


注:本文中的consulo.javascript.lang.BaseJavaScriptLanguageVersion类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。