Clearing SuperInterfacesList in NewTypeWizardPage subclass [message #241096] |
Mon, 26 February 2007 01:01 |
Eclipse User |
|
|
|
Hi,
I am trying to build a JDT plugin extension. I have extended the
NewTypeWizardPage to add some custom code to the newly created class. My
requirement is to add a superinterface with the same name as typename
(class name) prepended with a "I". I am trying to update the
superinterfaces in the updateStatus method. The problem is I am unable to
clear the superinterface list when the type name changes. Please look at
the code below:
private void doStatusUpdate() {
// define the components for which a status is desired
IStatus[] status= new IStatus[] {
fContainerStatus,
isEnclosingTypeSelected() ? fEnclosingTypeStatus :
fPackageStatus,
fTypeNameStatus,
};
updateStatus(status);
//prepend "I" with Type Name
strInterfaceName = "I" +getTypeName();
if(fTypeNameStatus.isOK()) {
if(getSuperInterfaces().size() == 0) {
addSuperInterface(strInterfaceName);
}
else {
//clear superInterfacesList
getSuperInterfaces().clear();
addSuperInterface(strInterfaceName);
}
}
}
The list is not getting cleared each time the typename field changes. Is
there a way to update the 1st element of the superInterfaceList?
|
|
|
Powered by
FUDForum. Page generated in 0.02254 seconds