Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Clearing SuperInterfacesList in NewTypeWizardPage subclass
Clearing SuperInterfacesList in NewTypeWizardPage subclass [message #241096] Mon, 26 February 2007 01:01
Eclipse UserFriend
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?
Previous Topic:How to add FieldDeclarations to a Type?
Next Topic:plugin wanted: cvs diff'ing with external tool
Goto Forum:
  


Current Time: Sun Jun 08 07:02:46 EDT 2025

Powered by FUDForum. Page generated in 0.02254 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top