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

项目:intellij-ce-playground    文件:CloneDvcsDialog.java   
private void createUIComponents() {
  myRepositoryURL = new EditorComboBox("");
  final DvcsRememberedInputs rememberedInputs = getRememberedInputs();
  List<String> urls = new ArrayList<String>(rememberedInputs.getVisitedUrls());
  if (myDefaultRepoUrl != null) {
    urls.add(0, myDefaultRepoUrl);
  }
  myRepositoryURL.setHistory(ArrayUtil.toObjectArray(urls, String.class));
  myRepositoryURL.addDocumentListener(new com.intellij.openapi.editor.event.DocumentAdapter() {
    @Override
    public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) {
      // enable test button only if something is entered in repository URL
      final String url = getCurrentUrlText();
      myTestButton.setEnabled(url.length() != 0);
      if (myDefaultDirectoryName.equals(myDirectoryName.getText()) || myDirectoryName.getText().length() == 0) {
        // modify field if it was unmodified or blank
        myDefaultDirectoryName = defaultDirectoryName(url, myVcsDirectoryName);
        myDirectoryName.setText(myDefaultDirectoryName);
      }
      updateButtons();
    }
  });
}
项目:tools-idea    文件:GitCloneDialog.java   
private void createUIComponents() {
  myRepositoryURL = new EditorComboBox("");
  final GitRememberedInputs rememberedInputs = GitRememberedInputs.getInstance();
  myRepositoryURL.setHistory(ArrayUtil.toObjectArray(rememberedInputs.getVisitedUrls(), String.class));
  myRepositoryURL.addDocumentListener(new com.intellij.openapi.editor.event.DocumentAdapter() {
    @Override
    public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) {
      // enable test button only if something is entered in repository URL
      final String url = getCurrentUrlText();
      myTestButton.setEnabled(url.length() != 0);
      if (myDefaultDirectoryName.equals(myDirectoryName.getText()) || myDirectoryName.getText().length() == 0) {
        // modify field if it was unmodified or blank
        myDefaultDirectoryName = defaultDirectoryName(url);
        myDirectoryName.setText(myDefaultDirectoryName);
      }
      updateButtons();
    }
  });
}
项目:consulo    文件:CloneDvcsDialog.java   
private void createUIComponents() {
  myRepositoryURL = new EditorComboBox("");
  final DvcsRememberedInputs rememberedInputs = getRememberedInputs();
  List<String> urls = new ArrayList<>(rememberedInputs.getVisitedUrls());
  if (myDefaultRepoUrl != null) {
    urls.add(0, myDefaultRepoUrl);
  }
  myRepositoryURL.setHistory(ArrayUtil.toObjectArray(urls, String.class));
  myRepositoryURL.addDocumentListener(new com.intellij.openapi.editor.event.DocumentAdapter() {
    @Override
    public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) {
      // enable test button only if something is entered in repository URL
      final String url = getCurrentUrlText();
      myTestButton.setEnabled(url.length() != 0);
      if (myDefaultDirectoryName.equals(myDirectoryName.getText()) || myDirectoryName.getText().length() == 0) {
        // modify field if it was unmodified or blank
        myDefaultDirectoryName = defaultDirectoryName(url, myVcsDirectoryName);
        myDirectoryName.setText(myDefaultDirectoryName);
      }
      updateButtons();
    }
  });
}
项目:intellij-ce-playground    文件:JavaExtractSuperBaseDialog.java   
protected ComponentWithBrowseButton<EditorComboBox> createPackageNameField() {
  String name = "";
  PsiFile file = mySourceClass.getContainingFile();
  if (file instanceof PsiJavaFile) {
    name = ((PsiJavaFile)file).getPackageName();
  }
  return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY,
                                                           RefactoringBundle.message("choose.destination.package"));
}
项目:intellij-ce-playground    文件:HgPullDialog.java   
public void createUIComponents() {
  myRepositoryURL = new EditorComboBox("");
  myRepositoryURL.addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      onChangePullSource();
    }
  });
}
项目:tools-idea    文件:JavaExtractSuperBaseDialog.java   
protected ComponentWithBrowseButton<EditorComboBox> createPackageNameField() {
  String name = "";
  PsiFile file = mySourceClass.getContainingFile();
  if (file instanceof PsiJavaFile) {
    name = ((PsiJavaFile)file).getPackageName();
  }
  return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY,
                                                           RefactoringBundle.message("choose.destination.package"));
}
项目:tools-idea    文件:HgPullDialog.java   
public void createUIComponents() {
  myRepositoryURL = new EditorComboBox("");
  final HgRememberedInputs rememberedInputs = HgRememberedInputs.getInstance(project);
  myRepositoryURL.setHistory(ArrayUtil.toObjectArray(rememberedInputs.getRepositoryUrls(), String.class));
  myRepositoryURL.addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      onChangePullSource();
    }
  });
}
项目:tools-idea    文件:HgPushDialog.java   
public void createUIComponents() {
  myRepositoryURL = new EditorComboBox("");
  final HgRememberedInputs rememberedInputs = HgRememberedInputs.getInstance(myProject);
  myRepositoryURL.setHistory(ArrayUtil.toObjectArray(rememberedInputs.getRepositoryUrls(), String.class));
  myRepositoryURL.addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) {
      myCurrentRepositoryUrl = myRepositoryURL.getText();
      setOKActionEnabled(!StringUtil.isEmptyOrSpaces(myRepositoryURL.getText()));
    }
  });
}
项目:intellij-haxe    文件:JavaExtractSuperBaseDialog.java   
protected ComponentWithBrowseButton<EditorComboBox> createPackageNameField() {
  String name = "";
  PsiFile file = mySourceClass.getContainingFile();
  if (file instanceof PsiJavaFile) {
    name = ((PsiJavaFile)file).getPackageName();
  }
  return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY,
                                                           RefactoringBundle.message("choose.destination.package"));
}
项目:consulo-java    文件:JavaExtractSuperBaseDialog.java   
protected ComponentWithBrowseButton<EditorComboBox> createPackageNameField() {
  String name = "";
  PsiFile file = mySourceClass.getContainingFile();
  if (file instanceof PsiJavaFile) {
    name = ((PsiJavaFile)file).getPackageName();
  }
  return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY,
                                                           RefactoringBundle.message("choose.destination.package"));
}