public List<Object> getChildren(TreeItem treeItem) { List<Object> result = new ArrayList<Object>(); // Object dataObj = treeItem.getDataObject(); if (isLeafDataObject(dataObj)) { return result; } if (dataObj instanceof TMapModel) { // tMapModel is the root result.addAll(getImportedModels(myTMapModel, myPtTreeFilter)); result.add(NodeType.NON_IMPORTED_ARTIFACTS); } else if (dataObj == NodeType.NON_IMPORTED_ARTIFACTS) { result.addAll(getNonImportedModels(myTMapModel, myPtTreeFilter)); } else if (dataObj instanceof WSDLModel) { Definitions defs = ((WSDLModel) dataObj).getDefinitions(); Collection<PortType> pts = defs != null ? defs.getPortTypes() : null; if (pts != null) { for (PortType pt : pts) { result.add(pt); } } } else if (dataObj instanceof PortType) { Collection<Operation> ops = ((PortType) dataObj).getOperations(); if (ops != null) { for (Operation op : ops) { result.add(op); } } } // return result; }
public Icon getIcon(TreeItem treeItem) { Object dataObj = treeItem.getDataObject(); // Icon result = null; if (dataObj instanceof TMapModel) { result = NodeType.TRANSFORMMAP.getIcon(); } else if (dataObj == NodeType.NON_IMPORTED_ARTIFACTS) { result = NodeType.TRANSFORMMAP.getIcon(); // [FIXME_MOVE_TO6_1] // ImageUtilities.image2Icon(FolderIcon.getOpenedIcon()); } else if (dataObj instanceof WSDLModel || dataObj instanceof WSDLComponent) { result = WSDLTreeInfoProvider.getInstance().getIcon(treeItem); } // return result; }
public String getDisplayName(TreeItem treeItem) { Object dataObj = treeItem.getDataObject(); // String result = null; if (dataObj instanceof TMapModel) { TransformMap transformMap = ((TMapModel) dataObj).getTransformMap(); if (transformMap != null) { result = new DecoratedTransformMap(transformMap).getDisplayName(); } } else if (dataObj == NodeType.NON_IMPORTED_ARTIFACTS) { result = NodeType.NON_IMPORTED_ARTIFACTS.getDisplayName(); } else if (dataObj instanceof WSDLModel || dataObj instanceof WSDLComponent) { result = WSDLTreeInfoProvider.getInstance().getDisplayName(treeItem); } // if (result == null) { result = dataObj.toString(); } // return result; }