/** * Check whether the current selection is the project's * default output folder or not * * @param attrib the attribute to be checked * @return <code>true</code> if is the default output folder, * <code>false</code> otherwise. */ public static boolean isDefaultOutputFolder(CPListElementAttribute attrib) { return attrib.getValue() == null; }
/** * Check whether the current selection is the project's * default output folder or not * * @param attrib the attribute to be checked * @return <code>true</code> if is the default output folder, * <code>false</code> otherwise. */ public static boolean isDefaultOutputFolder(CPListElementAttribute attrib) { return attrib.getValue() == null; }
/** * Check whether the current selection is the project's * default output folder or not * * @param attrib the attribute to be checked * @return <code>true</code> if is the default output folder, * <code>false</code> otherwise. */ public static boolean isDefaultOutputFolder(CPListElementAttribute attrib) { return attrib.getValue() == 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 Object getAttribute(String key) { CPListElementAttribute attrib= findAttributeElement(key); if (attrib != null) { return attrib.getValue(); } return null; }
private boolean canRemove(List selElements) { if (selElements.size() == 0) { return false; } for (int i= 0; i < selElements.size(); i++) { Object elem= selElements.get(i); if (elem instanceof CPListElementAttribute) { if (((CPListElementAttribute)elem).getValue() == null) { return false; } } else if (elem instanceof CPListElement) { CPListElement curr= (CPListElement) elem; if (curr.getParentContainer() != null) { return false; } } } return true; }
private IClasspathAttribute[] getClasspathAttributes() { ArrayList res= new ArrayList(); for (int i= 0; i < fChildren.size(); i++) { Object curr= fChildren.get(i); if (curr instanceof CPListElementAttribute) { CPListElementAttribute elem= (CPListElementAttribute) curr; if (!elem.isBuiltIn() && elem.getValue() != null) { res.add(elem.getClasspathAttribute()); } } } return (IClasspathAttribute[]) res.toArray(new IClasspathAttribute[res.size()]); }
private IClasspathAttribute[] getClasspathAttributes() { ArrayList<IClasspathAttribute> res= new ArrayList<>(); for (int i= 0; i < fChildren.size(); i++) { Object curr= fChildren.get(i); if (curr instanceof CPListElementAttribute) { CPListElementAttribute elem= (CPListElementAttribute) curr; if (!elem.isBuiltIn() && elem.getValue() != null) { res.add(elem.getClasspathAttribute()); } } } return res.toArray(new IClasspathAttribute[res.size()]); }
private boolean canRemove(List selElements) { if (selElements.size() == 0) { return false; } for (int i= 0; i < selElements.size(); i++) { Object elem= selElements.get(i); if (elem instanceof CPListElementAttribute) { if (((CPListElementAttribute)elem).getValue() == null) { return false; } } else if (elem instanceof CPListElement) { CPListElement curr= (CPListElement) elem; if (curr.getParentContainer() != null) { return false; } } } return true; }
public Object[] getChildren(TreeListDialogField field, Object element) { if (element instanceof CPListElement) { return ((CPListElement) element).getChildren(false); } else if (element instanceof CPListElementAttribute) { CPListElementAttribute attribute= (CPListElementAttribute) element; if (CPListElement.ACCESSRULES.equals(attribute.getKey())) { return (IAccessRule[]) attribute.getValue(); } } return EMPTY_ARR; }
@Override public Object[] getChildren(TreeListDialogField<CPListElement> field, Object element) { if (element instanceof CPListElement) { return ((CPListElement) element).getChildren(false); } else if (element instanceof CPListElementAttribute) { CPListElementAttribute attribute= (CPListElementAttribute) element; if (CPListElement.MODULE.equals(attribute.getKey())) { return (ModuleEncapsulationDetail[]) attribute.getValue(); } } return EMPTY_ARR; }
@Override public Object[] getChildren(TreeListDialogField<CPListElement> field, Object element) { if (element instanceof CPListElement) { return ((CPListElement) element).getChildren(false); } else if (element instanceof CPListElementAttribute) { CPListElementAttribute attribute= (CPListElementAttribute) element; if (CPListElement.ACCESSRULES.equals(attribute.getKey())) { return (IAccessRule[]) attribute.getValue(); } } return EMPTY_ARR; }
@Override public Object[] getChildren(TreeListDialogField<CPListElement> field, Object element) { if (element instanceof CPListElementAttribute) { CPListElementAttribute attribute= (CPListElementAttribute) element; if (CPListElement.ACCESSRULES.equals(attribute.getKey())) { return (IAccessRule[]) attribute.getValue(); } } return super.getChildren(field, element); }
@Override public Object[] getChildren(TreeListDialogField<CPUserLibraryElement> field, Object element) { if (element instanceof CPUserLibraryElement) { CPUserLibraryElement elem= (CPUserLibraryElement) element; return elem.getChildren(); } else if (element instanceof CPListElement) { return ((CPListElement)element).getChildren(false); } else if (element instanceof CPListElementAttribute) { CPListElementAttribute attribute= (CPListElementAttribute) element; if (CPListElement.ACCESSRULES.equals(attribute.getKey())) { return (IAccessRule[]) attribute.getValue(); } } return EMPTY; }
public Object[] getChildren(TreeListDialogField field, Object element) { if (element instanceof CPUserLibraryElement) { CPUserLibraryElement elem= (CPUserLibraryElement) element; return elem.getChildren(); } else if (element instanceof CPListElement) { return ((CPListElement)element).getChildren(false); } else if (element instanceof CPListElementAttribute) { CPListElementAttribute attribute= (CPListElementAttribute) element; if (CPListElement.ACCESSRULES.equals(attribute.getKey())) { return (IAccessRule[]) attribute.getValue(); } } return EMPTY; }
protected void removeEncapsulationDetail(ModuleEncapsulationDetail detail) { CPListElementAttribute parent= detail.getParent(); if (parent != null) { Object value= parent.getValue(); if (value instanceof ModuleEncapsulationDetail[]) { ModuleEncapsulationDetail[] existingDetails= (ModuleEncapsulationDetail[]) value; int count= 0; for (int j= 0; j < existingDetails.length; j++) { ModuleEncapsulationDetail aDetail= existingDetails[j]; if (aDetail != detail) existingDetails[count++]= aDetail; } if (count < existingDetails.length) { ModuleEncapsulationDetail[] newDetails= new ModuleEncapsulationDetail[count]; System.arraycopy(existingDetails, 0, newDetails, 0, count); parent.setValue(newDetails); parent.getParent().attributeChanged(CPListElement.MODULE); } } } }
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()); } } }