Search in sources :

Example 1 with EditorComboBox

use of com.intellij.ui.EditorComboBox in project intellij-community by JetBrains.

the class CloneDvcsDialog method createUIComponents.

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();
        }
    });
}
Also used : DvcsRememberedInputs(com.intellij.dvcs.DvcsRememberedInputs) ArrayList(java.util.ArrayList) EditorComboBox(com.intellij.ui.EditorComboBox)

Example 2 with EditorComboBox

use of com.intellij.ui.EditorComboBox in project intellij-community by JetBrains.

the class HgPullDialog method createUIComponents.

public void createUIComponents() {
    myRepositoryURL = new EditorComboBox("");
    myRepositoryURL.addDocumentListener(new DocumentAdapter() {

        @Override
        public void documentChanged(DocumentEvent e) {
            onChangePullSource();
        }
    });
}
Also used : DocumentAdapter(com.intellij.openapi.editor.event.DocumentAdapter) EditorComboBox(com.intellij.ui.EditorComboBox) DocumentEvent(com.intellij.openapi.editor.event.DocumentEvent)

Example 3 with EditorComboBox

use of com.intellij.ui.EditorComboBox in project android by JetBrains.

the class PackageComboProvider method createComponent.

@NotNull
@Override
protected EditorComboBox createComponent(@NotNull Parameter parameter) {
    Document doc = JavaReferenceEditorUtil.createDocument(myInitialPackage, myProject, false, JavaCodeFragment.VisibilityChecker.PROJECT_SCOPE_VISIBLE);
    assert doc != null;
    final EditorComboBox classComboBox = new EditorComboBox(doc, myProject, StdFileTypes.JAVA);
    // Make sure our suggested package is in the recents list and at the top
    RecentsManager.getInstance(myProject).registerRecentEntry(myRecentsKey, myInitialPackage);
    List<String> recents = RecentsManager.getInstance(myProject).getRecentEntries(myRecentsKey);
    // We just added at least one entry!
    assert recents != null;
    classComboBox.setHistory(Iterables.toArray(recents, String.class));
    return classComboBox;
}
Also used : EditorComboBox(com.intellij.ui.EditorComboBox) Document(com.intellij.openapi.editor.Document) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

EditorComboBox (com.intellij.ui.EditorComboBox)3 DvcsRememberedInputs (com.intellij.dvcs.DvcsRememberedInputs)1 Document (com.intellij.openapi.editor.Document)1 DocumentAdapter (com.intellij.openapi.editor.event.DocumentAdapter)1 DocumentEvent (com.intellij.openapi.editor.event.DocumentEvent)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1