mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 20:15:22 +02:00
removed console clearing logic replaced with IConsole method
This commit is contained in:
parent
06cc85addc
commit
ac5ef77825
3 changed files with 47 additions and 35 deletions
|
@ -6,6 +6,9 @@ package org.eclipse.cdt.internal.ui;
|
|||
|
||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||
import org.eclipse.cdt.core.resources.IConsole;
|
||||
import org.eclipse.cdt.core.resources.MakeUtil;
|
||||
import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
||||
public class CConsole implements IConsole {
|
||||
|
||||
|
@ -16,6 +19,13 @@ public class CConsole implements IConsole {
|
|||
super();
|
||||
}
|
||||
|
||||
public void start(IProject project ) {
|
||||
if (CPluginPreferencePage.isClearBuildConsole()
|
||||
&& MakeUtil.getSessionConsoleMode(project)) {
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.resources.IConsole#clear()
|
||||
*/
|
||||
|
|
|
@ -10,30 +10,6 @@ import java.text.MessageFormat;
|
|||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdapterManager;
|
||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.Document;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
|
@ -46,6 +22,28 @@ import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage;
|
|||
import org.eclipse.cdt.internal.ui.text.CTextTools;
|
||||
import org.eclipse.cdt.internal.ui.util.ImageDescriptorRegistry;
|
||||
import org.eclipse.cdt.internal.ui.util.ProblemMarkerManager;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdapterManager;
|
||||
import org.eclipse.core.runtime.IPluginDescriptor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.Document;
|
||||
import org.eclipse.jface.text.IDocument;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PartInitException;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
|
||||
public class CPlugin extends AbstractUIPlugin {
|
||||
|
@ -145,6 +143,9 @@ public class CPlugin extends AbstractUIPlugin {
|
|||
fDocument = new Document();
|
||||
}
|
||||
|
||||
public void start(IProject project) {
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
super.clear();
|
||||
Display.getDefault().syncExec(new Runnable() {
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
|
|||
import org.eclipse.ui.help.DialogPageContextComputer;
|
||||
import org.eclipse.ui.help.WorkbenchHelp;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.internal.ui.CPlugin;
|
||||
import org.eclipse.cdt.internal.ui.ICHelpContextIds;
|
||||
|
||||
|
@ -31,8 +32,8 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements
|
|||
|
||||
public static final String PREF_CONSOLE_FONT= "consoleFont";
|
||||
|
||||
private static final String PREF_BUILD_LOCATION= "buildLocation";
|
||||
private static final String PREF_STOP_ON_ERROR= "stopOnError";
|
||||
// private static final String PREF_BUILD_LOCATION= "buildLocation";
|
||||
// private static final String PREF_STOP_ON_ERROR= "stopOnError";
|
||||
private static final String PREF_CLEAR_CONSOLE= "clearConsole";
|
||||
private static final String PREF_CONSOLE_ON_TOP= "consoleOnTop";
|
||||
private static final String PREF_AUTO_OPEN_CONSOLE = "autoOpenConsole";
|
||||
|
@ -40,7 +41,7 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements
|
|||
public static final String SHOW_CU_CHILDREN="CUChildren"; //$NON-NLS-1$
|
||||
|
||||
private static final String PAGE_DESC= "CBasePreferencePage.description";
|
||||
private static final String BUILD_LOC_LABEL= "CBasePreferencePage.buildLocation.label";
|
||||
// private static final String BUILD_LOC_LABEL= "CBasePreferencePage.buildLocation.label";
|
||||
private static final String CLEAR_CONSOLE_LABEL= "CBasePreferencePage.clearConsole.label";
|
||||
private static final String CONSOLE_ON_TOP_LABEL= "CBasePreferencePage.consoleOnTop.label";
|
||||
private static final String AUTO_OPEN_CONSOLE_LABEL= "CBasePreferencePage.autoOpenConsole.label";
|
||||
|
@ -126,13 +127,13 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements
|
|||
/**
|
||||
* Returns the current preference setting of the build command location.
|
||||
*/
|
||||
public static String getBuildLocation() {
|
||||
return CPlugin.getDefault().getPreferenceStore().getString(PREF_BUILD_LOCATION);
|
||||
}
|
||||
// public static String getBuildLocation() {
|
||||
// return CPlugin.getDefault().getPreferenceStore().getString(PREF_BUILD_LOCATION);
|
||||
// }
|
||||
|
||||
public static boolean isStopOnError() {
|
||||
return CPlugin.getDefault().getPreferenceStore().getBoolean(PREF_STOP_ON_ERROR);
|
||||
}
|
||||
// public static boolean isStopOnError() {
|
||||
// return CPlugin.getDefault().getPreferenceStore().getBoolean(PREF_STOP_ON_ERROR);
|
||||
// }
|
||||
/**
|
||||
* @see IWorkbenchPreferencePage#init
|
||||
*/
|
||||
|
@ -143,8 +144,8 @@ public class CPluginPreferencePage extends FieldEditorPreferencePage implements
|
|||
* Initializes the default values of this page in the preference bundle.
|
||||
*/
|
||||
public static void initDefaults(IPreferenceStore prefs) {
|
||||
prefs.setDefault(PREF_BUILD_LOCATION, "make");
|
||||
prefs.setDefault(PREF_STOP_ON_ERROR, false);
|
||||
// prefs.setDefault(PREF_BUILD_LOCATION, "make");
|
||||
// prefs.setDefault(PREF_STOP_ON_ERROR, false);
|
||||
prefs.setDefault(PREF_CLEAR_CONSOLE, true);
|
||||
prefs.setDefault(PREF_AUTO_OPEN_CONSOLE, false);
|
||||
prefs.setDefault(PREF_CONSOLE_ON_TOP, true);
|
||||
|
|
Loading…
Add table
Reference in a new issue