public CPListElementAttribute findAttributeElement(String key) { for (int i= 0; i < fChildren.size(); i++) { Object curr= fChildren.get(i); if (curr instanceof CPListElementAttribute) { CPListElementAttribute elem= (CPListElementAttribute) curr; if (key.equals(elem.getKey())) { return elem; } } } return null; }
public CPListElementAttribute findAttributeElement(String key) { for (int i= 0; i < fChildren.size(); i++) { Object curr= fChildren.get(i); if (curr instanceof CPListElementAttribute) { CPListElementAttribute elem= (CPListElementAttribute) curr; if (key.equals(elem.getKey())) { return elem; } } } return null; }
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); }
protected boolean canEditCustomAttribute(CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { return config.canEdit(elem.getClasspathAttributeAccess()); } return false; }
protected boolean canRemoveCustomAttribute(CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { return config.canRemove(elem.getClasspathAttributeAccess()); } return false; }
protected boolean canEditCustomAttribute(CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { return config.canEdit(elem.getClasspathAttributeAccess()); } return false; }
protected boolean canRemoveCustomAttribute(CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { return config.canRemove(elem.getClasspathAttributeAccess()); } return false; }
private void editAttributeEntry(CPListElementAttribute elem) { String key= elem.getKey(); if (key.equals(CPListElement.ACCESSRULES)) { showAccessRestrictionDialog(elem.getParent()); } else { if (editCustomAttribute(getShell(), elem)) { fProjectsList.refresh(); fClassPathList.dialogFieldChanged(); // validate } } }
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()); } } }
private void editAttributeEntry(CPListElementAttribute elem) { String key= elem.getKey(); if (key.equals(CPListElement.ACCESSRULES)) { showAccessRestrictionDialog(elem.getParent()); } else { if (editCustomAttribute(getShell(), elem)) { fProjectsList.refresh(); fClassPathList.dialogFieldChanged(); // validate } } }
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()); } } }
protected boolean editCustomAttribute(Shell shell, CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { IClasspathAttribute result= config.performEdit(shell, elem.getClasspathAttributeAccess()); if (result != null) { elem.setValue(result.getValue()); return true; } } return false; }
protected boolean editCustomAttribute(Shell shell, CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { IClasspathAttribute result= config.performEdit(shell, elem.getClasspathAttributeAccess()); if (result != null) { elem.setValue(result.getValue()); return true; } } return false; }
protected boolean removeCustomAttribute(CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { IClasspathAttribute result= config.performRemove(elem.getClasspathAttributeAccess()); if (result != null) { elem.setValue(result.getValue()); return true; } } return false; }
protected boolean removeCustomAttribute(CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { IClasspathAttribute result= config.performRemove(elem.getClasspathAttributeAccess()); if (result != null) { elem.setValue(result.getValue()); return true; } } return false; }
protected boolean editCustomAttribute(Shell shell, CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { IClasspathAttribute result= config.performEdit(shell, elem.getClasspathAttributeAccess()); if (result != null) { elem.setValue(result.getValue()); return true; } } return false; }
protected boolean removeCustomAttribute(CPListElementAttribute elem) { ClasspathAttributeConfiguration config= fAttributeDescriptors.get(elem.getKey()); if (config != null) { IClasspathAttribute result= config.performRemove(elem.getClasspathAttributeAccess()); if (result != null) { elem.setValue(result.getValue()); return true; } } return false; }