@Override protected void addToMainPage(Composite container) { remoteServices = new Group(container, SWT.SHADOW_IN); remoteServices.setText( Messages.getString("WizardProjectConversion.servicesTableLabel")); // $NON-NLS-1$ remoteServices.setLayout(new FillLayout()); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); data.heightHint = 350; remoteServices.setLayoutData(data); fServiceModelWidget = new ServiceProviderConfigurationWidget(remoteServices, SWT.NONE); tableViewer.addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent e) { IProject project = (IProject) ((IStructuredSelection) e.getSelection()).getFirstElement(); if (project != null) { changeProject(project); } } }); tableViewer.addCheckStateListener( new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent e) { IProject project = (IProject) e.getElement(); if (e.getChecked() && project != null) { changeProject(project); } } }); Shell shell = getContainer().getShell(); PlatformUI.getWorkbench() .getHelpSystem() .setHelp(shell, RDTHelpContextIds.CONVERTING_TO_REMOTE_PROJECT); }
/** @since 2.0 */ protected void changeProject(IProject project) { IServiceConfiguration config = getConfig(project); fServiceModelWidget.applyChangesToConfiguration(); fServiceModelWidget.setServiceConfiguration(config); remoteServices.setText( MessageFormat.format( Messages.getString("WizardProjectConversion.servicesTableForProjectLabel"), new Object[] {project.getName()})); // $NON-NLS-1$ }
/** @since 2.0 */ protected void convertProject(IProject project, IProgressMonitor monitor) throws CoreException { monitor.beginTask( Messages.getString("WizardProjectConversion.monitor.convertingToRemoteProject"), 3); //$NON-NLS-1$ try { RemoteNature.addRemoteNature(project, new SubProgressMonitor(monitor, 1)); RemoteMakeNature.updateProjectDescription(project, RemoteMakeBuilder.BUILDER_ID, monitor); configureServicesForRemoteProject(project); } finally { monitor.done(); } }
@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(); } }
public void run(IAction action) { IStructuredSelection cElements = SelectionConverter.convertSelectionToCElements(fSelection); for (Iterator<?> i = cElements.iterator(); i.hasNext(); ) { Object elem = i.next(); if (elem instanceof ICProject) { if (RemoteNature.hasRemoteNature(((ICProject) elem).getProject())) { IndexBuildSequenceController indexBuildSequenceController = IndexBuildSequenceController.getIndexBuildSequenceController( ((ICProject) elem).getProject()); Shell shell = new Shell(); if (indexBuildSequenceController.isOptionalIndex()) { boolean continueIndex = MessageDialog.openQuestion( shell, Messages.getString("RemoteRebuildIndexOption.question"), Messages.getString( "RemoteRebuildIndexOption.message")); //$NON-NLS-1$ //$NON-NLS-2$ if (continueIndex) { // in case build is not completed normally indexBuildSequenceController.setBuildIncompleteIfItIsRunning(); // index could be never run as the build is not completed. indexBuildSequenceController.setIndexStartingByReindex(); CCorePlugin.getIndexManager().reindex((ICProject) elem); } } else { indexBuildSequenceController.setIndexStartingByReindex(); CCorePlugin.getIndexManager().reindex((ICProject) elem); } } else { CCorePlugin.getIndexManager().reindex((ICProject) elem); } } } }
/** * Method getWzDescriptionResource returns the correct description Label for this class overriding * the default in the superclass. */ protected String getWzDescriptionResource() { return Messages.getString(WZ_DESC); }
/** * Method getWzTitleResource returns the correct Title Label for this class overriding the default * in the superclass. */ protected String getWzTitleResource() { return Messages.getString(WZ_TITLE); }