当前位置: 首页>>代码示例>>Java>>正文


Java GraphicalViewer.setSelection方法代码示例

本文整理汇总了Java中org.eclipse.gef.GraphicalViewer.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicalViewer.setSelection方法的具体用法?Java GraphicalViewer.setSelection怎么用?Java GraphicalViewer.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.gef.GraphicalViewer的用法示例。


在下文中一共展示了GraphicalViewer.setSelection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void run() {
    final GraphicalViewer viewer = part.getAdapter(GraphicalViewer.class);

    if (viewer != null) {
        final List<NodeElementEditPart> children = new ArrayList<NodeElementEditPart>();

        for (final Object child : viewer.getContents().getChildren()) {
            if (child instanceof NodeElementEditPart) {
                final NodeElementEditPart editPart = (NodeElementEditPart) child;
                if (editPart.getFigure().isVisible()) {
                    children.add(editPart);
                }
            }
        }

        viewer.setSelection(new StructuredSelection(children));
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:23,代码来源:SelectAllContentsAction.java

示例2: run

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void run() {
	GraphicalViewer viewer = (GraphicalViewer) part
			.getAdapter(GraphicalViewer.class);

	if (viewer != null) {
		List<NodeElementEditPart> children = new ArrayList<NodeElementEditPart>();

		for (Object child : viewer.getContents().getChildren()) {
			if (child instanceof NodeElementEditPart) {
				NodeElementEditPart editPart = (NodeElementEditPart) child;
				if (editPart.getFigure().isVisible()) {
					children.add(editPart);
				}
			}
		}

		viewer.setSelection(new StructuredSelection(children));
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:24,代码来源:SelectAllContentsAction.java

示例3: run

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
 * @see org.eclipse.jface.action.Action#run()
 */
public void run() {
    GraphicalViewer viewer = (GraphicalViewer)part.getAdapter(GraphicalViewer.class);

    List<Object> viewerChildren = viewer.getContents().getChildren();
    List<Object> newChildren = new ArrayList<Object>();
    
    for( Object obj : viewerChildren ) {
        if( obj instanceof LabelNodeEditPart ) {
            continue;
        }
        newChildren.add(obj);
    }
    
    if (viewer != null) {
        viewer.setSelection(new StructuredSelection(newChildren));
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:SelectAllNodeAction.java

示例4: run

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
public void run() {
    final GraphicalViewer viewer = (GraphicalViewer) part.getAdapter(GraphicalViewer.class);
    if (viewer != null) {
        final List<DiagramWalkerEditPart> children = new ArrayList<>();

        for (final Object child : viewer.getContents().getChildren()) {
            if (child instanceof DiagramWalkerEditPart) {
                final DiagramWalkerEditPart editPart = (DiagramWalkerEditPart) child;
                if (editPart.getFigure().isVisible()) {
                    children.add(editPart);
                }
            }
        }

        viewer.setSelection(new StructuredSelection(children));
    }
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:19,代码来源:SelectAllContentsAction.java

示例5: run

import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
public void run() {
	PasteCommand command = createCommand(getSelectedObjects());
	execute(command);

	// Select the pasted edit part
	GraphicalViewer viewer = (GraphicalViewer) getWorkbenchPart().getAdapter(GraphicalViewer.class);
	if (viewer != null) {
		viewer.setSelection(new StructuredSelection(getSelectableEditParts(viewer, command.getPasteParent(),
				command.getCreatedNodesNumber())));
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:PasteAction.java


注:本文中的org.eclipse.gef.GraphicalViewer.setSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。