@Override public String getNameImpl() { Import imprt = getReference(); if (imprt == null) { return super.getNameImpl(); } String relativePath = getRelativePath(imprt); if (relativePath != null && relativePath.length() > 0) { return relativePath; } String location = imprt.getLocation(); if (location != null && location.length() > 0) { return ResolverUtility.decodeLocation(location); } String namespace = imprt.getNamespace(); if (namespace != null && namespace.length() > 0) { return namespace; } // TODO:change to use NbBundle, figure out good name return "Unqualified"; }
private DataObject getDataObject() { Import imprt = getReference(); FileObject fo = null; synchronized (imprt) { if (imprt == null) { return null; } fo = ResolverUtility.getImportedFileObject(imprt); } // to prevent IllegalArgumentException from DataObject.find(fo) if (fo == null || !fo.isValid()) { return null; } try { DataObject dObj = DataObject.find(fo); return dObj; } catch (DataObjectNotFoundException ex) { // ex.printStackTrace(); return null; } }
private String getRelativePath(Import imprt) { assert imprt != null; FileObject ifo = ResolverUtility.getImportedFileObject(imprt); Project modelProject = Utils.safeGetProject(imprt.getBpelModel()); return ResolverUtility.safeGetRelativePath(ifo, modelProject); }