本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.newLinkedHashMap方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.newLinkedHashMap方法的具体用法?Java ContainerUtil.newLinkedHashMap怎么用?Java ContainerUtil.newLinkedHashMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.newLinkedHashMap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DfaMemoryStateImpl
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
protected DfaMemoryStateImpl(DfaMemoryStateImpl toCopy) {
myFactory = toCopy.myFactory;
myEphemeral = toCopy.myEphemeral;
myDefaultVariableStates = toCopy.myDefaultVariableStates; // shared between all states
myStack = new Stack<DfaValue>(toCopy.myStack);
myDistinctClasses = new TLongHashSet(toCopy.myDistinctClasses.toArray());
myUnknownVariables = ContainerUtil.newLinkedHashSet(toCopy.myUnknownVariables);
myEqClasses = ContainerUtil.newArrayList(toCopy.myEqClasses);
myIdToEqClassesIndices = new MyIdMap(toCopy.myIdToEqClassesIndices.size());
toCopy.myIdToEqClassesIndices.forEachEntry(new TIntObjectProcedure<int[]>() {
@Override
public boolean execute(int id, int[] set) {
myIdToEqClassesIndices.put(id, set);
return true;
}
});
myVariableStates = ContainerUtil.newLinkedHashMap(toCopy.myVariableStates);
myCachedDistinctClassPairs = toCopy.myCachedDistinctClassPairs;
myCachedNonTrivialEqClasses = toCopy.myCachedNonTrivialEqClasses;
myCachedHash = toCopy.myCachedHash;
}
示例2: getLabelsForRefs
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static Map<String, Color> getLabelsForRefs(@NotNull List<VcsRef> branches, @NotNull Collection<VcsRef> tags) {
Map<String, Color> labels = ContainerUtil.newLinkedHashMap();
for (VcsRef branch : branches) {
labels.put(branch.getName(), branch.getType().getBackgroundColor());
}
if (!tags.isEmpty()) {
VcsRef firstTag = tags.iterator().next();
Color color = firstTag.getType().getBackgroundColor();
if (tags.size() > 1) {
labels.put(firstTag.getName() + " +", color);
}
else {
labels.put(firstTag.getName(), color);
}
}
return labels;
}
示例3: checkUnknownMacros
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static void checkUnknownMacros(@NotNull Project project, boolean notify) {
// use linked set/map to get stable results
Set<String> unknownMacros = new LinkedHashSet<String>();
Map<TrackingPathMacroSubstitutor, IComponentStore> substitutorToStore = ContainerUtil.newLinkedHashMap();
collect(project, unknownMacros, substitutorToStore);
for (Module module : ModuleManager.getInstance(project).getModules()) {
collect(module, unknownMacros, substitutorToStore);
}
if (unknownMacros.isEmpty()) {
return;
}
if (notify) {
doNotify(unknownMacros, project, substitutorToStore);
return;
}
checkUnknownMacros(project, false, unknownMacros, substitutorToStore);
}
示例4: loadProperties
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
* Like {@link Properties#load(Reader)}, but preserves the order of key/value pairs.
*/
@NotNull
public static Map<String, String> loadProperties(@NotNull Reader reader) throws IOException {
final Map<String, String> map = ContainerUtil.newLinkedHashMap();
new Properties() {
@Override
public synchronized Object put(Object key, Object value) {
map.put(String.valueOf(key), String.valueOf(value));
//noinspection UseOfPropertiesAsHashtable
return super.put(key, value);
}
}.load(reader);
return map;
}
示例5: startLoadingCommits
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void startLoadingCommits() {
Map<RepositoryNode, MyRepoModel> priorityLoading = ContainerUtil.newLinkedHashMap();
Map<RepositoryNode, MyRepoModel> others = ContainerUtil.newLinkedHashMap();
RepositoryNode nodeForCurrentEditor = findNodeByRepo(myCurrentlyOpenedRepository);
for (Map.Entry<RepositoryNode, MyRepoModel<?, ?, ?>> entry : myView2Model.entrySet()) {
MyRepoModel model = entry.getValue();
Repository repository = model.getRepository();
RepositoryNode repoNode = entry.getKey();
if (preselectByUser(repository)) {
priorityLoading.put(repoNode, model);
}
else if (model.getSupport().shouldRequestIncomingChangesForNotCheckedRepositories() && !repoNode.equals(nodeForCurrentEditor)) {
others.put(repoNode, model);
}
}
if (nodeForCurrentEditor != null) {
//add repo for currently opened editor to the end of priority queue
priorityLoading.put(nodeForCurrentEditor, myView2Model.get(nodeForCurrentEditor));
}
loadCommitsFromMap(priorityLoading);
loadCommitsFromMap(others);
}
示例6: getDifference
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
Map<TemplateContextType, Boolean> getDifference(@Nullable TemplateContext defaultContext) {
Map<TemplateContextType, Boolean> result = ContainerUtil.newLinkedHashMap();
synchronized (myContextStates) {
//noinspection NestedSynchronizedStatement
synchronized (defaultContext == null ? myContextStates : defaultContext.myContextStates) {
for (TemplateContextType contextType : TemplateManagerImpl.getAllContextTypes()) {
Boolean ownValue = getOwnValue(contextType);
if (ownValue != null) {
if (defaultContext == null || isEnabled(contextType) != defaultContext.isEnabled(contextType)) {
result.put(contextType, ownValue);
}
}
}
}
}
return result;
}
示例7: getOccurrenceOptions
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected Map<OccurrencesChooser.ReplaceChoice, List<Object>> getOccurrenceOptions(@NotNull GrIntroduceContext context) {
HashMap<OccurrencesChooser.ReplaceChoice, List<Object>> map = ContainerUtil.newLinkedHashMap();
GrVariable localVar = resolveLocalVar(context);
if (localVar != null) {
map.put(OccurrencesChooser.ReplaceChoice.ALL, Arrays.<Object>asList(context.getOccurrences()));
return map;
}
if (context.getExpression() != null) {
map.put(OccurrencesChooser.ReplaceChoice.NO, Collections.<Object>singletonList(context.getExpression()));
}
else if (context.getStringPart() != null) {
map.put(OccurrencesChooser.ReplaceChoice.NO, Collections.<Object>singletonList(context.getStringPart()));
}
PsiElement[] occurrences = context.getOccurrences();
if (occurrences.length > 1) {
map.put(OccurrencesChooser.ReplaceChoice.ALL, Arrays.<Object>asList(occurrences));
}
return map;
}
示例8: parseSelectors
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private Map<String, String> parseSelectors() {
final Map<String, String> result = ContainerUtil.newLinkedHashMap();
List<Couple<String>> attrList = parseSelector();
while (attrList != null) {
for (Couple<String> attr : attrList) {
if (getClassAttributeName().equals(attr.first)) {
result.put(getClassAttributeName(), (StringUtil.notNullize(result.get(getClassAttributeName())) + " " + attr.second).trim());
}
else if (HtmlUtil.ID_ATTRIBUTE_NAME.equals(attr.first)) {
result.put(HtmlUtil.ID_ATTRIBUTE_NAME, (StringUtil.notNullize(result.get(HtmlUtil.ID_ATTRIBUTE_NAME)) + " " + attr.second).trim());
}
else {
result.put(attr.first, attr.second);
}
}
attrList = parseSelector();
}
return result;
}
示例9: fillChoice
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static Map<OccurrencesChooser.ReplaceChoice, List<Object>> fillChoice(GrIntroduceContext context) {
HashMap<OccurrencesChooser.ReplaceChoice, List<Object>> map = ContainerUtil.newLinkedHashMap();
if (context.getExpression() != null) {
map.put(OccurrencesChooser.ReplaceChoice.NO, Collections.<Object>singletonList(context.getExpression()));
}
else if (context.getStringPart() != null) {
map.put(OccurrencesChooser.ReplaceChoice.NO, Collections.<Object>singletonList(context.getStringPart()));
return map;
}
else if (context.getVar() != null) {
map.put(OccurrencesChooser.ReplaceChoice.ALL, Collections.<Object>singletonList(context.getVar()));
return map;
}
PsiElement[] occurrences = context.getOccurrences();
if (occurrences.length > 1) {
map.put(OccurrencesChooser.ReplaceChoice.ALL, Arrays.<Object>asList(occurrences));
}
return map;
}
示例10: buildSubstitutor
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public PsiSubstitutor buildSubstitutor() {
if (myParameters.length == 0) return PsiSubstitutor.EMPTY;
Map<PsiTypeParameter, PsiType> map = ContainerUtil.newLinkedHashMap();
putMappingAndReturnOffset(map, myExprType);
for (PsiClassType type : myTraitTypes) {
putMappingAndReturnOffset(map, type);
}
return JavaPsiFacade.getElementFactory(myOriginal.getProject()).createSubstitutor(map);
}
示例11: createAdditionalPanels
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public Map<PushSupport, VcsPushOptionsPanel> createAdditionalPanels() {
Map<PushSupport, VcsPushOptionsPanel> result = ContainerUtil.newLinkedHashMap();
for (PushSupport support : myPushSupports) {
ContainerUtil.putIfNotNull(support, support.createOptionsPanel(), result);
}
return result;
}
示例12: showChooser
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void showChooser(final T selectedOccurrence, final List<T> allOccurrences, final Pass<ReplaceChoice> callback) {
if (allOccurrences.size() == 1) {
callback.pass(ReplaceChoice.ALL);
}
else {
Map<ReplaceChoice, List<T>> occurrencesMap = ContainerUtil.newLinkedHashMap();
occurrencesMap.put(ReplaceChoice.NO, Collections.singletonList(selectedOccurrence));
occurrencesMap.put(ReplaceChoice.ALL, allOccurrences);
showChooser(callback, occurrencesMap);
}
}
示例13: method
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void method(Map<Object, Object> args) {
if (args == null) return;
args = ContainerUtil.newLinkedHashMap(args);
parseMethod(args);
args.put("declarationType", DeclarationType.METHOD);
myDeclarations = myDeclarations.prepend(args);
}
示例14: closureInMethod
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@SuppressWarnings("UnusedDeclaration")
public void closureInMethod(Map<Object, Object> args) {
if (args == null) return;
args = ContainerUtil.newLinkedHashMap(args);
parseMethod(args);
final Object method = args.get("method");
if (method instanceof Map) {
parseMethod((Map)method);
}
args.put("declarationType", DeclarationType.CLOSURE);
myDeclarations = myDeclarations.prepend(args);
}
示例15: variable
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void variable(Map<Object, Object> args) {
if (args == null) return;
args = ContainerUtil.newLinkedHashMap(args);
parseVariable(args);
myDeclarations = myDeclarations.prepend(args);
}