[Esbox-commits] r191 - in trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui: . wizards

carolina at garage.maemo.org carolina at garage.maemo.org
Sat Oct 27 00:54:34 EEST 2007


Author: carolina
Date: 2007-10-27 00:54:33 +0300 (Sat, 27 Oct 2007)
New Revision: 191

Modified:
   trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/ESboxPythonProjectNature.java
   trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/PythonUIActivator.java
   trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonCommonProjectWizard.java
   trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonConfigWizardPage.java
   trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonMainWizardPage.java
   trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/PythonProjectWizard.java
Log:
Fixing some details on Python Wizard

Modified: trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/ESboxPythonProjectNature.java
===================================================================
--- trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/ESboxPythonProjectNature.java	2007-10-26 20:20:17 UTC (rev 190)
+++ trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/ESboxPythonProjectNature.java	2007-10-26 21:54:33 UTC (rev 191)
@@ -1,4 +1,3 @@
-package org.indt.esbox.python.ui;
 /*******************************************************************************
  * Copyright (c) 2007 INdT.
  * All rights reserved. This program and the accompanying materials
@@ -8,11 +7,11 @@
  *
  * Contributors:
  *    Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
- *    Paulo Romulo (paulo at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
- *    Carolina Nogueira (carolina at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (carolina at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
  *******************************************************************************/
-import java.io.File;
 
+package org.indt.esbox.python.ui;
+
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectDescription;
 import org.eclipse.core.resources.IProjectNature;
@@ -31,7 +30,7 @@
 	 * id of ESbox Python Project
 	 * org.indt.esbox.core.esboxPythonNature
 	 */
-	public static final String ESBOX_PYTHON_NATURE_ID = CoreActivator.getUniqueIdentifier() + ".esboxPythonNature";
+	public static final String ESBOX_PYTHON_NATURE_ID = PythonUIActivator.getUniqueIdentifier() + ".esboxNature";
 	
    /**
      * constant that stores the name of the python version we are using for the project with this nature
@@ -65,7 +64,7 @@
 	 * @throws CoreException if something goes wrong.
 	 */
 	public static void addESboxPythonNature(final IProject project, final IProgressMonitor monitor) throws CoreException {
-		ESboxPythonProjectNature.getDefault().addNature(project, ESBOX_PYTHON_NATURE_ID, monitor);		
+		addNature(project, ESBOX_PYTHON_NATURE_ID, monitor);		
 	}
 
 	/** 
@@ -87,7 +86,7 @@
 	 * @param monitor a progress monitor to indicate the duration of the operation,
 	 * or <code>null</code> if progress reporting is not required. 
 	 */
-	public void addNature(IProject project, String natureId,
+	private static void addNature(IProject project, String natureId,
 			IProgressMonitor monitor) throws CoreException {
 		IProjectDescription description = project.getDescription();
 		if (description.hasNature(natureId))
@@ -112,7 +111,7 @@
 	 *            a progress monitor to indicate the duration of the operation,
 	 *            or <code>null</code> if progress reporting is not required.
 	 */
-	public void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
+	private void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
 		IProjectDescription description = project.getDescription();
 		if (!description.hasNature(natureId))
 			return;

Modified: trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/PythonUIActivator.java
===================================================================
--- trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/PythonUIActivator.java	2007-10-26 20:20:17 UTC (rev 190)
+++ trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/PythonUIActivator.java	2007-10-26 21:54:33 UTC (rev 191)
@@ -58,6 +58,19 @@
 		plugin = null;
 		super.stop(context);
 	}
+	
+	/**
+	 * Convenience method which returns the unique identifier of this plugin.
+	 */
+	public static String getUniqueIdentifier() {
+		if (getDefault() == null) {
+			// If the default instance is not yet initialized,
+			// return a static identifier. This identifier must
+			// match the plugin id defined in plugin.xml
+			return PLUGIN_ID;
+		}
+		return getDefault().getBundle().getSymbolicName();
+	}
 
 	/**
 	 * Returns the shared instance

Modified: trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonCommonProjectWizard.java
===================================================================
--- trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonCommonProjectWizard.java	2007-10-26 20:20:17 UTC (rev 190)
+++ trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonCommonProjectWizard.java	2007-10-26 21:54:33 UTC (rev 191)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2007 INdT.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (carolina at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+
 package org.indt.esbox.python.ui.wizards;
 
 import java.lang.reflect.InvocationTargetException;
@@ -6,12 +18,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.eclipse.cdt.core.model.CModelException;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.IPathEntry;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
 import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
 import org.eclipse.cdt.managedbuilder.ui.wizards.CfgHolder;
 import org.eclipse.cdt.ui.CUIPlugin;
@@ -25,31 +31,22 @@
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IResourceStatus;
 import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
 import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
 import org.indt.esbox.core.CoreActivator;
 import org.indt.esbox.core.ESboxPreferenceConstants;
 import org.indt.esbox.core.ESboxProjectProperties;
@@ -61,19 +58,10 @@
 import org.indt.esbox.ui.UIActivator;
 import org.python.pydev.plugin.PydevPlugin;
 import org.python.pydev.plugin.nature.PythonNature;
-import org.python.pydev.ui.perspective.PythonPerspectiveFactory;
 
-public abstract class ESboxPythonCommonProjectWizard extends Wizard implements INewWizard {
+public abstract class ESboxPythonCommonProjectWizard extends BasicNewResourceWizard implements INewWizard {
 
-	 private IWorkbench workbench;
-	 protected IStructuredSelection selection;  
-	
-	private static final String PROPERTY = "org.eclipse.cdt.build.core.buildType"; //$NON-NLS-1$
-	private static final String PROP_VAL = PROPERTY + ".debug"; //$NON-NLS-1$
 	private static final String PREFIX= "CProjectWizard"; //$NON-NLS-1$
-	private static final String OP_ERROR= "CProjectWizard.op_error"; //$NON-NLS-1$
-	private static final String title= CUIPlugin.getResourceString(OP_ERROR + ".title"); //$NON-NLS-1$
-	private static final String message= CUIPlugin.getResourceString(OP_ERROR + ".message"); //$NON-NLS-1$
 	private static final String[] EMPTY_ARR = new String[0]; 
 	
 	protected IConfigurationElement fConfigElement;
@@ -114,18 +102,9 @@
 		wz_desc = desc;
 	}
 	
+
 	/*
 	 * (non-Javadoc)
-	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
-	 */
-    public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
-        this.workbench = workbench;
-        this.selection = currentSelection;
-        initializeDefaultPageImageDescriptor();
-    }
-	
-	/*
-	 * (non-Javadoc)
 	 * @see org.eclipse.jface.wizard.Wizard#addPages()
 	 */
 	public void addPages() {
@@ -137,24 +116,6 @@
 		
 	}
 
-	/**
-	 * @return true if user has changed settings since project creation
-	 */
-	private boolean isChanged() {
-
-		if (!fMainPage.getProjectName().equals(lastProjectName))
-			return true;
-			
-		IPath projectLocation = fMainPage.getProjectLocation();
-		if (projectLocation == null) {
-			if (lastProjectLocation != null)
-				return true;
-		} else if (!projectLocation.equals(lastProjectLocation))
-			return true;
-		
-		return true; 
-	}
-	
     /**
      * Set Python logo to top bar
      */
@@ -178,21 +139,6 @@
 		lastProjectLocation = null;
 	}
 	
-	private boolean invokeRunnable(IRunnableWithProgress runnable) {
-		IRunnableWithProgress op= new WorkspaceModifyDelegatingOperation(runnable);
-		try {
-			getContainer().run(true, true, op);
-		} catch (InvocationTargetException e) {
-			CUIPlugin.errorDialog(getShell(), title, message, e.getTargetException(), false);
-			clearProject();
-			return false;
-		} catch  (InterruptedException e) {
-			clearProject();
-			return false;
-		}
-		return true;
-	}
-
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
@@ -202,61 +148,20 @@
 		// create project if it is not created yet
 //		if (getProject(fMainPage.isCurrent(), true) == null) 
 //			return false;
-//		try {
-		createNewProject();
-		// Switch to default perspective
-		IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-
 		try {
-			workbench.showPerspective(PythonPerspectiveFactory.PERSPECTIVE_ID, window);
-		} catch (WorkbenchException we) {
-			we.printStackTrace();
+			createNewProject();
+		} catch (Exception e) {
+			clearProject();
+			e.printStackTrace();
+			return false;
 		}
-			//setCreated();
-			
-//		} catch (Exception e) {
-//			// TODO log or display a message
-//			e.printStackTrace();
-//			return false;
-//		}
+		
 //		BasicNewProjectResourceWizard.updatePerspective(fConfigElement);
 //		selectAndReveal(newProject);
 		return true;
 	}
 	
-	protected boolean setCreated() throws CoreException {
-		setSourceFolder();
-		
-		ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();		
-		ICProjectDescription des = mngr.getProjectDescription(newProject, false);
-				
-		if (des != null) {
-			if(des.isCdtProjectCreating()){
-				des = mngr.getProjectDescription(newProject, true);
-				des.setCdtProjectCreated();
-				mngr.setProjectDescription(newProject, des, false, null);
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	private void setSourceFolder() throws CModelException {
-		ICProject cProject = CoreModel.getDefault().create(newProject);
-		IPath projPath = newProject.getFullPath();
-		String targetPath = "src";
-		
-		IPathEntry[] entries = cProject.getRawPathEntries();
-		List/*<IPathEntry>*/ newEntries = new ArrayList/*<IPathEntry>*/(entries.length + 1);
 
-		int projectEntryIndex= -1;
-		IPath path = projPath.append(targetPath);
-
-		newEntries.add(CoreModel.newSourceEntry(path));
-
-		cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new IPathEntry[newEntries.size()]), new NullProgressMonitor());
-	}
-	
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.jface.wizard.Wizard#performCancel()
@@ -269,57 +174,6 @@
 	public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
 		fConfigElement= config;
 	}
-
-	private IRunnableWithProgress getRunnable(boolean _defaults, final boolean onFinish) {
-		final boolean defaults = _defaults;
-		return new IRunnableWithProgress() {
-			public void run(IProgressMonitor imonitor) throws InvocationTargetException, InterruptedException {
-				getShell().getDisplay().syncExec(new Runnable() {
-					public void run() { 
-						try {
-							newProject = createIProject(lastProjectName, lastProjectLocation);
-						    if (newProject != null)
-							  setProject(newProject, new NullProgressMonitor());							  
-						} catch (CoreException e) {	e.printStackTrace(); CUIPlugin.getDefault().log(e); }
-					}
-				});
-			}
-		};
-	}
-
-	/**
-	 * 
-	 */	
-	public IProject createIProject(final String name, final IPath location) throws CoreException{
-		if (newProject != null)	return newProject;
-
-		IWorkspace workspace = ResourcesPlugin.getWorkspace();
-		IWorkspaceRoot root = workspace.getRoot();
-		final IProject newProjectHandle = root.getProject(name);
-		
-		if (!newProjectHandle.exists()) {
-			IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
-			if(location != null) {
-				description.setLocation(location);			
-			}
-			newProject = createNewProject();
-		} else {
-			IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
-				public void run(IProgressMonitor monitor) throws CoreException {
-					newProjectHandle.refreshLocal(IResource.DEPTH_INFINITE, monitor);
-				}
-			};
-			NullProgressMonitor monitor = new NullProgressMonitor();
-			workspace.run(runnable, root, IWorkspace.AVOID_UPDATE, monitor);
-			newProject = newProjectHandle;
-		}
-        
-		// Open the project if we have to
-		if (!newProject.isOpen()) {
-			newProject.open(new NullProgressMonitor());
-		}
-		return continueCreation(newProject);	
-	}
 	
     /**
      * Creates a project resource given the project handle and description.
@@ -348,12 +202,12 @@
             //also, after creating the project, create a default source folder and add it to the pythonpath.
             if(fMainPage.shouldCreatSourceFolder()){
                 IFolder folder = projectHandle.getFolder("src");
-                folder.create(true, true, monitor);
-            
+                folder.create(true, true, monitor);            
                 projectPythonpath = folder.getFullPath().toString();
             }            
             //we should rebuild the path even if there's no source-folder (this way we will re-create the astmanager)
-            PythonNature.addNature(projectHandle, null, projectType, projectPythonpath);            
+            PythonNature.addNature(projectHandle, null, projectType, projectPythonpath);
+            ESboxPythonProjectNature.addESboxPythonNature(projectHandle, monitor);
         } finally {
             monitor.done();
         }
@@ -369,11 +223,11 @@
         final IProject newProjectHandle = fMainPage.getProjectHandle();
                 
         // get a project descriptor
-        IPath newPath = Platform.getLocation();
-//        IPath newPath = fMainPage.getLocationPath();
-//        if (defaultPath.equals(newPath)){
-//            newPath = null;
-//        }
+        IPath defaultPath = Platform.getLocation();
+        IPath newPath = fMainPage.getProjectLocation();
+        if (defaultPath.equals(newPath)){
+            newPath = null;
+        }
         
         IWorkspace workspace = ResourcesPlugin.getWorkspace();
         final IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
@@ -397,27 +251,28 @@
             Throwable t = e.getTargetException();
             if (t instanceof CoreException) {
                 if (((CoreException) t).getStatus().getCode() == IResourceStatus.CASE_VARIANT_EXISTS) {
-                    MessageDialog.openError(getShell(), "IDEWorkbenchMessages.CreateProjectWizard_errorTitle", "IDEWorkbenchMessages.CreateProjectWizard_caseVariantExistsError");
+//                  MessageDialog.openError(getShell(), "IDEWorkbenchMessages.CreateProjectWizard_errorTitle1", "IDEWorkbenchMessages.CreateProjectWizard_caseVariantExistsError");
+                	e.printStackTrace();
                 } else {
-                    ErrorDialog.openError(getShell(), "IDEWorkbenchMessages.CreateProjectWizard_errorTitle", null, ((CoreException) t).getStatus());
+                	e.printStackTrace();
+//                    ErrorDialog.openError(getShell(), "IDEWorkbenchMessages.CreateProjectWizard_errorTitle2", null, ((CoreException) t).getStatus());
                 }
             } else {
                 // Unexpected runtime exceptions and errors may still occur.
                 PydevPlugin.log(IStatus.ERROR, t.toString(), t);
-                MessageDialog.openError(getShell(), "IDEWorkbenchMessages.CreateProjectWizard_errorTitle", t.getMessage());
+//                MessageDialog.openError(getShell(), "IDEWorkbenchMessages.CreateProjectWizard_errorTitle3", t.getMessage());
             }
             return null;
         }
         
-        newProject = newProjectHandle;
+        newProject = newProjectHandle; 
         
         return newProjectHandle;
     }
 	
-	protected abstract IProject continueCreation(IProject prj); 
-	public abstract String[] getNatures();
 	
-	
+	public abstract String[] getNatures();
+		
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.jface.wizard.Wizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
@@ -502,8 +357,9 @@
 				String message = "There is no suitable Scratchbox target for your project settings. " +
 						"Do you wish to create it?";
 				boolean canCreateTarget = MessageDialog.openQuestion(getShell(), title, message);
-				if (canCreateTarget)
-					createScratchboxTarget();
+				if (canCreateTarget){
+				//	createScratchboxTarget();
+				}
 			}
 		} catch (ScratchboxException e) {
 			ErrorLogger errorLogger = UIActivator.getDefault().getErrorLogger();
@@ -512,10 +368,6 @@
 		}
 	}
 	
-	private void createScratchboxTarget() {
-		
-	}
-	
 	private void configureTemplate() {
 		Template template = getInitializedTemplate(getMainPageData());
 		if(template == null)

Modified: trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonConfigWizardPage.java
===================================================================
--- trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonConfigWizardPage.java	2007-10-26 20:20:17 UTC (rev 190)
+++ trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonConfigWizardPage.java	2007-10-26 21:54:33 UTC (rev 191)
@@ -46,7 +46,7 @@
 	public static final String PAGE_ID = "org.indt.esbox.ui.wizard.ConfigWizardPage"; //$NON-NLS-1$
 	private static final String TITLE = UIMessages.getString("CConfigWizardPage.0"); //$NON-NLS-1$
 	private static final String MESSAGE = UIMessages.getString("CConfigWizardPage.1"); //$NON-NLS-1$
-	private static final String COMMENT = UIMessages.getString("CConfigWizardPage.12"); //$NON-NLS-1$
+	
 	private static final String EMPTY_STR = "";  //$NON-NLS-1$
 	
 	private Table table;
@@ -113,25 +113,6 @@
 		Composite c = new Composite(parent, SWT.NONE);
 		c.setLayoutData(new GridData(GridData.FILL_VERTICAL));
 		c.setLayout(new GridLayout(1, false));
-
-		// dummy placeholder
-		new Label(c, 0).setLayoutData(new GridData(GridData.FILL_BOTH));
-		
-		Button b3 = new Button(c, SWT.PUSH);
-		b3.setText(UIMessages.getString("CConfigWizardPage.13")); //$NON-NLS-1$
-		b3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		b3.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-			//	advancedDialog();
-			}});
-		
-		Group gr = new Group(parent, SWT.NONE);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.horizontalSpan = 3;
-		gr.setLayoutData(gd);
-		gr.setLayout(new FillLayout());
-		Label lb = new Label(gr, SWT.NONE);
-		lb.setText(COMMENT);
 	}
 	
 

Modified: trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonMainWizardPage.java
===================================================================
--- trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonMainWizardPage.java	2007-10-26 20:20:17 UTC (rev 190)
+++ trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/ESboxPythonMainWizardPage.java	2007-10-26 21:54:33 UTC (rev 191)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2007 INdT.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (carolina at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *******************************************************************************/
+
 package org.indt.esbox.python.ui.wizards;
 
 import java.io.File;
@@ -72,12 +84,14 @@
     private Button checkSrcFolder;  
     private boolean checkSrcFolderSelected = true;
     
-	// initial value stores
-	private String initialProjectFieldValue;
 
 	private ESboxConfigHandler esboxHandler;
 	private ESboxProjectContentsArea locationArea;   
-
+    
+    // initial value stores
+    private String initialProjectFieldValue;
+    
+	
 	/**
 	 * Creates a new project creation wizard page.
 	 *
@@ -87,7 +101,7 @@
 		super(pageName);
 		setPageComplete(false);        
 		setImageDescriptor(UIActivator.getImageDescriptor("./icons/new_maemo_prj_wiz.gif"));
-		esboxHandler = new ESboxConfigHandler();
+    	esboxHandler = new ESboxConfigHandler();
 	}
 	  /** (non-Javadoc)
      * Method declared on IDialogPage.
@@ -108,12 +122,14 @@
 			locationArea.updateProjectName(initialProjectFieldValue);
 		}
         
+
 		// Scale the button based on the rest of the dialog
 		setButtonLayoutData(locationArea.getBrowseButton());
 		
 		createDynamicGroup(composite); 
 		
 		setPageComplete(validatePage());
+        
         // Show description on opening
         setErrorMessage(null);
         setMessage(null);
@@ -547,21 +563,12 @@
 		return isCurrentPage(); 
 	}
 	
-	private static Image calcImage(EntryDescriptor ed) {
-		if (ed.getImage() != null) return ed.getImage();
-		if (ed.isCategory()) return IMG_CATEGORY;
-		return IMG_ITEM;
-	}
-	
 	public ESboxConfigHandler getHandler() {
 		return esboxHandler; 
 	}
 	
 	@Override
 	public IWizardPage getNextPage() {
-		// TODO Auto-generated method stub
 		return super.getNextPage();
-	}
-	
-	
+	}	
 }

Modified: trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/PythonProjectWizard.java
===================================================================
--- trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/PythonProjectWizard.java	2007-10-26 20:20:17 UTC (rev 190)
+++ trunk/org.indt.esbox.python.ui/src/org/indt/esbox/python/ui/wizards/PythonProjectWizard.java	2007-10-26 21:54:33 UTC (rev 191)
@@ -1,5 +1,3 @@
-package org.indt.esbox.python.ui.wizards;
-
 /*******************************************************************************
  * Copyright (c) 2007 INdT.
  * All rights reserved. This program and the accompanying materials
@@ -9,14 +7,13 @@
  *
  * Contributors:
  *    Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (carolina at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
  *******************************************************************************/
-import javax.management.monitor.Monitor;
 
-import org.eclipse.cdt.core.CProjectNature;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.indt.esbox.core.ESboxProjectNature;
+package org.indt.esbox.python.ui.wizards;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbench;
 import org.indt.esbox.python.ui.ESboxPythonProjectNature;
 import org.python.pydev.plugin.nature.PythonNature;
 
@@ -45,18 +42,10 @@
 	public String[] getNatures() {
 		return new String[] { PythonNature.PYTHON_NATURE_ID , ESboxPythonProjectNature.ESBOX_PYTHON_NATURE_ID };
 	}
-	
-	/*
-	 * (non-Javadoc)
-	 * @see org.indt.esbox.ui.wizards.ESboxCommonProjectWizard#continueCreation(org.eclipse.core.resources.IProject)
-	 */
-	protected IProject continueCreation(IProject prj) {
-		try {			
-			ESboxPythonProjectNature.addESboxPythonNature(prj, new NullProgressMonitor());
-			
-		} catch (CoreException e) {
-			
-		}
-		return prj;
+
+	public void init(IWorkbench workbench, IStructuredSelection selection) {
+		// TODO Auto-generated method stub
+		
 	}
+
 }



More information about the Esbox-commits mailing list