Java Code Examples for com.intellij.openapi.util.Key.create()

The following are Jave code examples for showing how to use create() of the com.intellij.openapi.util.Key class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: intellij-ce-playground   File: BreakpointCategory.java   View Source Code Vote up 5 votes
@NotNull
public static <T extends Breakpoint> Key<T> lookup(String name) {
  Key<T> key = ourMap.get(name);
  if (key == null) {
    key = Key.create(name);
    ourMap.put(name, key);
  }
  return key;
}
 
Example 2
Project: intellij-ce-playground   File: StandardPatternsTest.java   View Source Code Vote up 5 votes
public void testSave() {
  Key<String> key = Key.create("abc");
  final ProcessingContext context = new ProcessingContext();
  assertFalse(string().contains("abc").save(key).accepts(null));
  assertNull(context.get(key));

  assertFalse(string().contains("abc").save(key).accepts("def"));
  assertNull(context.get(key));

  final String s = "defabcdef";
  assertTrue(string().contains("abc").save(key).accepts(s, context));
  assertSame(s, context.get(key));
}
 
Example 3
Project: intellij-ce-playground   File: LanguageExtension.java   View Source Code Vote up 4 votes
public LanguageExtension(@NonNls final String epName, @Nullable final T defaultImplementation) {
  super(epName);
  myDefaultImplementation = defaultImplementation;
  IN_LANGUAGE_CACHE = Key.create("EXTENSIONS_IN_LANGUAGE_"+epName);
}
 
Example 4
Project: intellij-ce-playground   File: UnknownBeforeRunTaskProvider.java   View Source Code Vote up 4 votes
public UnknownBeforeRunTaskProvider(String mirrorProviderName) {
  myId = Key.create(mirrorProviderName);
}
 
Example 5
Project: intellij-ce-playground   File: FileIncludeManagerImpl.java   View Source Code Vote up 4 votes
private IncludeCacheHolder(String compileTimeKey, String runtimeKey) {
  COMPILE_TIME_KEY = Key.create(compileTimeKey);
  RUNTIME_KEY = Key.create(runtimeKey);
}