Example usage for org.springframework.ide.eclipse.beans.ui.livegraph.views LiveBeansGraphView VIEW_ID

List of usage examples for org.springframework.ide.eclipse.beans.ui.livegraph.views LiveBeansGraphView VIEW_ID

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.beans.ui.livegraph.views LiveBeansGraphView VIEW_ID.

Prototype

String VIEW_ID

To view the source code for org.springframework.ide.eclipse.beans.ui.livegraph.views LiveBeansGraphView VIEW_ID.

Click Source Link

Usage

From source file:com.vmware.vfabric.ide.eclipse.tcserver.livegraph.LiveBeansGraphEditorSection.java

private void connectToApplication(String appName) {
    try {//from  w w  w  . j  a va  2s  .c o  m
        String username = null;
        String password = null;
        String serviceUrl = JmxUtils.getJmxUrl(behaviour);
        JmxCredentials credentials = JmxUtils.getJmxCredentials(behaviour);
        if (credentials != null) {
            username = credentials.getUsername();
            password = credentials.getPassword();
        }

        LiveBeansModel model = LiveBeansModelGenerator.connectToModel(serviceUrl, username, password, appName);
        IViewPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
                .showView(LiveBeansGraphView.VIEW_ID);
        if (part instanceof LiveBeansGraphView) {
            ((LiveBeansGraphView) part).setInput(model);
        }
    } catch (PartInitException e) {
        Status status = new Status(IStatus.INFO, TcServerLiveGraphPlugin.PLUGIN_ID,
                "An error occurred while opening the Live Beans Graph View.", e);
        openErrorDialogWithStatus(status);
    } catch (IOException e) {
        Status status = new Status(IStatus.INFO, TcServerLiveGraphPlugin.PLUGIN_ID, e.getMessage(), e);
        openErrorDialogWithStatus(status);
    } catch (CoreException e) {
        Status status = new Status(IStatus.INFO, TcServerLiveGraphPlugin.PLUGIN_ID, e.getMessage(), e);
        openErrorDialogWithStatus(status);
    }
}