public boolean performFinish() { if (!isRepoValid()) return false; boolean res = super.performFinish(); if (res) { final IJavaElement newElement = getCreatedElement(); IWorkingSet[] workingSets = fFirstPage.getWorkingSets(); if (workingSets.length > 0) { PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(newElement, workingSets); } BasicNewProjectResourceWizard.updatePerspective(fConfigElement); selectAndReveal(fSecondPage.getJavaProject().getProject()); Display.getDefault() .asyncExec( new Runnable() { public void run() { IWorkbenchPart activePart = getActivePart(); if (activePart instanceof IPackagesViewPart) { (new ShowInPackageViewAction(activePart.getSite())).run(newElement); } } }); new CeylonNature().addToProject(getCreatedElement().getProject()); } if (!useEmbeddedRepo && repositoryPath != null && !repositoryPath.isEmpty()) { IEclipsePreferences node = new ProjectScope(getCreatedElement().getProject()).getNode(CeylonPlugin.PLUGIN_ID); node.put("repo", repositoryPath); try { node.flush(); } catch (BackingStoreException e) { e.printStackTrace(); } /*getCreatedElement().getProject() .setPersistentProperty(new QualifiedName(CeylonPlugin.PLUGIN_ID, "repo"), repositoryPath);*/ ExportModuleWizard.persistDefaultRepositoryPath(repositoryPath); } /*IEclipsePreferences node = new ProjectScope(getCreatedElement().getProject()) .getNode(JavaCore.PLUGIN_ID); node.put(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, "*.launch, *.ceylon"); try { node.flush(); } catch (BackingStoreException e) { e.printStackTrace(); }*/ return res; }
public void addPages() { if (fFirstPage == null) fFirstPage = new NewJavaProjectWizardPageOne() { private GridLayout initGridLayout(GridLayout layout, boolean margins) { layout.horizontalSpacing = convertHorizontalDLUsToPixels(HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(VERTICAL_SPACING); if (margins) { layout.marginWidth = convertHorizontalDLUsToPixels(HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(VERTICAL_MARGIN); } else { layout.marginWidth = 0; layout.marginHeight = 0; } return layout; } public void createControl(Composite parent) { initializeDialogUnits(parent); final Composite composite = new Composite(parent, SWT.NULL); composite.setFont(parent.getFont()); composite.setLayout(initGridLayout(new GridLayout(1, false), true)); composite.setLayoutData(new GridData(HORIZONTAL_ALIGN_FILL)); // create UI elements Control nameControl = createNameControl(composite); nameControl.setLayoutData(new GridData(FILL_HORIZONTAL)); Control locationControl = createLocationControl(composite); locationControl.setLayoutData(new GridData(FILL_HORIZONTAL)); addSelectRepo(composite); Control jreControl = createJRESelectionControl(composite); jreControl.setLayoutData(new GridData(FILL_HORIZONTAL)); /*Control layoutControl= createProjectLayoutControl(composite); layoutControl.setLayoutData(new GridData(FILL_HORIZONTAL));*/ Control workingSetControl = createWorkingSetControl(composite); workingSetControl.setLayoutData(new GridData(FILL_HORIZONTAL)); Control infoControl = createInfoControl(composite); infoControl.setLayoutData(new GridData(FILL_HORIZONTAL)); setControl(composite); } @Override public IClasspathEntry[] getSourceClasspathEntries() { IClasspathEntry[] entries = super.getSourceClasspathEntries(); entries[0] = JavaCore.newSourceEntry( entries[0].getPath().removeLastSegments(1).append("source")); return entries; } }; fFirstPage.setTitle("New Ceylon Project"); fFirstPage.setDescription( "Create a Ceylon project in the workspace or in an external location."); addPage(fFirstPage); if (fSecondPage == null) fSecondPage = new NewJavaProjectWizardPageTwo(fFirstPage) { @Override public void init( IJavaProject jproject, IPath outputLocation, IClasspathEntry[] entries, boolean overrideExisting) { super.init( jproject, outputLocation.removeLastSegments(1).append("modules"), entries, overrideExisting); } }; fSecondPage.setTitle("Ceylon Project Settings"); fSecondPage.setDescription("Define the Ceylon build settings."); addPage(fSecondPage); fFirstPage.init(getSelection(), getActivePart()); }