Search in sources :

Example 1 with AzureViewDockerDialog

use of com.microsoft.intellij.docker.dialogs.AzureViewDockerDialog in project azure-tools-for-java by Microsoft.

the class ViewDockerHostAction method actionPerformed.

@Override
public void actionPerformed(NodeActionEvent e) {
    dockerHost = dockerManager.getDockerHostForURL(dockerHost.apiUrl);
    AzureViewDockerDialog viewDockerDialog = new AzureViewDockerDialog(project, dockerHost, dockerManager);
    viewDockerDialog.show();
    if (viewDockerDialog.getInternalExitCode() == AzureViewDockerDialog.UPDATE_EXIT_CODE) {
        AzureDockerUIResources.updateDockerHost(project, new EditableDockerHost(dockerHost), dockerManager, true);
    }
}
Also used : AzureViewDockerDialog(com.microsoft.intellij.docker.dialogs.AzureViewDockerDialog) EditableDockerHost(com.microsoft.azure.docker.model.EditableDockerHost)

Example 2 with AzureViewDockerDialog

use of com.microsoft.intellij.docker.dialogs.AzureViewDockerDialog in project azure-tools-for-java by Microsoft.

the class AzureSelectDockerHostStep method onViewDockerHostAction.

private void onViewDockerHostAction() {
    try {
        DefaultTableModel tableModel = (DefaultTableModel) dockerHostsTable.getModel();
        String apiURL = (String) tableModel.getValueAt(dockerHostsTable.getSelectedRow(), 4);
        DockerHost dockerHost = dockerManager.getDockerHostForURL(apiURL);
        if (dockerHost == null) {
            throw new RuntimeException(String.format("Unexpected error: can't locate the Docker host for %s!", apiURL));
        }
        // TODO: Check if dockerHost.certVault and dockerHost.hostVM have valid values and if not warn
        AzureViewDockerDialog viewDockerDialog = new AzureViewDockerDialog(model.getProject(), dockerHost, dockerManager);
        viewDockerDialog.show();
        if (viewDockerDialog.getInternalExitCode() == AzureViewDockerDialog.UPDATE_EXIT_CODE) {
            onEditDockerHostAction();
        }
    } catch (Exception e) {
        String msg = "An error occurred while attempting to view the selected Docker host.\n" + e.getMessage();
        PluginUtil.displayErrorDialogAndLog("Error", msg, e);
        if (AzureDockerUtils.DEBUG)
            e.printStackTrace();
        LOGGER.error("onViewDockerHostAction", e);
        PluginUtil.displayErrorDialog("View Docker Hosts Error", msg);
    }
}
Also used : AzureViewDockerDialog(com.microsoft.intellij.docker.dialogs.AzureViewDockerDialog) DefaultTableModel(javax.swing.table.DefaultTableModel) DockerHost(com.microsoft.azure.docker.model.DockerHost) EditableDockerHost(com.microsoft.azure.docker.model.EditableDockerHost)

Aggregations

EditableDockerHost (com.microsoft.azure.docker.model.EditableDockerHost)2 AzureViewDockerDialog (com.microsoft.intellij.docker.dialogs.AzureViewDockerDialog)2 DockerHost (com.microsoft.azure.docker.model.DockerHost)1 DefaultTableModel (javax.swing.table.DefaultTableModel)1