public EditFilterWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation) { super(existingEntries, newEntry, outputLocation, NewWizardMessages.ExclusionInclusionDialog_title, null); IPath[] inc= (IPath[])newEntry.getAttribute(CPListElement.INCLUSION); fOrginalInclusion= new IPath[inc.length]; System.arraycopy(inc, 0, fOrginalInclusion, 0, inc.length); IPath[] excl= (IPath[])newEntry.getAttribute(CPListElement.EXCLUSION); fOriginalExclusion= new IPath[excl.length]; System.arraycopy(excl, 0, fOriginalExclusion, 0, excl.length); }
public EditFilterWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation) { super(existingEntries, newEntry, outputLocation, NewWizardMessages.ExclusionInclusionDialog_title, null); IPath[] inc= (IPath[])newEntry.getAttribute(CPListElement.INCLUSION); fOrginalInclusion= new IPath[inc.length]; System.arraycopy(inc, 0, fOrginalInclusion, 0, inc.length); IPath[] excl= (IPath[])newEntry.getAttribute(CPListElement.EXCLUSION); fOriginalExclusion= new IPath[excl.length]; System.arraycopy(excl, 0, fOriginalExclusion, 0, excl.length); }
public EditFilterWizard(CPListElement[] existingEntries, CPListElement newEntry, IPath outputLocation) { super(existingEntries, newEntry, outputLocation, NewWizardMessages.ExclusionInclusionDialog_title, null); IPath[] inc= (IPath[])newEntry.getAttribute(CPListElement.INCLUSION); fOrginalInclusion= new IPath[inc.length]; System.arraycopy(inc, 0, fOrginalInclusion, 0, inc.length); IPath[] excl= (IPath[])newEntry.getAttribute(CPListElement.EXCLUSION); fOriginalExclusion= new IPath[excl.length]; System.arraycopy(excl, 0, fOriginalExclusion, 0, excl.length); }
private boolean isIgnoringOptionalProblems() { return "true".equals(fElement.getAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS)); //$NON-NLS-1$ } }
private boolean isIgnoringOptionalProblems() { return "true".equals(fElement.getAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS)); //$NON-NLS-1$ } }
public <T extends ModuleEncapsulationDetail> List<T> getModuleEncapsulationDetails(Class<T> clazz) { Object moduleDetails= getAttribute(CPListElement.MODULE); if (moduleDetails instanceof ModuleEncapsulationDetail[]) { ModuleEncapsulationDetail[] details= (ModuleEncapsulationDetail[]) moduleDetails; List<T> elements= new ArrayList<>(details.length); for (int i= 0; i < details.length; i++) { if (clazz.isInstance(details[i])) elements.add(clazz.cast(details[i])); } return elements; } else { return Collections.emptyList(); } }
/** * Reset the output folder for the given entry to the default output folder * * @param entry the <code>CPListElement</code> to be edited * @param project the Java project * @return an attribute representing the modified output folder * @throws JavaModelException */ public static CPListElementAttribute resetOutputFolder(CPListElement entry, IJavaProject project) throws JavaModelException { entry.setAttribute(CPListElement.OUTPUT, null); CPListElementAttribute outputFolder= new CPListElementAttribute(entry, CPListElement.OUTPUT, entry.getAttribute(CPListElement.OUTPUT), true); return outputFolder; }
/** * Reset the output folder for the given entry to the default output folder * * @param entry the <code>CPListElement</code> to be edited * @param project the Java project * @return an attribute representing the modified output folder * @throws JavaModelException */ public static CPListElementAttribute resetOutputFolder(CPListElement entry, IJavaProject project) throws JavaModelException { entry.setAttribute(CPListElement.OUTPUT, null); CPListElementAttribute outputFolder= new CPListElementAttribute(entry, CPListElement.OUTPUT, entry.getAttribute(CPListElement.OUTPUT), true); return outputFolder; }
/** * Reset the output folder for the given entry to the default output folder * * @param entry the <code>CPListElement</code> to be edited * @param project the Java project * @return an attribute representing the modified output folder * @throws JavaModelException */ public static CPListElementAttribute resetOutputFolder(CPListElement entry, IJavaProject project) throws JavaModelException { entry.setAttribute(CPListElement.OUTPUT, null); CPListElementAttribute outputFolder= new CPListElementAttribute(entry, CPListElement.OUTPUT, entry.getAttribute(CPListElement.OUTPUT), true); return outputFolder; }
private boolean removeFilter(IPath path, String key) { IPath[] filters= (IPath[]) getAttribute(key); if (filters == null) return false; IPath toRemove= path.removeFirstSegments(getPath().segmentCount()).addTrailingSeparator(); if (JavaModelUtil.isExcludedPath(toRemove, filters)) { List l= new ArrayList(Arrays.asList(filters)); l.remove(toRemove); IPath[] newFilters= (IPath[])l.toArray(new IPath[l.size()]); setAttribute(key, newFilters); return true; } return false; }
private void doUpdateUI() { fPackageExplorer.setInput(fJavaProject); boolean useFolderOutputs= false; List cpelements= fClassPathList.getElements(); for (int i= 0; i < cpelements.size() && !useFolderOutputs; i++) { CPListElement cpe= (CPListElement) cpelements.get(i); if (cpe.getEntryKind() == IClasspathEntry.CPE_SOURCE) { if (cpe.getAttribute(CPListElement.OUTPUT) != null) { useFolderOutputs= true; } } } fUseFolderOutputs.setSelection(useFolderOutputs); }
public AccessRulesDialog(Shell parent, CPListElement entryToEdit, IJavaProject project, boolean parentCanSwitchPage) { super(parent); fCurrElement= entryToEdit; fProject= project; // can be null setTitle(NewWizardMessages.AccessRulesDialog_title); fAccessRulesList= createListContents(entryToEdit); fCombineRulesCheckbox= new SelectionButtonDialogField(SWT.CHECK); fCombineRulesCheckbox.setLabelText(NewWizardMessages.AccessRulesDialog_combine_label); fCombineRulesCheckbox.setSelection(Boolean.TRUE.equals(entryToEdit.getAttribute(CPListElement.COMBINE_ACCESSRULES))); fParentCanSwitchPage= parentCanSwitchPage; }
public AccessRulesDialog(Shell parent, CPListElement entryToEdit, IJavaProject project, boolean parentCanSwitchPage) { super(parent); fCurrElement= entryToEdit; fProject= project; // can be null setTitle(NewWizardMessages.AccessRulesDialog_title); fAccessRulesList= createListContents(entryToEdit); fCombineRulesCheckbox= new SelectionButtonDialogField(SWT.CHECK); fCombineRulesCheckbox.setLabelText(NewWizardMessages.AccessRulesDialog_combine_label); fCombineRulesCheckbox.setSelection(Boolean.TRUE.equals(entryToEdit.getAttribute(CPListElement.COMBINE_ACCESSRULES))); fParentCanSwitchPage= parentCanSwitchPage; }
private static IClasspathEntry getUpdatedEntry(IClasspathEntry currEntry, IClasspathEntry updatedEntry, String[] updatedAttributes, IJavaProject jproject) { if (updatedAttributes == null) { return updatedEntry; // used updated entry 'as is' } CPListElement currElem= CPListElement.createFromExisting(currEntry, jproject); CPListElement newElem= CPListElement.createFromExisting(updatedEntry, jproject); for (int i= 0; i < updatedAttributes.length; i++) { String attrib= updatedAttributes[i]; currElem.setAttribute(attrib, newElem.getAttribute(attrib)); } return currElem.getClasspathEntry(); }
private static IClasspathEntry getUpdatedEntry(IClasspathEntry currEntry, IClasspathEntry updatedEntry, String[] updatedAttributes, IJavaProject jproject) { if (updatedAttributes == null) { return updatedEntry; // used updated entry 'as is' } CPListElement currElem= CPListElement.createFromExisting(currEntry, jproject); CPListElement newElem= CPListElement.createFromExisting(updatedEntry, jproject); for (int i= 0; i < updatedAttributes.length; i++) { String attrib= updatedAttributes[i]; currElem.setAttribute(attrib, newElem.getAttribute(attrib)); } return currElem.getClasspathEntry(); }
private static IClasspathEntry getUpdatedEntry(IClasspathEntry currEntry, IClasspathEntry updatedEntry, String[] updatedAttributes, IJavaProject jproject) { if (updatedAttributes == null) { return updatedEntry; // used updated entry 'as is' } CPListElement currElem= CPListElement.createFromExisting(currEntry, jproject); CPListElement newElem= CPListElement.createFromExisting(updatedEntry, jproject); for (int i= 0; i < updatedAttributes.length; i++) { String attrib= updatedAttributes[i]; currElem.setAttribute(attrib, newElem.getAttribute(attrib)); } return currElem.getClasspathEntry(); }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
private static boolean addToExclusions(IPath entryPath, CPListElement curr) { IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION); if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) { IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator(); IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1]; System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length); newExclusionFilters[exclusionFilters.length]= pathToExclude; curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters); return true; } return false; }
public AccessRulesDialog(Shell parent, CPListElement entryToEdit, IJavaProject project, boolean parentCanSwitchPage) { super(parent); setShellStyle(getShellStyle() | SWT.RESIZE); fCurrElement= entryToEdit; fProject= project; // can be null setTitle(NewWizardMessages.AccessRulesDialog_title); fAccessRulesList= createListContents(entryToEdit); fCombineRulesCheckbox= new SelectionButtonDialogField(SWT.CHECK); fCombineRulesCheckbox.setLabelText(NewWizardMessages.AccessRulesDialog_combine_label); fCombineRulesCheckbox.setSelection(Boolean.TRUE.equals(entryToEdit.getAttribute(CPListElement.COMBINE_ACCESSRULES))); fParentCanSwitchPage= parentCanSwitchPage; }