Java Code Examples for org.eclipse.jdt.core.IPackageFragment#isReadOnly()
The following examples show how to use
org.eclipse.jdt.core.IPackageFragment#isReadOnly() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExternalizeStringsAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private List<NonNLSElement> analyze(IPackageFragmentRoot sourceFolder, IProgressMonitor pm) throws CoreException { try{ IJavaElement[] children= sourceFolder.getChildren(); pm.beginTask("", children.length); //$NON-NLS-1$ pm.setTaskName(JavaElementLabels.getElementLabel(sourceFolder, JavaElementLabels.ALL_DEFAULT)); List<NonNLSElement> result= new ArrayList<NonNLSElement>(); for (int i= 0; i < children.length; i++) { IJavaElement iJavaElement= children[i]; if (iJavaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT){ IPackageFragment pack= (IPackageFragment)iJavaElement; if (! pack.isReadOnly()) result.addAll(analyze(pack, new SubProgressMonitor(pm, 1))); else pm.worked(1); } else pm.worked(1); } return result; } finally{ pm.done(); } }
Example 2
Source File: FindStringsToExternalizeAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private List<NonNLSElement> analyze(IPackageFragmentRoot sourceFolder, IProgressMonitor pm) throws CoreException { try{ IJavaElement[] children= sourceFolder.getChildren(); pm.beginTask("", children.length); //$NON-NLS-1$ pm.setTaskName(JavaElementLabels.getElementLabel(sourceFolder, JavaElementLabels.ALL_DEFAULT)); List<NonNLSElement> result= new ArrayList<NonNLSElement>(); for (int i= 0; i < children.length; i++) { IJavaElement iJavaElement= children[i]; if (iJavaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT){ IPackageFragment pack= (IPackageFragment)iJavaElement; if (! pack.isReadOnly()) result.addAll(analyze(pack, new SubProgressMonitor(pm, 1))); else pm.worked(1); } else pm.worked(1); } return result; } finally{ pm.done(); } }
Example 3
Source File: PackageBrowseAdapter.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
static boolean canAddPackage(IPackageFragment p) throws JavaModelException{ if (! p.exists()) return false; if (p.isReadOnly()) return false; if (! p.isStructureKnown()) return false; return true; }