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) {
// }
}
Aggregations