Remove,Delete, Update Action [message #896877] |
Fri, 20 July 2012 05:07  |
Eclipse User |
|
|
|
Hello,
the remove,delete, update action don't evalute the isAvaible from the feature.Is this a bug?
So are the action always available and broken the api
RemoveAction:
public boolean isAvailable() {
PictogramElement pe[] = getSelectedPictogramElements();
for (int i = 0; i < pe.length; i++) {
IRemoveContext context = new RemoveContext(pe[i]);
IRemoveFeature removeFeature = getFeatureProvider().getRemoveFeature(context);
if (removeFeature == null) {
return false;
}
}
return true;
}
Suggestion
public boolean isAvailable() {
PictogramElement pe[] = getSelectedPictogramElements();
for (int i = 0; i < pe.length; i++) {
IRemoveContext context = new RemoveContext(pe[i]);
IRemoveFeature removeFeature = getFeatureProvider().getRemoveFeature(context);
if (removeFeature == null || !removeFeature.isAvailable(removeFeature )) {
return false;
}
}
return true;
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06514 seconds