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


Java TreeNode类代码示例

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


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

示例1: getText

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
@Override
public String getText(final Object element) {
    final TreeNode treeNode = (TreeNode) element;

    final Object value = treeNode.getValue();
    if (value instanceof DBObject) {
        final DBObject dbObject = (DBObject) value;
        return dbObject.getName();

    } else if (value instanceof StringObjectModel) {
        final StringObjectModel object = (StringObjectModel) value;
        return object.getName();

    } else if (value instanceof TestData) {
        final TestData testData = (TestData) value;
        return testData.getName();

    }

    return value.toString();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:22,代码来源:ViewLabelProvider.java

示例2: perfomeOK

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void perfomeOK() throws InputException {
    final Object[] selectedNodes = viewer.getCheckedElements();

    resultSelectedDbObjects = new ArrayList<DBObject>();

    for (int i = 0; i < selectedNodes.length; i++) {
        final Object value = ((TreeNode) selectedNodes[i]).getValue();

        if (value instanceof DBObject) {
            resultSelectedDbObjects.add((DBObject) value);
        }
    }

    resultMergeWord = mergeWordButton.getSelection();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:20,代码来源:AbstractSelectImportedObjectDialog.java

示例3: getText

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
@Override
public String getText(Object element) {
	TreeNode treeNode = (TreeNode) element;

	Object value = treeNode.getValue();
	if (value instanceof DBObject) {
		DBObject dbObject = (DBObject) value;
		return dbObject.getName();

	} else if (value instanceof StringObjectModel) {
		StringObjectModel object = (StringObjectModel) value;
		return object.getName();

	} else if (value instanceof TestData) {
		TestData testData = (TestData) value;
		return testData.getName();

	}

	return value.toString();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:22,代码来源:ViewLabelProvider.java

示例4: perfomeOK

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void perfomeOK() throws InputException {
	Object[] selectedNodes = this.viewer.getCheckedElements();

	this.resultSelectedDbObjects = new ArrayList<DBObject>();

	for (int i = 0; i < selectedNodes.length; i++) {
		Object value = ((TreeNode) selectedNodes[i]).getValue();

		if (value instanceof DBObject) {
			resultSelectedDbObjects.add((DBObject) value);
		}
	}

	this.resultMergeWord = this.mergeWordButton.getSelection();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:20,代码来源:AbstractSelectImportedObjectDialog.java

示例5: createTopNode

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
protected TreeNode createTopNode(String objectType,
		List<DBObject> dbObjectList) {
	TreeNode treeNode = new TreeNode(new StringObjectModel(
			ResourceString.getResourceString("label.object.type."
					+ objectType)));
	List<TreeNode> objectNodeList = new ArrayList<TreeNode>();

	for (DBObject dbObject : dbObjectList) {
		TreeNode objectNode = new TreeNode(dbObject);
		objectNode.setParent(treeNode);

		objectNodeList.add(objectNode);
	}

	treeNode.setChildren(objectNodeList.toArray(new TreeNode[objectNodeList
			.size()]));

	return treeNode;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:20,代码来源:AbstractSelectImportedObjectDialog.java

示例6: createTreeNodeList

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
protected List<TreeNode> createTreeNodeList() {

		List<TreeNode> treeNodeList = new ArrayList<TreeNode>();

		TreeNode topNode = new TreeNode(new StringObjectModel(
				ResourceString.getResourceString("label.schema")));
		treeNodeList.add(topNode);

		List<TreeNode> schemaNodeList = new ArrayList<TreeNode>();

		for (String schemaName : schemaList) {
			TreeNode schemaNode = new TreeNode(schemaName);
			schemaNode.setParent(topNode);
			schemaNodeList.add(schemaNode);
		}

		topNode.setChildren(schemaNodeList.toArray(new TreeNode[schemaNodeList
				.size()]));

		return treeNodeList;
	}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:22,代码来源:SelectImportedSchemaDialog.java

示例7: createTreeNodeList

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
protected List<TreeNode> createTreeNodeList() {
	List<TreeNode> treeNodeList = new ArrayList<TreeNode>();

	TreeNode topNode = new TreeNode(new StringObjectModel(
			ResourceString.getResourceString("label.testdata")));
	treeNodeList.add(topNode);

	List<TreeNode> nodeList = new ArrayList<TreeNode>();

	for (TestData testData : this.testDataList) {
		TreeNode objectNode = new TreeNode(testData);
		objectNode.setParent(topNode);

		nodeList.add(objectNode);
	}

	topNode.setChildren(nodeList.toArray(new TreeNode[nodeList.size()]));

	return treeNodeList;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:21,代码来源:ExportToTestDataDialog.java

示例8: performOK

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
@Override
protected void performOK() throws InputException {
    final Object[] selectedNodes = viewer.getCheckedElements();

    this.resultSelectedDbObjects = new ArrayList<>();

    for (int i = 0; i < selectedNodes.length; i++) {
        final Object value = ((TreeNode) selectedNodes[i]).getValue();

        if (value instanceof DBObject) {
            resultSelectedDbObjects.add((DBObject) value);
        }
    }

    this.resultMergeWord = mergeWordButton.getSelection();
    this.resultMergeGroup = mergeGroupButton.getSelection();
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:18,代码来源:AbstractSelectImportedObjectDialog.java

示例9: createTreeNodeList

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
protected List<TreeNode> createTreeNodeList() {
    final List<TreeNode> treeNodeList = new ArrayList<>();
    final TreeNode topNode = new TreeNode(new StringObjectModel(DisplayMessages.getMessage("label.schema")));
    treeNodeList.add(topNode);

    final List<TreeNode> schemaNodeList = new ArrayList<>();
    for (final String schemaName : schemaList) {
        final TreeNode schemaNode = new TreeNode(schemaName);
        schemaNode.setParent(topNode);
        schemaNodeList.add(schemaNode);
    }

    topNode.setChildren(schemaNodeList.toArray(new TreeNode[schemaNodeList.size()]));

    return treeNodeList;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:17,代码来源:SelectImportedSchemaDialog.java

示例10: getText

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public String getText(Object element) {
	if (element instanceof TreeNode && !(((TreeNode) element).getValue() instanceof HistoryInfo)) {
		String toolTipText = super.getToolTipText(element);
		return toolTipText;
	} else if (element instanceof HistoryInfo) {
		LogMessage logMessage = null;
		HistoryInfo historyInfo = (HistoryInfo) element;
		StringBuilder builder = new StringBuilder();
		if (historyInfo.getLogMessage() != null) {
			logMessage = historyInfo.getLogMessage();
		} else if (historyInfo.getChangePackage() != null && historyInfo.getChangePackage().getLogMessage() != null) {
			logMessage = historyInfo.getChangePackage().getLogMessage();
		}
		if (logMessage != null) {
			builder.append(logMessage.getMessage());
		}
		return builder.toString();
	}
	return null;
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:25,代码来源:LogMessageColumnLabelProvider.java

示例11: equals

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (!super.equals(obj))
        return false;
    if (getClass() != obj.getClass())
        return false;
    PackageTreeNode other = (PackageTreeNode) obj;
    if (value == null) {
        if (other.value != null)
            return false;
    } else if (!value.equals(other.getValue())) {
        return false;
    } else {
        final TreeNode parent = getParent();
        while (parent != null) {
            if (!parent.equals(other.getParent())) {
                return false;
            }
break;
        }
    }
    return true;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:26,代码来源:PackageTreeNode.java

示例12: createControl

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
    super.createControl(parent);
    viewer = getTreeViewer();
    contentProvider = new TreeNodeContentProvider();
    viewer.setContentProvider(contentProvider);
    labelProvider = new TextUMLLabelProvider();
    viewer.setLabelProvider(labelProvider);
    // disabled: used to make elements to show sorted by type
    // viewer.setComparator(new UIModelObjectViewerComparator());
    viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);

    // tracks selections in the outline and reflects them in the editor
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            TreeSelection selection = (TreeSelection) event.getSelection();
            if (!selection.isEmpty()) {
                TreeNode treeNode = (TreeNode) selection.getFirstElement();
                UIModelObject model = (UIModelObject) treeNode.getValue();
                selectInEditor(model.getToken());
            }
        }
    });

    refresh();
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:27,代码来源:SourceContentOutlinePage.java

示例13: buildConceptTree

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
private static TreeNode buildConceptTree(TreeNode parent,OWLClass cl,OWLReasoner r) throws OWLReasonerException {
	ConceptTreeNode ctn = new ConceptTreeNode(cl);
		
	
	TreeNode td = new TreeNode(ctn);
	td.setParent(parent);
	ArrayList<TreeNode> childs = new ArrayList<TreeNode>();
	
	//recursivly build up tree
	Set<Set<OWLClass>> subs = r.getSubClasses(cl);
	for (Set<OWLClass> eqSubs:subs) {
		for (OWLClass sub:eqSubs) {
			if (sub != ontologyStore.getOntologyManager().getOWLDataFactory().getOWLNothing())
				childs.add(buildConceptTree(td, sub,r));
		}
	}
	
	if( !childs.isEmpty())
		td.setChildren(childs.toArray(new TreeNode[0]));
	else td.setChildren(null);
	return td;
}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:23,代码来源:ConceptTree.java

示例14: setData

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
@Override
protected void setData() {
    final List<TreeNode> treeNodeList = createTreeNodeList();

    final TreeNode[] treeNodes = treeNodeList.toArray(new TreeNode[treeNodeList.size()]);
    viewer.setInput(treeNodes);
    viewer.setCheckedElements(treeNodes);
    viewer.expandAll();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:10,代码来源:AbstractSelectImportedObjectDialog.java

示例15: createTopNode

import org.eclipse.jface.viewers.TreeNode; //导入依赖的package包/类
protected TreeNode createTopNode(final String objectType, final List<DBObject> dbObjectList) {
    final TreeNode treeNode = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.object.type." + objectType)));
    final List<TreeNode> objectNodeList = new ArrayList<TreeNode>();

    for (final DBObject dbObject : dbObjectList) {
        final TreeNode objectNode = new TreeNode(dbObject);
        objectNode.setParent(treeNode);

        objectNodeList.add(objectNode);
    }

    treeNode.setChildren(objectNodeList.toArray(new TreeNode[objectNodeList.size()]));

    return treeNode;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:16,代码来源:AbstractSelectImportedObjectDialog.java


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