Search in sources :

Example 1 with AzureModule

use of com.microsoft.tooling.msservices.serviceexplorer.azure.AzureModule in project azure-tools-for-java by Microsoft.

the class ServerExplorerToolWindowFactory method createToolWindowContent.

@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
    // initialize azure service module
    AzureModule azureModule = new AzureModuleImpl(project);
    HDInsightUtil.setHDInsightRootModule(azureModule);
    // initialize with all the service modules
    DefaultTreeModel treeModel = new DefaultTreeModel(initRoot(project, azureModule));
    treeModelMap.put(project, treeModel);
    // initialize tree
    final JTree tree = new Tree(treeModel);
    tree.setRootVisible(false);
    tree.setCellRenderer(new NodeTreeCellRenderer());
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    // add a click handler for the tree
    tree.addMouseListener(new MouseAdapter() {

        @Override
        public void mousePressed(MouseEvent e) {
            treeMousePressed(e, tree);
        }
    });
    // add the tree to the window
    toolWindow.getComponent().add(new JBScrollPane(tree));
    // setup toolbar icons
    addToolbarItems(toolWindow, azureModule);
//        try {
//            azureModule.registerSubscriptionsChanged();
//        } catch (AzureCmdException ignored) {
//        }
}
Also used : MouseEvent(java.awt.event.MouseEvent) AzureModuleImpl(com.microsoft.intellij.serviceexplorer.azure.AzureModuleImpl) AzureModule(com.microsoft.tooling.msservices.serviceexplorer.azure.AzureModule) MouseAdapter(java.awt.event.MouseAdapter) Tree(com.intellij.ui.treeStructure.Tree) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Aggregations

JBScrollPane (com.intellij.ui.components.JBScrollPane)1 Tree (com.intellij.ui.treeStructure.Tree)1 AzureModuleImpl (com.microsoft.intellij.serviceexplorer.azure.AzureModuleImpl)1 AzureModule (com.microsoft.tooling.msservices.serviceexplorer.azure.AzureModule)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1