mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Fix for 197495, remove earlyStartup from make.ui plugin.
This commit is contained in:
parent
6d2009968e
commit
d1c81163ba
6 changed files with 56 additions and 21 deletions
|
@ -384,13 +384,6 @@
|
||||||
</participant>
|
</participant>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
|
|
||||||
<extension
|
|
||||||
point="org.eclipse.ui.startup">
|
|
||||||
<startup
|
|
||||||
class="org.eclipse.cdt.make.internal.ui.MakeStartup">
|
|
||||||
</startup>
|
|
||||||
</extension>
|
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.perspectiveExtensions">
|
point="org.eclipse.ui.perspectiveExtensions">
|
||||||
<perspectiveExtension
|
<perspectiveExtension
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2007 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,24 +7,29 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.ui;
|
package org.eclipse.cdt.make.internal.ui;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.make.ui.actions.UpdateMakeProjectAction;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
import org.eclipse.jface.dialogs.MessageDialog;
|
import org.eclipse.jface.dialogs.MessageDialog;
|
||||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IProject;
|
|
||||||
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import org.eclipse.ui.IStartup;
|
public class MakeStartup extends Job {
|
||||||
|
|
||||||
import org.eclipse.cdt.make.ui.actions.UpdateMakeProjectAction;
|
public MakeStartup() {
|
||||||
|
super(MakeUIPlugin.getResourceString("MakeUIPlugin.update_project")); //$NON-NLS-1$
|
||||||
|
setSystem(true);
|
||||||
|
}
|
||||||
|
|
||||||
public class MakeStartup implements IStartup {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
|
|
||||||
public void earlyStartup() {
|
|
||||||
final IProject[] oldProject = UpdateMakeProjectAction.getOldProjects();
|
final IProject[] oldProject = UpdateMakeProjectAction.getOldProjects();
|
||||||
if (oldProject.length > 0) {
|
if (oldProject.length > 0) {
|
||||||
Display.getDefault().asyncExec(new Runnable() {
|
Display.getDefault().asyncExec(new Runnable() {
|
||||||
|
@ -41,6 +46,6 @@ public class MakeStartup implements IStartup {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2007 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.internal.ui;
|
package org.eclipse.cdt.make.internal.ui;
|
||||||
|
|
||||||
|
@ -251,6 +252,12 @@ public class MakeUIPlugin extends AbstractUIPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void start(BundleContext context) throws Exception {
|
||||||
|
super.start(context);
|
||||||
|
new MakeStartup().schedule();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -31,9 +31,11 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdapterManager;
|
import org.eclipse.core.runtime.IAdapterManager;
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
import org.eclipse.jface.action.GroupMarker;
|
import org.eclipse.jface.action.GroupMarker;
|
||||||
import org.eclipse.jface.action.IMenuManager;
|
import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.jface.action.Separator;
|
import org.eclipse.jface.action.Separator;
|
||||||
|
@ -56,7 +58,9 @@ import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
|
||||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||||
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
|
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
|
||||||
import org.eclipse.ui.texteditor.ConfigurationElementSorter;
|
import org.eclipse.ui.texteditor.ConfigurationElementSorter;
|
||||||
|
import org.osgi.framework.Bundle;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
|
import org.osgi.framework.BundleException;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
|
@ -464,6 +468,28 @@ public class CUIPlugin extends AbstractUIPlugin {
|
||||||
// init ast provider
|
// init ast provider
|
||||||
getASTProvider();
|
getASTProvider();
|
||||||
CDTContextActivator.getInstance().install();
|
CDTContextActivator.getInstance().install();
|
||||||
|
|
||||||
|
// start make-ui plugin, such that it can check for project conversions.
|
||||||
|
Job job= new Job(Messages.CUIPlugin_jobStartMakeUI) {
|
||||||
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
|
Bundle bundle= Platform.getBundle("org.eclipse.cdt.make.ui"); //$NON-NLS-1$
|
||||||
|
try {
|
||||||
|
if (bundle != null) {
|
||||||
|
switch (bundle.getState()) {
|
||||||
|
case Bundle.RESOLVED:
|
||||||
|
case Bundle.STARTING: // because make.ui uses lazy activation, we need to start it.
|
||||||
|
bundle.start(Bundle.START_TRANSIENT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (BundleException e) {
|
||||||
|
return new Status(IStatus.WARNING, PLUGIN_ID, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
return Status.OK_STATUS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
job.setSystem(true);
|
||||||
|
job.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.ui;
|
package org.eclipse.cdt.ui;
|
||||||
|
@ -16,6 +17,7 @@ import org.eclipse.osgi.util.NLS;
|
||||||
public class Messages extends NLS {
|
public class Messages extends NLS {
|
||||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.ui.messages"; //$NON-NLS-1$
|
private static final String BUNDLE_NAME = "org.eclipse.cdt.ui.messages"; //$NON-NLS-1$
|
||||||
public static String CElementGrouping_includeGroupingLabel;
|
public static String CElementGrouping_includeGroupingLabel;
|
||||||
|
public static String CUIPlugin_jobStartMakeUI;
|
||||||
static {
|
static {
|
||||||
// initialize resource bundle
|
// initialize resource bundle
|
||||||
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
|
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
#
|
#
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# IBM - Initial API and implementation
|
# IBM - Initial API and implementation
|
||||||
|
# Markus Schorn (Wind River Systems)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
#Note to translators: "include" is a code word and should not be translated. Thanks.
|
#Note to translators: "include" is a code word and should not be translated. Thanks.
|
||||||
|
|
||||||
CElementGrouping_includeGroupingLabel=include directives
|
CElementGrouping_includeGroupingLabel=include directives
|
||||||
|
CUIPlugin_jobStartMakeUI=Starting plugin org.eclipse.cdt.make.ui
|
||||||
|
|
Loading…
Add table
Reference in a new issue