Example usage for org.springframework.ide.eclipse.boot.dash.model BootDashViewModel getSectionByTargetId

List of usage examples for org.springframework.ide.eclipse.boot.dash.model BootDashViewModel getSectionByTargetId

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.model BootDashViewModel getSectionByTargetId.

Prototype

public BootDashModel getSectionByTargetId(String targetId) 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.cloudfoundry.DevtoolsUtil.java

/**
 * Retreive corresponding CDE for a given launch.
 *//*w w  w.jav  a 2s .c  om*/
public static CloudDashElement getElement(ILaunchConfiguration l, BootDashViewModel model) {
    String targetId = getAttribute(l, TARGET_ID);
    String appName = getAttribute(l, APP_NAME);
    if (targetId != null && appName != null) {
        BootDashModel section = model.getSectionByTargetId(targetId);
        if (section instanceof CloudFoundryBootDashModel) {
            CloudFoundryBootDashModel cfModel = (CloudFoundryBootDashModel) section;
            return cfModel.getElement(appName);
        }
    }
    return null;
}