Java 类com.intellij.ui.TextFieldWithAutoCompletionContributor 实例源码

项目:tools-idea    文件:GenericRepositoryEditor.java   
private void createUIComponents() {
  //todo completion
  //todo completion without whitespace before cursor
  final ArrayList<String> completionList = ContainerUtil.newArrayList(SERVER_URL_PLACEHOLDER, USERNAME_PLACEHOLDER, PASSWORD_PLACEHOLDER);
  myLoginURLText = TextFieldWithAutoCompletion.create(myProject, completionList, null, false, myRepository.getLoginURL());

  final ArrayList<String> completionList1 = ContainerUtil.newArrayList(SERVER_URL_PLACEHOLDER, QUERY_PLACEHOLDER, MAX_COUNT_PLACEHOLDER);
  myTasksListURLText = TextFieldWithAutoCompletion.create(myProject, completionList1, null, false, myRepository.getTasksListURL());

  final Document document = EditorFactory.getInstance().createDocument(myRepository.getTaskPattern());
  myTaskPatternText = new EditorTextField(document, myProject, myRepository.getResponseType().getFileType(), false, false);
  final ArrayList<String> completionList2 = ContainerUtil.newArrayList("({id}.+?)", "({summary}.+?)");
  TextFieldWithAutoCompletionContributor
    .installCompletion(document, myProject, new TextFieldWithAutoCompletion.StringsCompletionProvider(completionList2, null), true);
  myTaskPatternText.setFontInheritedFromLAF(false);
}
项目:intellij-ce-playground    文件:TaskChangelistSupport.java   
public void installSearch(EditorTextField name, final EditorTextField comment) {
  Document document = name.getDocument();
  final TaskAutoCompletionListProvider completionProvider =
    new TaskAutoCompletionListProvider(myProject);

  TextFieldWithAutoCompletionContributor.installCompletion(document, myProject, completionProvider, false);
}
项目:intellij-ce-playground    文件:TaskCompletionTest.java   
private void configureFile(String text) {
  PsiFile psiFile = myFixture.configureByText("test.txt", text);
  Document document = myFixture.getDocument(psiFile);
  final Project project = getProject();
  TextFieldWithAutoCompletionContributor.installCompletion(document, project,
                                                           new TaskAutoCompletionListProvider(project),
                                                           false);
  document.putUserData(CommitMessage.DATA_CONTEXT_KEY, new MapDataContext());
}
项目:tools-idea    文件:TaskChangelistSupport.java   
public void installSearch(EditorTextField name, final EditorTextField comment) {
  Document document = name.getDocument();
  final TaskAutoCompletionListProvider completionProvider =
    new TaskAutoCompletionListProvider(myProject);

  TextFieldWithAutoCompletionContributor.installCompletion(document, myProject, completionProvider, false);
}
项目:tools-idea    文件:TaskCompletionTest.java   
private void configureFile(String text) {
  PsiFile psiFile = myFixture.configureByText("test.txt", text);
  Document document = myFixture.getDocument(psiFile);
  final Project project = getProject();
  TextFieldWithAutoCompletionContributor.installCompletion(document, project,
                                                           new TaskAutoCompletionListProvider(project),
                                                           false);
  document.putUserData(CommitMessage.DATA_CONTEXT_KEY, new MapDataContext());
}
项目:consulo-tasks    文件:TaskChangelistSupport.java   
public void installSearch(EditorTextField name, final EditorTextField comment) {
  Document document = name.getDocument();
  final TaskAutoCompletionListProvider completionProvider =
    new TaskAutoCompletionListProvider(myProject);

  TextFieldWithAutoCompletionContributor.installCompletion(document, myProject, completionProvider, false);
}
项目:consulo-tasks    文件:TaskCompletionTest.java   
private void configureFile(String text)
{
    PsiFile psiFile = myFixture.configureByText("test.txt", text);
    Document document = myFixture.getDocument(psiFile);
    final Project project = getProject();
    TextFieldWithAutoCompletionContributor.installCompletion(document, project, new TaskAutoCompletionListProvider(project), false);
    document.putUserData(CommitMessage.DATA_CONTEXT_KEY, new MapDataContext());
}