本文整理匯總了Java中com.intellij.lang.Language.getID方法的典型用法代碼示例。如果您正苦於以下問題:Java Language.getID方法的具體用法?Java Language.getID怎麽用?Java Language.getID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.lang.Language
的用法示例。
在下文中一共展示了Language.getID方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validateTemplatesForLanguage
import com.intellij.lang.Language; //導入方法依賴的package包/類
private static void validateTemplatesForLanguage(Language key, List<PostfixTemplateProvider> providers) {
Set<String> templateKeys = ContainerUtil.newHashSet();
for (PostfixTemplateProvider provider : providers) {
for (PostfixTemplate template : provider.getTemplates()) {
if (!templateKeys.add(template.getKey())) {
throw new IllegalStateException("Duplicated key " + template.getKey() + " for language " + key.getID());
}
}
}
}
示例2: addInjectionInPlace
import com.intellij.lang.Language; //導入方法依賴的package包/類
@Override
public boolean addInjectionInPlace(Language language, final PsiLanguageInjectionHost psiElement) {
if (!isMine(psiElement)) return false;
String id = language.getID();
if (psiElement instanceof XmlAttributeValue) {
return doInjectInAttributeValue((XmlAttributeValue)psiElement, id);
}
else if (psiElement instanceof XmlText) {
return doInjectInXmlText((XmlText)psiElement, id);
}
return false;
}
示例3: keyToString
import com.intellij.lang.Language; //導入方法依賴的package包/類
@NotNull
@Override
protected String keyToString(@NotNull Language key) {
return key.getID();
}
示例4: getSelectedTabPropertyName
import com.intellij.lang.Language; //導入方法依賴的package包/類
@NotNull
private static String getSelectedTabPropertyName(@NotNull TabbedLanguageCodeStylePanel panel) {
Language language = panel.getDefaultLanguage();
return language != null ? SELECTED_TAB + "." + language.getID() : SELECTED_TAB;
}
示例5: LanguageFilterAction
import com.intellij.lang.Language; //導入方法依賴的package包/類
public LanguageFilterAction(final @Nullable Language language) {
super(language == null ? "Language is not specified" : language.getDisplayName());
myLanguageId = language == null ? null : language.getID();
}
示例6: serialize
import com.intellij.lang.Language; //導入方法依賴的package包/類
@Override
protected String serialize(final Language language) {
return language.getID();
}
示例7: saveHistory
import com.intellij.lang.Language; //導入方法依賴的package包/類
private static void saveHistory(Project project, String text, Object value) {
if (project == null || project.isDisposed() || !project.isInitialized()) {
return;
}
HistoryType type = null;
String fqn = null;
if (isActionValue(value)) {
type = HistoryType.ACTION;
AnAction action = (AnAction)(value instanceof GotoActionModel.ActionWrapper ? ((GotoActionModel.ActionWrapper)value).getAction() : value);
fqn = ActionManager.getInstance().getId(action);
} else if (value instanceof VirtualFile) {
type = HistoryType.FILE;
fqn = ((VirtualFile)value).getUrl();
} else if (value instanceof ChooseRunConfigurationPopup.ItemWrapper) {
type = HistoryType.RUN_CONFIGURATION;
fqn = ((ChooseRunConfigurationPopup.ItemWrapper)value).getText();
} else if (value instanceof PsiElement) {
final PsiElement psiElement = (PsiElement)value;
final Language language = psiElement.getLanguage();
final String name = LanguagePsiElementExternalizer.INSTANCE.forLanguage(language).getQualifiedName(psiElement);
if (name != null) {
type = HistoryType.PSI;
fqn = language.getID() + "://" + name;
}
}
final PropertiesComponent storage = PropertiesComponent.getInstance(project);
final String[] values = storage.getValues(SE_HISTORY_KEY);
List<HistoryItem> history = new ArrayList<HistoryItem>();
if (values != null) {
for (String s : values) {
final String[] split = s.split("\t");
if (split.length != 3 || text.equals(split[0])) {
continue;
}
if (!StringUtil.isEmpty(split[0])) {
history.add(new HistoryItem(split[0], split[1], split[2]));
}
}
}
history.add(0, new HistoryItem(text, type == null ? null : type.name(), fqn));
if (history.size() > MAX_SEARCH_EVERYWHERE_HISTORY) {
history = history.subList(0, MAX_SEARCH_EVERYWHERE_HISTORY);
}
final String[] newValues = new String[history.size()];
for (int i = 0; i < newValues.length; i++) {
newValues[i] = history.get(i).toString();
}
storage.setValues(SE_HISTORY_KEY, newValues);
}
示例8: serialize
import com.intellij.lang.Language; //導入方法依賴的package包/類
@Nullable
@Override
protected String serialize(Language language) {
return language.getID();
}
示例9: nameForElement
import com.intellij.lang.Language; //導入方法依賴的package包/類
@Override
protected String nameForElement(Language type) {
return type.getID();
}