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


Java TreeNode.setParent方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: buttonPressed

import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
@Override
protected void buttonPressed(int buttonId) {
	setErrorMessage(null);
	if (buttonId == IDialogConstants.OK_ID) {
		if ("".equals(this.paramNameText.getText())) { //$NON-NLS-1$
			setErrorMessage("param\u540D\u4E0D\u80FD\u4E3A\u7A7A"); //$NON-NLS-1$
			return;
		}
		if ("".equals(this.paramValueText.getText())) { //$NON-NLS-1$
			setErrorMessage("param\u503C\u4E0D\u80FD\u4E3A\u7A7A"); //$NON-NLS-1$
			return;
		}
		StructuredSelection ss = (StructuredSelection)list.getSelection();
		Feature feature = (Feature)ss.getFirstElement();
		
		for(Param param : feature.getParams()) {
			if(param.getName().equals(this.paramNameText.getText())) {
				setErrorMessage(Messages.PARAMNAMEREPEAT); //$NON-NLS-1$
				return;
			}
		}
		Param p = new Param();
		p.setName(this.paramNameText.getText());
		p.setValue(this.paramValueText.getText());
		
		feature.addParams(p);
		TreeNode node = new TreeNode(p);
		node.setParent(new TreeNode(feature));
		treeViewer.setInput(config.createTreeNode());
		treeViewer.collapseAll();
		StructuredSelection selection = new StructuredSelection(node);
		treeViewer.setSelection(selection, true);
		treeViewer.refresh();
		editor.setDirty(true);
		editor.change();
	} 
	super.buttonPressed(buttonId);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:39,代码来源:CreateParamDialog.java

示例8: createTreeNode

import org.eclipse.jface.viewers.TreeNode; //导入方法依赖的package包/类
public TreeNode[] createTreeNode(TreeNode parent) {
	int size = getParams().size();
	TreeNode params[] = new TreeNode[size];
	for (int i = 0; i < size; i++) {
		TreeNode param = new TreeNode(getParams().get(i));
		param.setParent(parent);
		params[i] = param;
	}
	return params;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:11,代码来源:Feature.java

示例9: createTopNode

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

    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:dbflute-session,项目名称:erflute,代码行数:16,代码来源:AbstractSelectImportedObjectDialog.java

示例10: createTreeNodeList

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

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

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

    for (final Map.Entry<String, List<DBObject>> entry : dbObjectSet.getSchemaDbObjectListMap().entrySet()) {
        String schemaName = entry.getKey();
        if ("".equals(schemaName)) {
            schemaName = ResourceString.getResourceString("label.none");
        }
        final TreeNode schemaNode = new TreeNode(new StringObjectModel(schemaName));
        schemaNode.setParent(topNode);
        schemaNodeList.add(schemaNode);

        final List<DBObject> dbObjectList = entry.getValue();

        final TreeNode[] objectTypeNodes = new TreeNode[DBObject.ALL_TYPES.length];

        for (int i = 0; i < DBObject.ALL_TYPES.length; i++) {
            objectTypeNodes[i] = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.object.type." + DBObject.ALL_TYPES[i])));

            final List<TreeNode> objectNodeList = new ArrayList<TreeNode>();

            for (final DBObject dbObject : dbObjectList) {
                if (DBObject.ALL_TYPES[i].equals(dbObject.getType())) {
                    final TreeNode objectNode = new TreeNode(dbObject);
                    objectNode.setParent(objectTypeNodes[i]);

                    objectNodeList.add(objectNode);
                }
            }

            objectTypeNodes[i].setChildren(objectNodeList.toArray(new TreeNode[objectNodeList.size()]));
        }

        schemaNode.setChildren(objectTypeNodes);
    }

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

    topNode = createTopNode(DBObject.TYPE_TABLESPACE, dbObjectSet.getTablespaceList());
    treeNodeList.add(topNode);

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

示例11: createTreeNodeList

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

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

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

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

        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:roundrop,项目名称:ermasterr,代码行数:20,代码来源:SelectImportedSchemaDialog.java

示例12: createTreeNodeList

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

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

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

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

        nodeList.add(objectNode);
    }

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

    return treeNodeList;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:20,代码来源:ExportToTestDataDialog.java

示例13: 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 (Map.Entry<String, List<DBObject>> entry : dbObjectSet
			.getSchemaDbObjectListMap().entrySet()) {
		String schemaName = entry.getKey();
		if ("".equals(schemaName)) {
			schemaName = ResourceString.getResourceString("label.none");
		}
		TreeNode schemaNode = new TreeNode(
				new StringObjectModel(schemaName));
		schemaNode.setParent(topNode);
		schemaNodeList.add(schemaNode);

		List<DBObject> dbObjectList = entry.getValue();

		TreeNode[] objectTypeNodes = new TreeNode[DBObject.ALL_TYPES.length];

		for (int i = 0; i < DBObject.ALL_TYPES.length; i++) {
			objectTypeNodes[i] = new TreeNode(new StringObjectModel(
					ResourceString.getResourceString("label.object.type."
							+ DBObject.ALL_TYPES[i])));

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

			for (DBObject dbObject : dbObjectList) {
				if (DBObject.ALL_TYPES[i].equals(dbObject.getType())) {
					TreeNode objectNode = new TreeNode(dbObject);
					objectNode.setParent(objectTypeNodes[i]);

					objectNodeList.add(objectNode);
				}
			}

			objectTypeNodes[i].setChildren(objectNodeList
					.toArray(new TreeNode[objectNodeList.size()]));
		}

		schemaNode.setChildren(objectTypeNodes);
	}

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

	topNode = createTopNode(DBObject.TYPE_TABLESPACE,
			this.dbObjectSet.getTablespaceList());
	treeNodeList.add(topNode);

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

示例14: createTreeNodeList

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

    TreeNode topNode = new TreeNode(new StringObjectModel(DisplayMessages.getMessage("label.schema")));
    treeNodeList.add(topNode);

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

    for (final Map.Entry<String, List<DBObject>> entry : dbObjectSet.getSchemaDbObjectListMap().entrySet()) {
        String schemaName = entry.getKey();
        if ("".equals(schemaName)) {
            schemaName = DisplayMessages.getMessage("label.none");
        }
        final TreeNode schemaNode = new TreeNode(new StringObjectModel(schemaName));
        schemaNode.setParent(topNode);
        schemaNodeList.add(schemaNode);

        final List<DBObject> dbObjectList = entry.getValue();

        final TreeNode[] objectTypeNodes = new TreeNode[DBObject.ALL_TYPES.length];

        for (int i = 0; i < DBObject.ALL_TYPES.length; i++) {
            objectTypeNodes[i] =
                    new TreeNode(new StringObjectModel(DisplayMessages.getMessage("label.object.type." + DBObject.ALL_TYPES[i])));

            final List<TreeNode> objectNodeList = new ArrayList<>();

            for (final DBObject dbObject : dbObjectList) {
                if (DBObject.ALL_TYPES[i].equals(dbObject.getType())) {
                    final TreeNode objectNode = new TreeNode(dbObject);
                    objectNode.setParent(objectTypeNodes[i]);

                    objectNodeList.add(objectNode);
                }
            }

            objectTypeNodes[i].setChildren(objectNodeList.toArray(new TreeNode[objectNodeList.size()]));
        }

        schemaNode.setChildren(objectTypeNodes);
    }

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

    topNode = createTopNode(DBObject.TYPE_TABLESPACE, dbObjectSet.getTablespaceList());
    treeNodeList.add(topNode);

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


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