1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 320765: Add the CDT build console to the set of consoles that can be opened manually. This is useful so that we can have access to the console before doing a build.

This commit is contained in:
Marc Khouzam 2010-08-03 13:15:21 +00:00
parent 7ac3195dd0
commit 413b28ded9
8 changed files with 47 additions and 5 deletions

View file

@ -272,8 +272,9 @@ ActionDefinition.showQuickTypeHierarchy.description= Shows quick type hierarchy
CElementWorkingSetPage.name = C/C++ CElementWorkingSetPage.name = C/C++
BuildConsoleFontDefinition.description= The C-Build console font is used by the C-Build console BuildConsole.name=CDT Build Console
BuildConsoleFontDefinition.label= C-Build Console Text Font BuildConsoleFontDefinition.description= The CDT Build Console font is used by the CDT Build Console
BuildConsoleFontDefinition.label= CDT Build Console Text Font
ActionDefinition.GotoNextMember.name = Go to Next Member ActionDefinition.GotoNextMember.name = Go to Next Member
ActionDefinition.GotoNextMember.description = Move the caret to the next member of the translation unit ActionDefinition.GotoNextMember.description = Move the caret to the next member of the translation unit

View file

@ -3597,4 +3597,11 @@
</command> </command>
</menuContribution> </menuContribution>
</extension> </extension>
<extension
point="org.eclipse.ui.console.consoleFactories">
<consoleFactory
class="org.eclipse.cdt.internal.ui.buildconsole.BuildConsoleFactory"
label="%BuildConsole.name">
</consoleFactory>
</extension>
</plugin> </plugin>

View file

@ -155,7 +155,7 @@ CProjectPropertyPage.closedproject=C information is not available for a closed p
# ------- Building ------- # ------- Building -------
BuildConsole.name=C-Build BuildConsole.name=CDT Build Console
CBuilder.build_error=Could not execute builder "{0}" configured in the project property page. CBuilder.build_error=Could not execute builder "{0}" configured in the project property page.
# ------- Properties------- # ------- Properties-------

View file

@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2010 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.ui.buildconsole;
import org.eclipse.ui.console.IConsoleFactory;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.IBuildConsoleManager;
/**
* A console factory to allow the user to open the build console
* before actually doing a build.
*/
public class BuildConsoleFactory implements IConsoleFactory {
public void openConsole() {
IBuildConsoleManager manager = CUIPlugin.getDefault().getConsoleManager();
if (manager instanceof BuildConsoleManager) {
((BuildConsoleManager)manager).showConsole();
}
}
}

View file

@ -554,6 +554,8 @@ public class BuildConsolePage extends Page
*/ */
void moveToError(int position) { void moveToError(int position) {
IProject project = getProject(); IProject project = getProject();
if (project == null) return;
IBuildConsoleManager consoleManager = CUIPlugin.getDefault().getConsoleManager(); IBuildConsoleManager consoleManager = CUIPlugin.getDefault().getConsoleManager();
IConsole console = consoleManager.getConsole(project); IConsole console = consoleManager.getConsole(project);
if ( console instanceof BuildConsolePartitioner) { if ( console instanceof BuildConsolePartitioner) {

View file

@ -21,7 +21,7 @@ BuildConsolePage_Select__All_Ctrl_A_12=Select &All@Ctrl+A
BuildConsolePage_Select_All=Select All BuildConsolePage_Select_All=Select All
CopyLog_ActionTooltip=Copy Build Log CopyLog_ActionTooltip=Copy Build Log
CopyLog_BuildNotLogged=Last build was not logged. Check Logging page in project properties. CopyLog_BuildNotLogged=No build was logged. Build the project or/and check the Logging page in project properties.
CopyLog_ChooseDestination=Choose Log File Destination CopyLog_ChooseDestination=Choose Log File Destination
CopyLog_ErrorCopyingFile=Error Copying a File CopyLog_ErrorCopyingFile=Error Copying a File
CopyLog_ErrorWhileCopyingLog=Error while copying working log file: CopyLog_ErrorWhileCopyingLog=Error while copying working log file:

View file

@ -47,7 +47,7 @@ public class CopyBuildLogAction extends Action {
@Override @Override
public void run() { public void run() {
IProject project = fConsolePage.getProject(); IProject project = fConsolePage.getProject();
if (!project.isAccessible()) if (project == null || !project.isAccessible())
return; return;
IBuildConsoleManager consoleManager = CUIPlugin.getDefault().getConsoleManager(); IBuildConsoleManager consoleManager = CUIPlugin.getDefault().getConsoleManager();

View file

@ -45,6 +45,8 @@ public class ShowErrorAction extends Action {
super.run(); super.run();
if ( isChecked() ) { if ( isChecked() ) {
IProject project = fConsolePage.getProject(); IProject project = fConsolePage.getProject();
if (project == null) return;
IBuildConsoleManager consoleManager = CUIPlugin.getDefault().getConsoleManager(); IBuildConsoleManager consoleManager = CUIPlugin.getDefault().getConsoleManager();
IConsole console = consoleManager.getConsole(project); IConsole console = consoleManager.getConsole(project);
if ( console instanceof BuildConsolePartitioner) { if ( console instanceof BuildConsolePartitioner) {