Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] ModuleCore API suggestion

The following code seem to repeat a lot for me. Maybe it is a candidate for an API method
(given a resource return its module)

			ModuleCore  core= ModuleCore.getModuleCoreForRead(project);
			WorkbenchComponent ejbModule = null;
			URI sourcePath = URI.createURI(resource.getFullPath().toString());
ComponentResource[] moduleResources = core.findWorkbenchModuleResourcesBySourcePath(sourcePath);
			for (int i = 0; i < moduleResources.length; i++) {
				ComponentResource moduleResource = moduleResources[i];
				if (moduleResource != null)
					ejbModule = moduleResource.getComponent();
				if (ejbModule != null)
					break;
			}
Naci Dai,
Managing Director

eteration a.s.
Inonu cad. Sumer sok. Zitas D1-15
Kozyatagi, Istanbul 81090
+90 (532) 573 7783 (cell)
+90 (216) 361 5434 (phone)
+90 (216) 361 2034 (fax)
http://www.eteration.com
mailto:nacidai@xxxxxxx
mailto:naci@xxxxxxxxxxxxx




Back to the top