Search in sources :

Example 1 with ProjectSelector

use of com.google.cloud.tools.intellij.project.ProjectSelector in project google-cloud-intellij by GoogleCloudPlatform.

the class AppEngineDeploymentConfigurationPanel method createUIComponents.

private void createUIComponents() {
    hiddenValidationTrigger = new JBCheckBox();
    hiddenValidationTrigger.setVisible(false);
    projectSelector = new ProjectSelector(ideProject);
}
Also used : JBCheckBox(com.intellij.ui.components.JBCheckBox) ProjectSelector(com.google.cloud.tools.intellij.project.ProjectSelector)

Example 2 with ProjectSelector

use of com.google.cloud.tools.intellij.project.ProjectSelector in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudDebugRunConfigurationPanel method createUIComponents.

private void createUIComponents() {
    hiddenValidationTrigger = new JBCheckBox();
    hiddenValidationTrigger.setVisible(false);
    projectSelector = new ProjectSelector(ideProject);
    projectSelector.addProjectSelectionListener((selectedProject) -> {
        // settings editor does not see all the changes by default, use explicit notification.
        triggerValidation();
    });
}
Also used : JBCheckBox(com.intellij.ui.components.JBCheckBox) ProjectSelector(com.google.cloud.tools.intellij.project.ProjectSelector)

Example 3 with ProjectSelector

use of com.google.cloud.tools.intellij.project.ProjectSelector in project google-cloud-intellij by GoogleCloudPlatform.

the class GoogleCloudApiSelectorPanelTest method getManagementUI_withLibraryAndProjectSelected_isEnabled.

@Test
public void getManagementUI_withLibraryAndProjectSelected_isEnabled() {
    CloudLibrary library = LIBRARY_1.toCloudLibrary();
    GoogleCloudApiSelectorPanel panel = new GoogleCloudApiSelectorPanel(ImmutableList.of(library), testFixture.getProject());
    JTable table = panel.getCloudLibrariesTable();
    checkAddLibraryCheckbox(table, 0);
    panel.getDetailsPanel().setCloudLibrary(library, BOM_VERSION, panel.getApiManagementMap().get(library));
    CloudProject cloudProject = CloudProject.create("name", "id", "user");
    ProjectSelector projectSelector = panel.getProjectSelector();
    projectSelector.setSelectedProject(cloudProject);
    projectSelector.getProjectSelectionListeners().forEach(listener -> listener.projectSelected(cloudProject));
    assertThat(panel.getDetailsPanel().getEnableApiCheckbox().isEnabled()).isTrue();
    assertThat(panel.getDetailsPanel().getManagementInfoPanel().isVisible()).isFalse();
}
Also used : CloudProject(com.google.cloud.tools.intellij.project.CloudProject) JTable(javax.swing.JTable) TestCloudLibrary(com.google.cloud.tools.intellij.testing.apis.TestCloudLibrary) CloudLibrary(com.google.cloud.tools.libraries.json.CloudLibrary) ProjectSelector(com.google.cloud.tools.intellij.project.ProjectSelector) Test(org.junit.Test)

Example 4 with ProjectSelector

use of com.google.cloud.tools.intellij.project.ProjectSelector in project google-cloud-intellij by GoogleCloudPlatform.

the class GoogleCloudApiSelectorPanel method createUIComponents.

/**
 * Initializes some UI components in this panel that require special set-up.
 *
 * <p>This is automatically called by the IDEA SDK and should not be directly invoked.
 */
private void createUIComponents() {
    modulesComboBox = new ModulesComboBox();
    modulesComboBox.fillModules(project);
    ApplicationManager.getApplication().runReadAction(() -> {
        Module[] modules = ModuleManager.getInstance(project).getSortedModules();
        if (modules.length > 0) {
            // Defaults to the first, top-level module in this project.
            modulesComboBox.setSelectedModule(modules[0]);
        }
    });
    cloudLibrariesTable = new CloudLibraryTable(libraries);
    cloudLibrariesTable.setTableHeader(null);
    cloudLibrariesTable.getSelectionModel().addListSelectionListener(this::onClientLibrarySelection);
    addTableModelListener(e -> updateManagementUI());
    projectSelector = new ProjectSelector(project);
    projectSelector.addProjectSelectionListener(cloudProject -> updateManagementUI());
}
Also used : ModulesComboBox(com.intellij.application.options.ModulesComboBox) Module(com.intellij.openapi.module.Module) ProjectSelector(com.google.cloud.tools.intellij.project.ProjectSelector)

Example 5 with ProjectSelector

use of com.google.cloud.tools.intellij.project.ProjectSelector in project google-cloud-intellij by GoogleCloudPlatform.

the class SetupCloudRepositoryDialog method createUIComponents.

private void createUIComponents() {
    projectSelector = new ProjectSelector(ideProject);
    projectSelector.setMinimumSize(new Dimension(400, 0));
    repositorySelector = new RepositorySelector(projectSelector.getSelectedProject(), true);
    remoteNameSelector = new RepositoryRemotePanel(gitRepository);
    projectSelector.addProjectSelectionListener(this::updateRepositorySelector);
    repositorySelector.getDocument().addDocumentListener(new DocumentAdapter() {

        @Override
        protected void textChanged(DocumentEvent event) {
            remoteNameSelector.update(repositorySelector.getSelectedRepository());
            updateButtons();
        }
    });
    remoteNameSelector.getRemoteNameField().getDocument().addDocumentListener(new DocumentAdapter() {

        @Override
        protected void textChanged(DocumentEvent event) {
            updateButtons();
        }
    });
}
Also used : DocumentAdapter(com.intellij.ui.DocumentAdapter) Dimension(java.awt.Dimension) DocumentEvent(javax.swing.event.DocumentEvent) ProjectSelector(com.google.cloud.tools.intellij.project.ProjectSelector)

Aggregations

ProjectSelector (com.google.cloud.tools.intellij.project.ProjectSelector)6 DocumentAdapter (com.intellij.ui.DocumentAdapter)2 JBCheckBox (com.intellij.ui.components.JBCheckBox)2 Dimension (java.awt.Dimension)2 DocumentEvent (javax.swing.event.DocumentEvent)2 CloudProject (com.google.cloud.tools.intellij.project.CloudProject)1 TestCloudLibrary (com.google.cloud.tools.intellij.testing.apis.TestCloudLibrary)1 CloudLibrary (com.google.cloud.tools.libraries.json.CloudLibrary)1 ModulesComboBox (com.intellij.application.options.ModulesComboBox)1 Module (com.intellij.openapi.module.Module)1 JTable (javax.swing.JTable)1 Test (org.junit.Test)1