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


Java PlatformObject类代码示例

本文整理汇总了Java中org.eclipse.core.runtime.PlatformObject的典型用法代码示例。如果您正苦于以下问题:Java PlatformObject类的具体用法?Java PlatformObject怎么用?Java PlatformObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: buildHierarchyRoots

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
private PlatformObject[] buildHierarchyRoots(
    GraphModel master, Collection<GraphNode> nodes) {
  List<PlatformObject> staging = Lists.newArrayList();

  List<GraphNode> remains = Lists.newArrayList(nodes);

  Collection<GraphNode> collapseNodes = getCollapseTreeModel().computeNodes();
  if (!collapseNodes.isEmpty()) {
    staging.add(buildCollapseRoot());
    remains.removeAll(collapseNodes);
  }

  for (GraphEdgeMatcherDescriptor matcher : getTreeDescriptors()) {
    staging.add(buildTreeRoot(master, remains, matcher));
  }

  staging.add(buildRemainsRoot(remains));
  PlatformObject[] result = new PlatformObject[staging.size()];
  return staging.toArray(result);
}
 
开发者ID:google,项目名称:depan,代码行数:21,代码来源:NodeCompactor.java

示例2: buildTreeRoot

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
/**
 * The argument for {@code remains} is updated on each call.
 */
private PlatformObject buildTreeRoot(
    GraphModel master,
    Collection<GraphNode> remains,
    GraphEdgeMatcherDescriptor matcher) {

  // Build the hierarchy for this set of nodes and matcher
  GraphModel treeGraph = GraphBuilders.buildFromNodes(master, remains);
  GraphData<GraphNode> data = GraphData.createGraphData(
      NodeTreeProviders.GRAPH_NODE_PROVIDER,
      treeGraph, matcher.getInfo());

  // Update remains with info from hierarchy tree
  TreeModel tree = data.getTreeModel();
  remains.removeAll(tree.computeTreeNodes());

  // provide the root viewing object
  String label = MessageFormat.format("Tree of {0}", matcher.getName());
  return new ActionTreeRoot(data, label, matcher);
}
 
开发者ID:google,项目名称:depan,代码行数:23,代码来源:NodeCompactor.java

示例3: debugContextChanged

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
public void debugContextChanged(DebugContextEvent event) {
	if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
		PlatformObject object = (PlatformObject) ((IStructuredSelection) event.getContext()).getFirstElement();
		if (object == null)
			return;
		IDebugTarget newTarget = (IDebugTarget) object.getAdapter(IDebugTarget.class);
		if (newTarget != debugTarget && newTarget != null && !newTarget.isTerminated()) {
			debugTarget = newTarget;
		}
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:12,代码来源:HighlightingSubmachineDecorationProvider.java

示例4: buildViewerRoots

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public PlatformObject buildViewerRoots() {
  List<PlatformObject> result = Lists.newArrayList();

  TreeModel.Flat model = new TreeModel.Flat(nodes);
  solo = new GraphData(provider, model);
  result.add(new SolitaryRoot(solo, listLabel));
  return new ViewerRoot(result.toArray());
}
 
开发者ID:google,项目名称:depan,代码行数:11,代码来源:NodeListViewProvider.java

示例5: buildCollapseRoot

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
private PlatformObject buildCollapseRoot() {

    CollapseTreeModel treeModel = getCollapseTreeModel();
    int rootCnt = treeModel.computeRoots().size();
    int nodeCnt = treeModel.computeNodes().size();

    String label = MessageFormat.format(
        "Collapse nodes [{0} roots, {1} nodes]", rootCnt, nodeCnt);
    return CollapseTreeRoot.build(
        label, treeModel, NodeTreeProviders.GRAPH_NODE_PROVIDER);
  }
 
开发者ID:google,项目名称:depan,代码行数:12,代码来源:NodeCompactor.java

示例6: buildRemainsRoot

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
private PlatformObject buildRemainsRoot(Collection<GraphNode> nodes) {
  TreeModel.Flat model = new TreeModel.Flat(nodes);
  GraphData<GraphNode> data = new GraphData<GraphNode>(
      NodeTreeProviders.GRAPH_NODE_PROVIDER, model);
  String label = MessageFormat.format("Solitaires [{0} nodes]", nodes.size());
  return new ActionRemainsRoot(data, label);
}
 
开发者ID:google,项目名称:depan,代码行数:8,代码来源:NodeCompactor.java

示例7: buildViewerRoot

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
/**
 * Provides the results for the 
 * {@link ViewEditorNodeViewerProvider#buildViewerRoots()}
 * this is returned by {@link #getNodeViewProvider()}.
 */
public ViewerRoot buildViewerRoot() {
  Collection<GraphNode> nodes = viewInfo.getViewNodes();
  PlatformObject[] roots = compactor.buildRoots(nodes);

  String label = buildNodeViewerLabel(roots.length, nodes.size());

  TreeViewerObject view = new TreeViewerObject(label, roots);
  return new ViewerRoot(new Object[] {view});
}
 
开发者ID:google,项目名称:depan,代码行数:15,代码来源:ViewEditor.java

示例8: decorate

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
/**Called automagically by Eclipse.
 * I use this fct to filter the resources we decide to decorate or not.
 * see effectiveDecorate method, which effectively affect the IDecoration */
@Override
public void decorate(Object element, IDecoration decoration) {
	/* we only decorate IResources (IFile / IFolder mainly) but some awkward
	 * classes are not in the IResource object tree, but are convertible
	 * into IResources...
	 * This happens for CContainers which are like folder in the CDT model.
	 * This block tries to decorate these resources. The catch block occurs
	 * when the element is neither in the IResource tree, nor convertible.
	 */
	if(!(element instanceof IResource)){
		if (!(element instanceof PlatformObject)) return;

		// try the conversion thing for PlateformObject things
		try {
			IResource ir = (IResource) ((PlatformObject) element).getAdapter(IResource.class);
			if (ir != null && ir.isDerived())
				effectiveDecorateDerived(ir, decoration);
		} catch (Exception e) {
			info("element " + element.toString() + " not usable. "
					+ "Type is " + element.getClass().getCanonicalName());
		}
		return;
	}

	// easy case. Item is an IResource child.
	IResource objectResource = (IResource) element;

	if(FilterManager.isActiveConfFile(objectResource))
		effectiveDecorateConfFile(objectResource, decoration);

	if(objectResource.isDerived())
		effectiveDecorateDerived(objectResource, decoration);
}
 
开发者ID:nodj,项目名称:AutoDeriv,代码行数:37,代码来源:Decorator.java

示例9: getParent

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
private PlatformObject getParent(TreeViewerObject root) {
  return root.getParent();
}
 
开发者ID:google,项目名称:depan,代码行数:4,代码来源:TreeViewerObjectAdapter.java

示例10: TreeViewerObject

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
public TreeViewerObject(String name, PlatformObject[] children) {
  this(name, null, children);
}
 
开发者ID:google,项目名称:depan,代码行数:4,代码来源:TreeViewerObject.java

示例11: getParent

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
public PlatformObject getParent() {
  return parent;
}
 
开发者ID:google,项目名称:depan,代码行数:4,代码来源:TreeViewerObject.java

示例12: getChildren

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
public PlatformObject[] getChildren() {
  return children;
}
 
开发者ID:google,项目名称:depan,代码行数:4,代码来源:TreeViewerObject.java

示例13: refresh

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
public void refresh() {
  PlatformObject treeRoots = provider.buildViewerRoots();
  treeViewer.setInput(treeRoots);
  provider.updateExpandState(treeViewer);
  treeViewer.refresh();
}
 
开发者ID:google,项目名称:depan,代码行数:7,代码来源:GraphNodeViewer.java

示例14: ActionViewerObject

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
public ActionViewerObject(String name, PlatformObject[] children) {
  super(name, children);
}
 
开发者ID:google,项目名称:depan,代码行数:4,代码来源:ActionableViewerObject.java

示例15: buildRoots

import org.eclipse.core.runtime.PlatformObject; //导入依赖的package包/类
public PlatformObject[] buildRoots(Collection<GraphNode> nodes) {
  roots = buildHierarchyRoots(editor.getViewGraph(), nodes);
  return roots;
}
 
开发者ID:google,项目名称:depan,代码行数:5,代码来源:NodeCompactor.java


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