Search in sources :

Example 1 with ResultNode

use of com.intellij.struts2.graph.beans.ResultNode in project intellij-plugins by JetBrains.

the class StrutsDataModel method updateDataModel.

private void updateDataModel() {
    final StrutsModel model = StrutsManager.getInstance(myProject).getModelByFile(myFile);
    if (model == null) {
        return;
    }
    for (final StrutsPackage strutsPackage : model.getStrutsPackages()) {
        for (final Action action : strutsPackage.getActions()) {
            final ActionNode actionNode = new ActionNode(action, action.getName().getStringValue());
            addNode(actionNode);
            for (final Result result : action.getResults()) {
                final PathReference pathReference = result.getValue();
                final String path = pathReference != null ? pathReference.getPath() : UNKNOWN;
                final ResultNode resultNode = new ResultNode(result, path);
                addNode(resultNode);
                final String resultName = result.getName().getStringValue();
                addEdge(new BasicStrutsEdge(actionNode, resultNode, resultName != null ? resultName : Result.DEFAULT_NAME));
            }
        }
    }
}
Also used : PathReference(com.intellij.openapi.paths.PathReference) Action(com.intellij.struts2.dom.struts.action.Action) BasicStrutsEdge(com.intellij.struts2.graph.beans.BasicStrutsEdge) ResultNode(com.intellij.struts2.graph.beans.ResultNode) StrutsModel(com.intellij.struts2.dom.struts.model.StrutsModel) ActionNode(com.intellij.struts2.graph.beans.ActionNode) StrutsPackage(com.intellij.struts2.dom.struts.strutspackage.StrutsPackage) Result(com.intellij.struts2.dom.struts.action.Result)

Aggregations

PathReference (com.intellij.openapi.paths.PathReference)1 Action (com.intellij.struts2.dom.struts.action.Action)1 Result (com.intellij.struts2.dom.struts.action.Result)1 StrutsModel (com.intellij.struts2.dom.struts.model.StrutsModel)1 StrutsPackage (com.intellij.struts2.dom.struts.strutspackage.StrutsPackage)1 ActionNode (com.intellij.struts2.graph.beans.ActionNode)1 BasicStrutsEdge (com.intellij.struts2.graph.beans.BasicStrutsEdge)1 ResultNode (com.intellij.struts2.graph.beans.ResultNode)1