當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。