return component;
}
public boolean isNodeDeletable(Node node) {
if (node != null && node.getImpl() instanceof Resource) {
Resource r = (Resource)node.getImpl();
if (r.isUser()) {
Alert.warn(Messages.getString("ResourceView.YouCannotDeleteTheResource") + r.getName() + Messages.getString("ResourceView.UsersCanOnlyBeRemoved")); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
if (r.isAssignedToSomeProject()) {
Alert.warn(Messages.getString("ResourceView.YouCannotDeleteTheResource") + r.getName() + Messages.getString("ResourceView.ThisResourceCurrentlyHasAssignments")); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
List children=node.getChildren();
if (children!=null)
for (Iterator i=children.listIterator();i.hasNext();){
Node child=(Node)i.next();
if (!isNodeDeletable(child)) return false;
}
}
return true;
}
public boolean isNodeCuttable(Node node) {
if (node != null && node.getImpl() instanceof Resource) {
Resource r = (Resource)node.getImpl();
if (r.isUser()) {
Alert.warn(Messages.getString("ResourceView.YouCannotDeleteTheResource") + r.getName() + Messages.getString("ResourceView.UsersCanOnlyBeRemoved")+ "\n" + Messages.getString("ResourceView.ToMoveAProtectedResource")); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
if (r.isAssignedToSomeProject()) {
Alert.warn(Messages.getString("ResourceView.YouCannotDeleteTheResource") + r.getName() + Messages.getString("ResourceView.ThisResourceCurrentlyHasAssignments")+ "\n" + Messages.getString("ResourceView.ToMoveAProtectedResource")); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
List children=node.getChildren();
if (children!=null)
for (Iterator i=children.listIterator();i.hasNext();){