/** * Collects the complete set of {@link IApiProblemFilter}s for the given collection of {@link IType}s * @param types * @return the complete collection of {@link IApiProblemFilter}s or an empty list, never <code>null</code> */ static IApiProblemFilter[] collectAllAffectedFilters(IApiFilterStore store, IType[] types) { HashSet filters = new HashSet(); IApiProblemFilter[] fs = null; IResource resource = null; for (int i = 0; i < types.length; i++) { try { resource = types[i].getUnderlyingResource(); if(resource == null) { continue; } fs = store.getFilters(resource); for (int j = 0; j < fs.length; j++) { filters.add(fs[j]); } } catch(JavaModelException jme) { //do nothing } } return (IApiProblemFilter[]) filters.toArray(new IApiProblemFilter[filters.size()]); }
/** * Collects the complete set of {@link IApiProblemFilter}s for the given * collection of {@link IType}s * * @param types * @return the complete collection of {@link IApiProblemFilter}s or an empty * list, never <code>null</code> */ static IApiProblemFilter[] collectAllAffectedFilters(IApiFilterStore store, IType[] types) { HashSet<IApiProblemFilter> filters = new HashSet<>(); IApiProblemFilter[] fs = null; IResource resource = null; for (IType type : types) { try { resource = type.getUnderlyingResource(); if (resource == null) { continue; } fs = store.getFilters(resource); for (IApiProblemFilter element : fs) { filters.add(element); } } catch (JavaModelException jme) { // do nothing } } return filters.toArray(new IApiProblemFilter[filters.size()]); }
try IResource resource = axisProxy.getUnderlyingResource(); if (resource != null)
private void computeJavaTypes(IType type) { if (type == null || visitedJavaTypes.contains(type)) return; visitedJavaTypes.add(type); //String qualifiedName = type.getFullyQualifiedName(); try { IFile file = (IFile)type.getUnderlyingResource(); if (file != null && ejbProject.equals(file.getProject())) { if (!file.isDerived()) cacheType(type, file); computeRequiredReferencedJavaTypes(type); } } catch (JavaModelException e) { Logger.getLogger().logError(e); return; } }
try IResource res = itype.getUnderlyingResource(); if (res != null)
if(type != null) { try { resource = type.getUnderlyingResource(); if(resource == null) { resource = type.getAdapter(IResource.class);
if(type != null) { try { resource = type.getUnderlyingResource(); if(resource == null) { resource = type.getAdapter(IResource.class);
/** * Creates the {@link Change} for updating the filter store when a type is * deleted * * @param type the type being deleted * @return the change to the filter store */ static Change createDeleteFilterChanges(IType type) { try { IResource resource = type.getUnderlyingResource(); if (resource != null) { IApiFilterStore store = resolveFilterStore(resource.getProject()); if (store == null) { return null; } IApiProblemFilter[] filters = store.getFilters(resource); if (filters.length != 0) { CompositeChange cchange = new CompositeChange(RefactoringMessages.RefactoringUtils_remove_usused_filters); for (IApiProblemFilter filter : filters) { cchange.add(new TypeFilterChange(store, filter, null, null, FilterChange.DELETE)); } return cchange; } } } catch (CoreException ce) { } return null; }
/** * Creates the {@link Change} for updating the filter store * when a type is deleted * * @param type the type being deleted * @return the change to the filter store */ static Change createDeleteFilterChanges(IType type) { try { IResource resource = type.getUnderlyingResource(); if(resource != null) { IApiFilterStore store = resolveFilterStore(resource.getProject()); if(store == null) { return null; } IApiProblemFilter[] filters = store.getFilters(resource); if(filters.length != 0) { CompositeChange cchange = new CompositeChange(RefactoringMessages.RefactoringUtils_remove_usused_filters); for (int i = 0; i < filters.length; i++) { cchange.add(new TypeFilterChange(store, filters[i], null, null, FilterChange.DELETE)); } return cchange; } } } catch(CoreException ce) {} return null; }
protected ILaunchConfiguration createConfiguration(IType type) { ILaunchConfiguration config = null; ILaunchConfigurationWorkingCopy wc = null; try { ILaunchConfigurationType configType = getConfigurationType(); wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(type.getElementName())); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, type.getFullyQualifiedName()); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, type.getJavaProject().getElementName()); //CONTEXTLAUNCHING wc.setMappedResources(new IResource[] {type.getUnderlyingResource()}); config = wc.doSave(); } catch (CoreException exception) { reportErorr(exception); } return config; }
protected ILaunchConfiguration createConfiguration(IType type) { ILaunchConfiguration config = null; try { ILaunchConfigurationType configType = getConfigurationType(); ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(type.getElementName())); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, type.getFullyQualifiedName()); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, type.getJavaProject().getElementName()); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_WIDTH, AppletParametersTab.DEFAULT_APPLET_WIDTH); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_HEIGHT, AppletParametersTab.DEFAULT_APPLET_HEIGHT); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_NAME, ""); //$NON-NLS-1$ //CONTEXTLAUNCHING wc.setMappedResources(new IResource[] {type.getUnderlyingResource()}); config = wc.doSave(); } catch (CoreException ce) { reportErorr(ce); } return config; }