Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 57870 Details for
Bug 153816
Support for multiple build consoles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
CDT UI patch to support multiple build consoles
buildconsole.patch (text/plain), 10.07 KB, created by
Jeff Johnston
on 2007-01-30 17:22:32 EST
(
hide
)
Description:
CDT UI patch to support multiple build consoles
Filename:
MIME Type:
Creator:
Jeff Johnston
Created:
2007-01-30 17:22:32 EST
Size:
10.07 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.ui >Index: src/org/eclipse/cdt/ui/CUIPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java,v >retrieving revision 1.66 >diff -u -r1.66 CUIPlugin.java >--- src/org/eclipse/cdt/ui/CUIPlugin.java 18 Jan 2007 07:57:56 -0000 1.66 >+++ src/org/eclipse/cdt/ui/CUIPlugin.java 30 Jan 2007 22:15:59 -0000 >@@ -10,14 +10,17 @@ > * IBM Corp. - Rational Software > * Markus Schorn (Wind River Systems) > * Anton Leherbauer (Wind River Systems) >+ * Jeff Johnston (Red Hat Inc.) > *******************************************************************************/ > package org.eclipse.cdt.ui; > > import java.io.IOException; > import java.text.MessageFormat; > import java.util.ArrayList; >+import java.util.HashMap; > import java.util.HashSet; > import java.util.List; >+import java.util.Map; > import java.util.MissingResourceException; > import java.util.ResourceBundle; > import java.util.Set; >@@ -70,6 +73,7 @@ > import org.eclipse.cdt.internal.ui.IContextMenuConstants; > import org.eclipse.cdt.internal.ui.ResourceAdapterFactory; > import org.eclipse.cdt.internal.ui.buildconsole.BuildConsoleManager; >+import org.eclipse.cdt.internal.ui.buildconsole.ConsoleMessages; > import org.eclipse.cdt.internal.ui.editor.ASTProvider; > import org.eclipse.cdt.internal.ui.editor.CDocumentProvider; > import org.eclipse.cdt.internal.ui.editor.CustomBufferFactory; >@@ -330,7 +334,7 @@ > private CTextTools fTextTools; > private AsmTextTools fAsmTextTools; > private ProblemMarkerManager fProblemMarkerManager; >- private BuildConsoleManager fBuildConsoleManager; >+ private Map fBuildConsoleManagers; > private ResourceAdapterFactory fResourceAdapterFactory; > private CElementAdapterFactory fCElementAdapterFactory; > >@@ -356,7 +360,8 @@ > public CUIPlugin() { > fgCPlugin = this; > fDocumentProvider = null; >- fTextTools = null; >+ fTextTools = null; >+ fBuildConsoleManagers = new HashMap(); > } > > /** >@@ -408,12 +413,28 @@ > return fAsmTextTools; > } > >+ /** >+ * Return the default console manager. >+ * @return IBuildConsoleManager >+ */ > public IBuildConsoleManager getConsoleManager() { >- if ( fBuildConsoleManager == null ) { >- fBuildConsoleManager = new BuildConsoleManager(); >- fBuildConsoleManager.startup(); >+ return getConsoleManager(ConsoleMessages.getString("BuildConsole.buildConsole"), BuildConsoleManager.DEFAULT_MENU_CONTEXT_ID); //$NON-NLS-1$ >+ } >+ >+ /** >+ * Return a console manager specified by id. >+ * @param name console name >+ * @param id console id >+ * @return IBuildConsoleManager >+ */ >+ public IBuildConsoleManager getConsoleManager(String name, String id) { >+ BuildConsoleManager manager = (BuildConsoleManager)fBuildConsoleManagers.get(id); >+ if (manager == null ) { >+ manager = new BuildConsoleManager(); >+ fBuildConsoleManagers.put(id, manager); >+ manager.startup(name, id); > } >- return fBuildConsoleManager; >+ return manager; > } > > /* (non-Javadoc) >@@ -453,9 +474,14 @@ > fImageDescriptorRegistry.dispose(); > fImageDescriptorRegistry= null; > } >- if ( fBuildConsoleManager != null ) { >- fBuildConsoleManager.shutdown(); >- fBuildConsoleManager = null; >+ if (fBuildConsoleManagers != null ) { >+ Object[] bcm = fBuildConsoleManagers.values().toArray(); >+ for (int i = 0; i < bcm.length; ++i) { >+ BuildConsoleManager m = (BuildConsoleManager)bcm[i]; >+ if (m != null) >+ m.shutdown(); >+ } >+ fBuildConsoleManagers.clear(); > } > > unregisterAdapters(); >Index: src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java,v >retrieving revision 1.15 >diff -u -r1.15 BuildConsoleManager.java >--- src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java 13 Nov 2006 11:53:43 -0000 1.15 >+++ src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java 30 Jan 2007 22:15:59 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * QNX Software Systems - initial API and implementation >+ * Red Hat Inc. - multiple build console support > *******************************************************************************/ > package org.eclipse.cdt.internal.ui.buildconsole; > >@@ -54,11 +55,14 @@ > private Map fConsoleMap = new HashMap(); > Color infoColor, outputColor, errorColor; > BuildConsoleStream infoStream, outputStream, errorStream; >+ String fName, fContextMenuId; > > static public final int BUILD_STREAM_TYPE_INFO = 0; > static public final int BUILD_STREAM_TYPE_OUTPUT = 1; > static public final int BUILD_STREAM_TYPE_ERROR = 2; > private IProject fLastProject; >+ >+ static public final String DEFAULT_MENU_CONTEXT_ID = CUIPlugin.PLUGIN_ID + ".CBuildConole"; //$NON-NLS-1$ > > public BuildConsoleManager() { > } >@@ -170,10 +174,12 @@ > } > } > >- public void startup() { >+ public void startup(String name, String id) { > infoStream = new BuildConsoleStream(); > outputStream = new BuildConsoleStream(); > errorStream = new BuildConsoleStream(); >+ fName = name; >+ fContextMenuId = id; > > runUI(new Runnable() { > >@@ -184,7 +190,7 @@ > */ > public void run() { > // install colors >- fConsole = new BuildConsole(BuildConsoleManager.this); >+ fConsole = new BuildConsole(BuildConsoleManager.this, fName, fContextMenuId); > ConsolePlugin.getDefault().getConsoleManager().addConsoles(new org.eclipse.ui.console.IConsole[]{fConsole}); > infoStream.setConsole(fConsole); > infoColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_INFO_COLOR); >Index: src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsole.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsole.java,v >retrieving revision 1.5 >diff -u -r1.5 BuildConsole.java >--- src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsole.java 23 Jun 2006 17:52:12 -0000 1.5 >+++ src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsole.java 30 Jan 2007 22:15:59 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * QNX Software Systems - Initial API and implementation >+ * Red Hat Inc. - Multiple build console support > *******************************************************************************/ > package org.eclipse.cdt.internal.ui.buildconsole; > >@@ -26,18 +27,22 @@ > public static final String P_STREAM_COLOR = CUIPlugin.PLUGIN_ID + ".CONSOLE_P_STREAM_COLOR"; //$NON-NLS-1$ > > private IBuildConsoleManager fConsoleManager; >+ private String fConsoleName; >+ private String fConsoleId; > >- public BuildConsole(IBuildConsoleManager manager) { >- super(ConsoleMessages.getString("BuildConsole.buildConsole"), CPluginImages.DESC_BUILD_CONSOLE); //$NON-NLS-1$ >+ public BuildConsole(IBuildConsoleManager manager, String name, String id) { >+ super(name, CPluginImages.DESC_BUILD_CONSOLE); > fConsoleManager = manager; >+ fConsoleName = name; >+ fConsoleId = id; > } > > public IPageBookViewPage createPage(IConsoleView view) { >- return new BuildConsolePage(view, this); >+ return new BuildConsolePage(view, this, fConsoleId); > } > > public void setTitle(IProject project) { >- String title = ConsoleMessages.getString("BuildConsole.buildConsole"); //$NON-NLS-1$ >+ String title = fConsoleName; > if (project != null) { > title += " [" + project.getName() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ > } >Index: src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java,v >retrieving revision 1.14 >diff -u -r1.14 BuildConsolePage.java >--- src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java 7 Jul 2006 13:59:59 -0000 1.14 >+++ src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java 30 Jan 2007 22:15:59 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * QNX Software Systems - initial API and implementation >+ * Red Hat Inc. - multiple build console support > *******************************************************************************/ > package org.eclipse.cdt.internal.ui.buildconsole; > >@@ -17,10 +18,6 @@ > import java.util.Map; > import java.util.ResourceBundle; > >-import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage; >-import org.eclipse.cdt.ui.CUIPlugin; >-import org.eclipse.cdt.ui.IBuildConsoleEvent; >-import org.eclipse.cdt.ui.IBuildConsoleListener; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; >@@ -75,6 +72,12 @@ > import org.eclipse.ui.texteditor.ITextEditorActionConstants; > import org.eclipse.ui.texteditor.IUpdate; > >+import org.eclipse.cdt.ui.CUIPlugin; >+import org.eclipse.cdt.ui.IBuildConsoleEvent; >+import org.eclipse.cdt.ui.IBuildConsoleListener; >+ >+import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage; >+ > public class BuildConsolePage extends Page > implements > ISelectionListener, >@@ -85,6 +88,7 @@ > > private BuildConsole fConsole; > private IConsoleView fConsoleView; >+ private String fContextMenuId; > private BuildConsoleViewer fViewer; > private IProject fProject; > >@@ -109,10 +113,13 @@ > /** > * @param view > * @param console >+ * @param contextId > */ >- public BuildConsolePage(IConsoleView view, BuildConsole console) { >+ public BuildConsolePage(IConsoleView view, BuildConsole console, >+ String contextId) { > fConsole = console; > fConsoleView = view; >+ fContextMenuId = contextId; > } > > protected void setProject(IProject project) { >@@ -187,7 +194,7 @@ > fMenu = manager.createContextMenu(getControl()); > getControl().setMenu(fMenu); > IPageSite site = getSite(); >- site.registerContextMenu(CUIPlugin.PLUGIN_ID + ".CBuildConole", manager, getViewer()); //$NON-NLS-1$ >+ site.registerContextMenu(fContextMenuId, manager, getViewer()); > site.setSelectionProvider(getViewer()); > createActions(); > configureToolBar(site.getActionBars().getToolBarManager());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 153816
:
47864
| 57870