Example usage for org.eclipse.jface.viewers IBasicPropertyConstants P_CHILDREN

List of usage examples for org.eclipse.jface.viewers IBasicPropertyConstants P_CHILDREN

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers IBasicPropertyConstants P_CHILDREN.

Prototype

String P_CHILDREN

To view the source code for org.eclipse.jface.viewers IBasicPropertyConstants P_CHILDREN.

Click Source Link

Document

Property name constant (value "org.eclipse.jface.children") for an element's children.

Usage

From source file:nexcore.tool.uml.ui.core.util.ProjectUtil.java

License:Open Source License

/**
 * updateParentInExplorer//from w w w . j a  va 2  s .  c om
 *  
 * @param target void
 */
public static void updateParentInExplorer(EObject target) {
    if (null == target) {
        return;
    }
    CommonViewer commonViewer = ViewerRegistry.getViewer();
    if (commonViewer.getControl().isDisposed()) {
        return;
    }
    if (target instanceof DynamicEObjectImpl) {
        target = UMLUtil.getBaseElement(target);
    }
    ITreeNode targetNode = null;
    EObject parent = UMLManager.getParent((Element) target);
    targetNode = UMLTreeNodeRegistry.getTreeNode(parent);
    String[] flags = null;
    flags = new String[] { IBasicPropertyConstants.P_IMAGE, IBasicPropertyConstants.P_TEXT,
            IBasicPropertyConstants.P_CHILDREN };
    commonViewer.update(targetNode, flags);
}

From source file:nexcore.tool.uml.ui.core.util.ProjectUtil.java

License:Open Source License

/**
 * updateExplorer/*from ww w .java 2 s  . co  m*/
 *  
 * @param target
 * @param childIncluded void
 */
public static void updateExplorer(EObject target, boolean childIncluded) {
    if (null == target) {
        return;
    }
    if (target instanceof EAnnotation) {
        return;
    }
    CommonViewer commonViewer = ViewerRegistry.getViewer();
    if (commonViewer.getControl().isDisposed()) {
        return;
    }
    if (target instanceof DynamicEObjectImpl) {
        target = UMLUtil.getBaseElement(target);
    }
    ITreeNode targetNode = null;
    targetNode = UMLTreeNodeRegistry.getTreeNode(target);
    if (null == targetNode) {
        return;
    }
    String[] flags = null;
    if (childIncluded) {
        flags = new String[] { IBasicPropertyConstants.P_IMAGE, IBasicPropertyConstants.P_TEXT,
                IBasicPropertyConstants.P_CHILDREN };
    } else {
        flags = new String[] { IBasicPropertyConstants.P_IMAGE, IBasicPropertyConstants.P_TEXT };
    }
    try {
        commonViewer.update(targetNode, flags);
        commonViewer.refresh(targetNode);
    } catch (Exception ex) {
        Log.error(ex);
    }
}