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 47864 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 secondary build consoles
cdt.3.1.ui.08142006.patch (text/plain), 8.44 KB, created by
Jeff Johnston
on 2006-08-14 15:31:40 EDT
(
hide
)
Description:
CDT UI patch to support secondary build consoles
Filename:
MIME Type:
Creator:
Jeff Johnston
Created:
2006-08-14 15:31:40 EDT
Size:
8.44 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-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CUIPlugin.java,v >retrieving revision 1.59 >diff -u -r1.59 CUIPlugin.java >--- src/org/eclipse/cdt/ui/CUIPlugin.java 14 Jun 2006 12:15:52 -0000 1.59 >+++ src/org/eclipse/cdt/ui/CUIPlugin.java 14 Aug 2006 19:00:01 -0000 >@@ -14,8 +14,12 @@ > import java.io.IOException; > import java.text.MessageFormat; > import java.util.ArrayList; >+import java.util.Collection; >+import java.util.HashMap; > import java.util.HashSet; >+import java.util.Iterator; > import java.util.List; >+import java.util.Map; > import java.util.MissingResourceException; > import java.util.ResourceBundle; > import java.util.Set; >@@ -337,6 +341,7 @@ > private AsmTextTools fAsmTextTools; > private ProblemMarkerManager fProblemMarkerManager; > private BuildConsoleManager fBuildConsoleManager; >+ private Map fSubConsoleManagers = new HashMap(); > private ResourceAdapterFactory fResourceAdapterFactory; > private CElementAdapterFactory fCElementAdapterFactory; > >@@ -416,6 +421,16 @@ > return fBuildConsoleManager; > } > >+ public IBuildConsoleManager getSubConsoleManager(String name, String id, String contextId) { >+ BuildConsoleManager manager = (BuildConsoleManager)fSubConsoleManagers.get(id); >+ if (manager == null ) { >+ manager = new BuildConsoleManager(); >+ fSubConsoleManagers.put(id, manager); >+ manager.startup(name, id, contextId); >+ } >+ return manager; >+ } >+ > /* (non-Javadoc) > * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) > */ >@@ -443,6 +458,16 @@ > } > if (fImageDescriptorRegistry != null) > fImageDescriptorRegistry.dispose(); >+ >+ if (!fSubConsoleManagers.isEmpty()) { >+ Collection x = fSubConsoleManagers.values(); >+ for (Iterator i = x.iterator(); i.hasNext(); ) { >+ BuildConsoleManager b = (BuildConsoleManager)i.next(); >+ b.shutdown(); >+ } >+ fSubConsoleManagers.clear(); >+ } >+ > if ( fBuildConsoleManager != null ) { > fBuildConsoleManager.shutdown(); > fBuildConsoleManager = null; >Index: src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java,v >retrieving revision 1.13 >diff -u -r1.13 BuildConsoleManager.java >--- src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java 23 Jun 2006 17:52:12 -0000 1.13 >+++ src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsoleManager.java 14 Aug 2006 19:00:01 -0000 >@@ -52,6 +52,7 @@ > private Map fConsoleMap = new HashMap(); > Color infoColor, outputColor, errorColor; > BuildConsoleStream infoStream, outputStream, errorStream; >+ String fName, fSubMenuId, fContextMenuId; > > static public final int BUILD_STREAM_TYPE_INFO = 0; > static public final int BUILD_STREAM_TYPE_OUTPUT = 1; >@@ -199,6 +200,40 @@ > CUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); > } > >+ public void startup(String name, String subMenuId, String contextMenuId) { >+ infoStream = new BuildConsoleStream(); >+ outputStream = new BuildConsoleStream(); >+ errorStream = new BuildConsoleStream(); >+ fName = name; >+ fSubMenuId = subMenuId; >+ fContextMenuId = contextMenuId; >+ >+ runUI(new Runnable() { >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see java.lang.Runnable#run() >+ */ >+ public void run() { >+ // install colors >+ fConsole = new BuildConsole(BuildConsoleManager.this, fName, fSubMenuId, fContextMenuId); >+ ConsolePlugin.getDefault().getConsoleManager().addConsoles(new org.eclipse.ui.console.IConsole[]{fConsole}); >+ infoStream.setConsole(fConsole); >+ infoColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_INFO_COLOR); >+ infoStream.setColor(infoColor); >+ outputStream.setConsole(fConsole); >+ outputColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_OUTPUT_COLOR); >+ outputStream.setColor(outputColor); >+ errorStream.setConsole(fConsole); >+ errorColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_ERROR_COLOR); >+ errorStream.setColor(errorColor); >+ } >+ }); >+ CUIPlugin.getWorkspace().addResourceChangeListener(this); >+ CUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); >+ } >+ > /* > * (non-Javadoc) > * >Index: src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsole.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/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 14 Aug 2006 19:00:01 -0000 >@@ -26,18 +26,30 @@ > 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; >+ private String fContextId; > > public BuildConsole(IBuildConsoleManager manager) { > super(ConsoleMessages.getString("BuildConsole.buildConsole"), CPluginImages.DESC_BUILD_CONSOLE); //$NON-NLS-1$ > fConsoleManager = manager; >+ fConsoleName = ConsoleMessages.getString("BuildConsole.buildConsole"); //$NON-NLS-1$ >+ } >+ >+ public BuildConsole(IBuildConsoleManager manager, String name, String id, String contextId) { >+ super(name, CPluginImages.DESC_BUILD_CONSOLE); //$NON-NLS-1$ >+ fConsoleManager = manager; >+ fConsoleName = name; >+ fConsoleId = id; >+ fContextId = contextId; > } > > public IPageBookViewPage createPage(IConsoleView view) { >- return new BuildConsolePage(view, this); >+ return new BuildConsolePage(view, this, fConsoleId, fContextId); > } > > 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-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java,v >retrieving revision 1.12 >diff -u -r1.12 BuildConsolePage.java >--- src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java 23 Jun 2006 17:26:09 -0000 1.12 >+++ src/org/eclipse/cdt/internal/ui/buildconsole/BuildConsolePage.java 14 Aug 2006 19:00:01 -0000 >@@ -85,6 +85,8 @@ > > private BuildConsole fConsole; > private IConsoleView fConsoleView; >+ private String fMenuId; >+ private String fContextMenuId; > private BuildConsoleViewer fViewer; > private IProject fProject; > >@@ -109,10 +111,25 @@ > /** > * @param view > * @param console >+ * @param menuId >+ */ >+ public BuildConsolePage(IConsoleView view, BuildConsole console, >+ String menuId, String contextMenuId) { >+ fConsole = console; >+ fConsoleView = view; >+ fMenuId = menuId; >+ fContextMenuId = contextMenuId; >+ } >+ >+ /** >+ * @param view >+ * @param console > */ > public BuildConsolePage(IConsoleView view, BuildConsole console) { > fConsole = console; > fConsoleView = view; >+ fMenuId = "#MessageConsole"; >+ fContextMenuId = "CConsole"; > } > > protected void setProject(IProject project) { >@@ -176,7 +193,7 @@ > public void createControl(Composite parent) { > fViewer = new BuildConsoleViewer(parent); > >- MenuManager manager = new MenuManager("#MessageConsole", "#MessageConsole"); //$NON-NLS-1$ //$NON-NLS-2$ >+ MenuManager manager = new MenuManager("#MessageConsole", fMenuId); //$NON-NLS-1$ //$NON-NLS-2$ > manager.setRemoveAllWhenShown(true); > manager.addMenuListener(new IMenuListener() { > >@@ -187,7 +204,7 @@ > fMenu = manager.createContextMenu(getControl()); > getControl().setMenu(fMenu); > IPageSite site = getSite(); >- site.registerContextMenu(CUIPlugin.PLUGIN_ID + ".CBuildConole", manager, getViewer()); //$NON-NLS-1$ >+ site.registerContextMenu(CUIPlugin.PLUGIN_ID + "." + fContextMenuId, manager, getViewer()); //$NON-NLS-1$ > 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
Actions:
View
|
Diff
Attachments on
bug 153816
:
47864
|
57870