Search in sources :

Example 1 with DvcsRememberedInputs

use of com.intellij.dvcs.DvcsRememberedInputs in project intellij-community by JetBrains.

the class CloneDvcsDialog method rememberSettings.

public void rememberSettings() {
    final DvcsRememberedInputs rememberedInputs = getRememberedInputs();
    rememberedInputs.addUrl(getSourceRepositoryURL());
    rememberedInputs.setCloneParentDir(getParentDirectory());
}
Also used : DvcsRememberedInputs(com.intellij.dvcs.DvcsRememberedInputs)

Example 2 with DvcsRememberedInputs

use of com.intellij.dvcs.DvcsRememberedInputs 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)

Aggregations

DvcsRememberedInputs (com.intellij.dvcs.DvcsRememberedInputs)2 EditorComboBox (com.intellij.ui.EditorComboBox)1 ArrayList (java.util.ArrayList)1