Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Calling project.delete() in case of error occuring during project creation

Hi all,

We have customized the project creation wizard for our development

To achieve this we have added a new Wizard Page to New C++ Project Wizard
using extension point org.eclipse.cdt.managedbuilder.ui.newWizardPages

While declaring this extension point in plugin.xml we have also provided
value for the attribute operationClass with name NewProjectWizardOperation

The class NewProjectWizardOperation implements IRunnableWithProgress.

The logic related to our requirements for project creation is written in
the run() method.

However we noticed that even if there is some failure in the logic related
to our requirements then also a the project gets created in the workspace
and is shown in the Package Explorer which we felt is confusing for the
user as that project cannot be actually used by him because of the failure
in our logic.

We are throwing the exception and catching them inside run() method
whenever there is failure in our logic.

Now I wanted to know whether it is OK to call project.delete() method
inside this catch() block inside run() method. SO, that if there is any
failure in our logic and exception is thrown then we delete that bad
project created in workspace and Package Explorer and so it doesn't confuse
the user.

However since there are lot many steps happening during delete() of the
project and also in case of project creation so we wanted to know whether
it is safe to call project.delete() like this from inside the code
implemented by client. Or it might have some internal issues inside CDT
project creation wizard.

Thanks & Regards,
Nayna Jain

Back to the top