@Override public void createControl(Composite parent) { super.createControl(parent); IStructuredSelection sel = ((BasicNewResourceWizard) getWizard()).getSelection(); if (sel != null) { tableViewer.setCheckedElements(sel.toArray()); setPageComplete(validatePage()); } }
@Override public void doRun(IProgressMonitor monitor, String projectID, String bsId) throws CoreException { monitor.beginTask(Messages.getString("ConvertToRemoteWizardPage.0"), 2); // $NON-NLS-1$ fServiceModelWidget.applyChangesToConfiguration(); super.doRun(new SubProgressMonitor(monitor, 1), projectID, bsId); try { ServiceModelManager.getInstance().saveModelConfiguration(); } catch (IOException e) { UIPlugin.log(e); } finally { monitor.done(); } }
@Override public void convertProject(IProject project, IProgressMonitor monitor, String projectID) throws CoreException { monitor.beginTask( MakeUIPlugin.getResourceString( "WizardMakeProjectConversion.monitor.convertingToMakeProject"), 3); //$NON-NLS-1$ try { if (ManagedBuilderCorePlugin.getDefault().isOldStyleMakeProject(project)) { ManagedBuilderCorePlugin.getDefault().convertOldStdMakeToNewStyle(project, monitor); } else { super.convertProject(project, new SubProgressMonitor(monitor, 1), projectID); if (isSetProjectType()) { h_selected.convertProject(project, monitor); } } } finally { monitor.done(); } }
@Override protected void addToMainPage(Composite container) { super.addToMainPage(container); Group optionsGroup = new Group(container, SWT.NONE); optionsGroup.setLayoutData(new GridData(GridData.FILL_BOTH)); optionsGroup.setLayout(new GridLayout(1, true)); optionsGroup.setText( MakeUIPlugin.getResourceString( "WizardMakeProjectConversion.projectOptions.title")); //$NON-NLS-1$ Composite c = new Composite(optionsGroup, SWT.NONE); c.setLayoutData(new GridData(GridData.FILL_BOTH)); c.setLayout(new GridLayout(2, true)); specifyProjectTypeButton = new Button(c, SWT.CHECK); specifyProjectTypeButton.setText( MakeUIPlugin.getResourceString( "WizardMakeProjectConversion.projectOptions.projectType")); //$NON-NLS-1$ GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; specifyProjectTypeButton.setLayoutData(gd); specifyProjectTypeButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { enableProjectTypeControls(specifyProjectTypeButton.getSelection()); } }); left_label = new Label(c, SWT.NONE); left_label.setText( MakeUIPlugin.getResourceString( "WizardMakeProjectConversion.projectOptions.projectTypeTable")); //$NON-NLS-1$ left_label.setFont(container.getFont()); left_label.setLayoutData(new GridData(GridData.BEGINNING)); right_label = new Label(c, SWT.NONE); right_label.setFont(container.getFont()); right_label.setLayoutData(new GridData(GridData.BEGINNING)); tree = new Tree(c, SWT.SINGLE | SWT.BORDER); tree.setLayoutData(new GridData(GridData.FILL_BOTH)); tree.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TreeItem[] tis = tree.getSelection(); if (tis == null || tis.length == 0) return; switchTo( (CWizardHandler) tis[0].getData(), (EntryDescriptor) tis[0].getData(CDTMainWizardPage.DESC)); } }); right = new Composite(c, SWT.NONE); right.setLayoutData(new GridData(GridData.FILL_BOTH)); right.setLayout(new PageLayout()); show_sup = new Button(c, SWT.CHECK); show_sup.setSelection(true); show_sup.setText( MakeUIPlugin.getResourceString( "WizardMakeProjectConversion.projectOptions.showSuppressed")); //$NON-NLS-1$ gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; show_sup.setLayoutData(gd); final IWizardItemsListListener filter = new IWizardItemsListListener() { // Show only category public List<EntryDescriptor> filterItems(List<? extends EntryDescriptor> items) { List<EntryDescriptor> results = new ArrayList<EntryDescriptor>(); for (EntryDescriptor entry : items) { if (entry.isCategory()) { results.add(entry); } } return results; } public boolean isCurrent() { return true; } public void toolChainListChanged(int count) { // Do nothing } }; show_sup.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (h_selected != null) h_selected.setSupportedOnly(show_sup.getSelection()); switchTo( CDTMainWizardPage.updateData(tree, right, show_sup, filter, null), CDTMainWizardPage.getDescriptor(tree)); } }); CDTPrefUtil.readPreferredTCs(); switchTo( CDTMainWizardPage.updateData(tree, right, show_sup, filter, null), CDTMainWizardPage.getDescriptor(tree)); specifyProjectTypeButton.setSelection(true); enableProjectTypeControls(true); }