public Object getAttribute(String key) { CPListElementAttribute attrib= findAttributeElement(key); if (attrib != null) { return attrib.getValue(); } return null; }
public Object getAttribute(String key) { CPListElementAttribute attrib= findAttributeElement(key); if (attrib != null) { return attrib.getValue(); } return null; }
public Object getAttribute(String key) { CPListElementAttribute attrib= findAttributeElement(key); if (attrib != null) { return attrib.getValue(); } return null; }
public CPListElementAttribute setAttribute(String key, Object value) { CPListElementAttribute attribute= findAttributeElement(key); if (attribute == null) { return null; } if (key.equals(EXCLUSION) || key.equals(INCLUSION)) { Assert.isTrue(value != null || fEntryKind != IClasspathEntry.CPE_SOURCE); } if (key.equals(ACCESSRULES)) { Assert.isTrue(value != null || fEntryKind == IClasspathEntry.CPE_SOURCE); } if (key.equals(COMBINE_ACCESSRULES)) { Assert.isTrue(value instanceof Boolean); } attribute.setValue(value); return attribute; }
public CPListElementAttribute setAttribute(String key, Object value) { CPListElementAttribute attribute= findAttributeElement(key); if (attribute == null) { return null; } if (key.equals(EXCLUSION) || key.equals(INCLUSION)) { Assert.isTrue(value != null || fEntryKind != IClasspathEntry.CPE_SOURCE); } if (key.equals(ACCESSRULES)) { Assert.isTrue(value != null || fEntryKind == IClasspathEntry.CPE_SOURCE); } if (key.equals(COMBINE_ACCESSRULES)) { Assert.isTrue(value instanceof Boolean); } attribute.setValue(value); return attribute; }
public CPListElementAttribute setAttribute(String key, Object value) { CPListElementAttribute attribute= findAttributeElement(key); if (attribute == null) { return null; } if (key.equals(EXCLUSION) || key.equals(INCLUSION)) { Assert.isTrue(value != null || fEntryKind != IClasspathEntry.CPE_SOURCE); } if (key.equals(ACCESSRULES)) { Assert.isTrue(value != null || fEntryKind == IClasspathEntry.CPE_SOURCE); } if (key.equals(COMBINE_ACCESSRULES)) { Assert.isTrue(value instanceof Boolean); } attribute.setValue(value); return attribute; }
void setModuleAttributeIf9OrHigher(IJavaProject project) { if (!JavaModelUtil.is9OrHigher(project)) { return; } CPListElementAttribute moduleAttribute= findAttributeElement(MODULE); if (moduleAttribute == null) { createAttributeElement(MODULE, new ModuleEncapsulationDetail[0], true); } else { moduleAttribute.setValue(new ModuleEncapsulationDetail[0]); } }
/** * When the dialog is closed, this method provides the results. * @return an array of ModuleEncapsulationDetail encoding the result of editing */ public ModuleEncapsulationDetail[] getAllDetails() { if (!fIsModuleCheckbox.isSelected()) return null; CPListElementAttribute attribute= fCurrCPElement.findAttributeElement(CPListElement.MODULE); List<ModuleEncapsulationDetail> allElements= new ArrayList<>(); allElements.addAll(fAddExportsList.getElements()); allElements.addAll(fAddReadsList.getElements()); if (fIsPatchCheckbox.isSelected()) { String patchedModule= fPatchedModule.getText().trim(); if (!patchedModule.isEmpty()) allElements.add(ModulePatch.fromString(attribute, patchedModule)); } if (modifiesContents()) { allElements.add(new ModuleEncapsulationDetail.LimitModules(fModuleLists[IDX_INCLUDED].fNames, attribute)); } return allElements.toArray(new ModuleEncapsulationDetail[allElements.size()]); }
public void setElementToReveal(IClasspathEntry entry, String attributeKey) { int pageIndex= getPageIndex(entry.getEntryKind()); if (fTabFolder == null) { fPageIndex= pageIndex; } else { fTabFolder.setSelection(pageIndex); CPListElement element= findElement(entry); if (element != null) { Object elementToSelect= element; if (attributeKey != null) { Object attrib= element.findAttributeElement(attributeKey); if (attrib != null) { elementToSelect= attrib; } } BuildPathBasePage page= (BuildPathBasePage) fTabFolder.getItem(pageIndex).getData(); List<Object> selection= new ArrayList<>(1); selection.add(elementToSelect); page.setSelection(selection, true); } } }
public void setElementToReveal(IClasspathEntry entry, String attributeKey) { int pageIndex= getPageIndex(entry.getEntryKind()); if (fTabFolder == null) { fPageIndex= pageIndex; } else { fTabFolder.setSelection(pageIndex); CPListElement element= findElement(entry); if (element != null) { Object elementToSelect= element; if (attributeKey != null) { Object attrib= element.findAttributeElement(attributeKey); if (attrib != null) { elementToSelect= attrib; } } BuildPathBasePage page= (BuildPathBasePage) fTabFolder.getItem(pageIndex).getData(); List selection= new ArrayList(1); selection.add(elementToSelect); page.setSelection(selection, true); } } }
public void setElementToReveal(IClasspathEntry entry, String attributeKey) { int pageIndex= getPageIndex(entry.getEntryKind()); if (fTabFolder == null) { fPageIndex= pageIndex; } else { fTabFolder.setSelection(pageIndex); CPListElement element= findElement(entry); if (element != null) { Object elementToSelect= element; if (attributeKey != null) { Object attrib= element.findAttributeElement(attributeKey); if (attrib != null) { elementToSelect= attrib; } } BuildPathBasePage page= (BuildPathBasePage) fTabFolder.getItem(pageIndex).getData(); List<Object> selection= new ArrayList<>(1); selection.add(elementToSelect); page.setSelection(selection, true); } } }
@Override void editEntry(ListDialogField<ModuleAddReads> field, ModuleAddReads reads) { ModuleAddReadsDialog dialog= new ModuleAddReadsDialog(getShell(), fJavaElements, reads); if (dialog.open() == Window.OK) { ModuleAddReads newReads= dialog.getReads(fCurrCPElement.findAttributeElement(CPListElement.MODULE)); if (newReads != null) { field.replaceElement(reads, newReads); } else { field.removeElement(reads); } } } }
@Override void addEntry(ListDialogField<ModuleAddExport> field) { ModuleAddExport initialValue= new ModuleAddExport(getSourceModuleName(), NO_NAME, getCurrentModuleName(), null); ModuleAddExportsDialog dialog= new ModuleAddExportsDialog(getShell(), fJavaElements, initialValue); if (dialog.open() == Window.OK) { ModuleAddExport export= dialog.getExport(fCurrCPElement.findAttributeElement(CPListElement.MODULE)); if (export != null) field.addElement(export); } }
@Override void addEntry(ListDialogField<ModuleAddReads> field) { ModuleAddReads initialValue= new ModuleAddReads(getSourceModuleName(), NO_NAME, null); ModuleAddReadsDialog dialog= new ModuleAddReadsDialog(getShell(), fJavaElements, initialValue); if (dialog.open() == Window.OK) { ModuleAddReads reads= dialog.getReads(fCurrCPElement.findAttributeElement(CPListElement.MODULE)); if (reads != null) field.addElement(reads); } }
@Override void editEntry(ListDialogField<ModuleAddExport> field, ModuleAddExport export) { ModuleAddExportsDialog dialog= new ModuleAddExportsDialog(getShell(), fJavaElements, export); if (dialog.open() == Window.OK) { ModuleAddExport newExport= dialog.getExport(fCurrCPElement.findAttributeElement(CPListElement.MODULE)); if (newExport != null) { field.replaceElement(export, newExport); } else { field.removeElement(export); } } } }
public void setAttributesFromExisting(CPListElement existing) { Assert.isTrue(existing.getEntryKind() == getEntryKind()); CPListElementAttribute[] attributes= existing.getAllAttributes(); for (int i= 0; i < attributes.length; i++) { CPListElementAttribute curr= attributes[i]; CPListElementAttribute elem= findAttributeElement(curr.getKey()); if (elem == null) { createAttributeElement(curr.getKey(), curr.getValue(), false); } else { elem.setValue(curr.getValue()); } } }
public void setAttributesFromExisting(CPListElement existing) { Assert.isTrue(existing.getEntryKind() == getEntryKind()); CPListElementAttribute[] attributes= existing.getAllAttributes(); for (int i= 0; i < attributes.length; i++) { CPListElementAttribute curr= attributes[i]; CPListElementAttribute elem= findAttributeElement(curr.getKey()); if (elem == null) { createAttributeElement(curr.getKey(), curr.getValue(), false); } else { elem.setValue(curr.getValue()); } } }
public void setAttributesFromExisting(CPListElement existing) { Assert.isTrue(existing.getEntryKind() == getEntryKind()); CPListElementAttribute[] attributes= existing.getAllAttributes(); for (int i= 0; i < attributes.length; i++) { CPListElementAttribute curr= attributes[i]; CPListElementAttribute elem= findAttributeElement(curr.getKey()); if (elem == null) { createAttributeElement(curr.getKey(), curr.getValue(), curr.isBuiltIn()); } else { elem.setValue(curr.getValue()); } } }
if (changeNodeDirection != RootNodeChange.NoChange) { moveCPElementAcrossNode(fLibrariesList, curr, changeNodeDirection); CPListElementAttribute moduleAttr= curr.findAttributeElement(CPListElement.MODULE); Object value= (changeNodeDirection == RootNodeChange.ToModulepath) ? new ModuleEncapsulationDetail[0] : null; if (moduleAttr != null) {
for (int i= 0; i < extraAttributes.length; i++) { IClasspathAttribute attrib= extraAttributes[i]; CPListElementAttribute attribElem= elem.findAttributeElement(attrib.getName()); if (attribElem == null) { elem.createAttributeElement(attrib.getName(), attrib.getValue(), false);