# HG changeset patch # User stechong # Date 1280787762 18000 # Node ID b94a1c13f1e5202783249d46d50de0312493aff3 # Parent 9aa73dba4a424d1b3ba72387cbe043dc339fbd3c# Parent 4efebb37741079f1afbbaafc33ab20cfb1277b97 Merge from default. diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/carbide_releases/configuration/server.properties --- a/core/carbide_releases/configuration/server.properties Mon Aug 02 16:50:54 2010 -0500 +++ b/core/carbide_releases/configuration/server.properties Mon Aug 02 17:22:42 2010 -0500 @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2008 Nokia. +# Copyright (c) 2010 Nokia. # # This file contains server URLs by the ID of the service that requires it # One server may be specified per line @@ -9,8 +9,9 @@ ############################################################################### com.nokia.carbide.cpp.news.reader.feed.listing.file=http://tools.ext.nokia.com/carbide_news_reader/feedListing.xml com.nokia.carbide.trk.support.service.TRKService=http://tools.ext.nokia.com/trk/TRKPackages.xml -com.nokia.carbide.discovery.directory=http://cdn.symbian.org/carbide/updates/3.0/discovery/directory.xml -com.nokia.carbide.internal.discovery.ui.view.SupportPage=https://xdabug001.ext.nokia.com/bugzilla +com.nokia.carbide.internal.discovery.ui.view.InstallExtensionsPortalExtension=http://cdn.symbian.org/carbide/updates/3.0/discovery/directory.xml +com.nokia.carbide.internal.discovery.ui.view.BugzillaPage=https://xdabug001.ext.nokia.com/bugzilla com.nokia.carbide.internal.discovery.ui.view.HomePage=http://www.forum.nokia.com/Library/Tools_and_downloads/Other/Carbide.c++/ com.nokia.carbide.internal.discovery.ui.view.WrenchSciencePage=http://blogs.in.nokia.com/wrenchscience/rss.xml com.nokia.carbide.internal.discovery.ui.view.CreatingCarbidePage=http://creatingcarbide.blogspot.com/feeds/posts/default?alt=rss +com.nokia.carbide.internal.discovery.ui.view.PulsarPageLayer=http://tools.ext.nokia.com/pulsar/directory.xml diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.doc.user/html/concepts/CarbidePerspective.html --- a/core/com.nokia.carbide.cpp.doc.user/html/concepts/CarbidePerspective.html Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp.doc.user/html/concepts/CarbidePerspective.html Mon Aug 02 17:22:42 2010 -0500 @@ -13,15 +13,15 @@
  • Symbian Project Navigator view - shows all files that belong to the current build configuration
  • Editor view - one or more source code editor windows
  • -
  • Outline view - displays an outline of a structured C/C++ file that is currently open in the editor view
  • -
  • Install Extensions view - displays a list of installable plug-ins
  • +
  • Carbide Portals editor - provides Carbide news, release information, additional extensions, and support options
  • +
  • Outline view - displays an outline of a structured C/C++ file that is currently open in the editor view
  • Problems view - displays build errors
  • Console view - shows the output of a process and allows you to provide keyboard input to a process
  • Executables view - provides a dynamic list of executables and their related source files
  • Remote Connections view – use to monitor, create, edit, or remove common connection settings
  • -

    +

    Figure 1 - Carbide C/C++ perspective

    NOTE Click the icon to show additional options that may not be visible in the perspective view.

    For more information on perspectives see Workbench User Guide > Concepts > Perspectives, and for views see C/C++ Development User Guide > Reference diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.doc.user/html/reference/view_disassembly.htm --- a/core/com.nokia.carbide.cpp.doc.user/html/reference/view_disassembly.htm Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp.doc.user/html/reference/view_disassembly.htm Mon Aug 02 17:22:42 2010 -0500 @@ -99,7 +99,7 @@ Select this option to open the Breakpoint Properties dialog. -

    +

    Figure 3 - Setting Breakpoints in the Disassembly view

    Opening the Disassembly view

    diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.doc.user/html/reference/views_overview.htm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.doc.user/html/reference/views_overview.htm Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,38 @@ + + + + + + +Carbide Views + + + +

    Carbide Views

    +

    Here are all the views available within the Carbide IDE and debugging environments.

    +

    Carbide C/++ perspective views:

    + +

    Debug perspective views:

    + + + + + diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.doc.user/tocCarbide.xml --- a/core/com.nokia.carbide.cpp.doc.user/tocCarbide.xml Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp.doc.user/tocCarbide.xml Mon Aug 02 17:22:42 2010 -0500 @@ -57,7 +57,7 @@ - + diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF --- a/core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/META-INF/MANIFEST.MF Mon Aug 02 17:22:42 2010 -0500 @@ -13,7 +13,8 @@ com.nokia.carbide.cpp.ui, com.nokia.carbide.templatewizard, com.nokia.cpp.utils.core, - com.nokia.cpp.utils.ui + com.nokia.cpp.utils.ui, + com.nokia.carbide.discovery.ui;bundle-version="1.0.0" Bundle-ActivationPolicy: lazy Export-Package: com.nokia.carbide.cpp.internal.api.sdk.ui, com.nokia.carbide.cpp.sdk.ui.shared diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.sdk.ui/plugin.xml --- a/core/com.nokia.carbide.cpp.sdk.ui/plugin.xml Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/plugin.xml Mon Aug 02 17:22:42 2010 -0500 @@ -53,6 +53,15 @@ label="%carbcPreference.platformfiltering"> + + + + diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java --- a/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/internal/sdk/ui/SDKPreferencePage.java Mon Aug 02 17:22:42 2010 -0500 @@ -252,11 +252,9 @@ * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite) */ public void createControl(Composite parent){ - sdkMgr = SDKCorePlugin.getSDKManager(); if (sdkMgr == null){ return; } - sdkList = sdkMgr.getSDKList(); super.createControl(parent); @@ -270,7 +268,11 @@ * (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ - public void init(IWorkbench arg0) { + public void init(IWorkbench workbench) { + sdkMgr = SDKCorePlugin.getSDKManager(); + if (sdkMgr != null){ + sdkList = sdkMgr.getSDKList(); + } } /* diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKPreferencesPortalPageLayer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.cpp.sdk.ui/src/com/nokia/carbide/cpp/sdk/ui/SDKPreferencesPortalPageLayer.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.cpp.sdk.ui; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PlatformUI; + +import com.nokia.carbide.cpp.internal.sdk.ui.SDKPreferencePage; +import com.nokia.carbide.internal.discovery.ui.extension.IActionBar; +import com.nokia.carbide.internal.discovery.ui.extension.IActionUIUpdater; +import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer; + +@SuppressWarnings("restriction") +public class SDKPreferencesPortalPageLayer implements IPortalPageLayer { + + private SDKPreferencePage preferencePage; + + public Control createControl(Composite parent, IEditorPart part) { + preferencePage = new SDKPreferencePage(); + preferencePage.createControl(parent); + return preferencePage.getControl(); + } + + public void init() { + preferencePage.init(PlatformUI.getWorkbench()); + } + + public IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater) { + return null; + } + + public void dispose() { + preferencePage.dispose(); + } + +} diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp/build.properties --- a/core/com.nokia.carbide.cpp/build.properties Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp/build.properties Mon Aug 02 17:22:42 2010 -0500 @@ -1,43 +1,41 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - icons/,\ - plugin.properties,\ - plugin_customization.ini,\ - plugin_customization.properties,\ - splash.bmp,\ - intro/,\ - about.ini,\ - about.html,\ - about.mappings,\ - about.properties,\ - carbide.css,\ - src/,\ - html/,\ - nokiaTOC.xml,\ - introDATA.xml,\ - themes/,\ - book.css,\ - component.xml -src.includes = META-INF/,\ - about.html,\ - about.ini,\ - about.mappings,\ - about.properties,\ - carbide.css,\ - html/,\ - icons/,\ - nokiaTOC.xml,\ - plugin.properties,\ - plugin.xml,\ - plugin_customization.ini,\ - plugin_customization.properties,\ - splash.bmp,\ - src/com/nokia/carbide/cpp/ProductPlugin.java,\ - intro/,\ - introDATA.xml,\ - themes/,\ - book.css -source.. = src/ -bin.excludes = src/com/nokia/carbide/cpp/cs/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + plugin.properties,\ + plugin_customization.ini,\ + plugin_customization.properties,\ + splash.bmp,\ + intro/,\ + about.ini,\ + about.html,\ + about.mappings,\ + about.properties,\ + carbide.css,\ + src/,\ + html/,\ + nokiaTOC.xml,\ + introDATA.xml,\ + book.css,\ + component.xml +src.includes = META-INF/,\ + about.html,\ + about.ini,\ + about.mappings,\ + about.properties,\ + carbide.css,\ + html/,\ + icons/,\ + nokiaTOC.xml,\ + plugin.properties,\ + plugin.xml,\ + plugin_customization.ini,\ + plugin_customization.properties,\ + splash.bmp,\ + src/com/nokia/carbide/cpp/ProductPlugin.java,\ + intro/,\ + introDATA.xml,\ + book.css +source.. = src/ +bin.excludes = src/com/nokia/carbide/cpp/cs/ diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp/carbide.css --- a/core/com.nokia.carbide.cpp/carbide.css Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp/carbide.css Mon Aug 02 17:22:42 2010 -0500 @@ -6,14 +6,14 @@ body { font-family: Verdana, Helvetica, sans-serif; - color: #000000; + color: #5B6B74; margin:20px; } .intro-header h1 { font-family: Verdana, Helvetica, sans-serif; font-size: 20px; - color: #00A1D0; + color: #5B6B74; } .bgbox { background-image: url(images/whitebg.gif); background-repeat: repeat} diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp/intro/css/root.css --- a/core/com.nokia.carbide.cpp/intro/css/root.css Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp/intro/css/root.css Mon Aug 02 17:22:42 2010 -0500 @@ -1,187 +1,249 @@ -/* - * Set up general font colours, sizes, etc. Some of these will override - * settings from the shared CSS - */ -.intro-header H1 { - font-family: Arial, Helvetica, sans-serif; - font-size: 20px; - color: #00A1D0; -/* font-size : 18pt; */ -} -#page-links a .link-label, #action-links a .link-label { - font-size : 13pt; font-weight : 600; color : #1B1B1B; -} -#page-links a p .text, #action-links a p .text { - font-size : 13pt; font-weight : 500; color : #1B1B1B; -} -/* - * Set up the content for the root page. - */ -body { - min-width : 770px; /* since IE doesn't support min-width, use expression */ - width:expression(document.body.clientWidth < 770? "770px": "auto" ); /* swapped Eclipse background image for Carbide version */ - background-image : url(graphics/rootpage/background_carbide.jpg); background-repeat : no-repeat; background-position : top left; background-color : #CCC; -} -#root { - /* Carbide branding mod */ - /* swapped Eclipse background image for Carbide version */ - /* background-image : url(graphics/rootpage/brandmark.gif); */ /* background-image : url(graphics/rootpage/brandmark.png); */ - background-repeat : no-repeat; background-position : bottom left; min-height : 450px; height : 100%; height : expression(document.body.clientHeight < 450? "450px": "100%" ); -} -/* - * Set up the navigation bar. It should be centered in the middle - * of the page - */ -#links-background { - /* removed dot graphic that ran across page! */ - width : 100%; height : 177px; margin-top : 18%; margin-bottom : auto; text-align : center; -} -/* specify a width for Moz so we can center. - * **Important** If additional links are added, we will have to increase this width - * to accomodate them, otherwise they will wrap to a new line - */ -#links-background > #page-links { - width : 33em; margin : 0 auto; -} -#page-links { - position : relative; top : 50px; -} -#page-links a { - position : relative; width : 86px; margin-left : 1em; margin-right : 1em; text-align : center; vertical-align : top; -} -/* float left for Moz so the items all appear inline */ -#page-links > a { - float : left; position : relative; -} -#page-links a img { - height : 72px; /* was 82 */ width : 72px; /* was 82 */ vertical-align : middle; -} -/* remove the hover image from the flow of the document, - so it doesn't take up space and change the position - of the link label and descriptions */ -#page-links a .background-image { - position : absolute; -} -/* properly align the link label and text based on class (left vs. right) */ -#page-links a:hover { - /* This is needed for IE to force the hover pseudo selectors below to work.*/ padding : 0 em; -} -/* Hide both the label and the description of the link and remove them from static HTML flow, until user hovers over link */ -/* First, set the width of both the label and the description to a max of 15 em. */ -/* This can be changed when translated to different country locals. */ -#page-links a span { - width : 16em; } -/* Set up left links orientation first. */ -#page-links a.left:link .link-label, -#page-links a.left:visited .link-label { - display: none; -} -#page-links a.left:hover .link-label, -#page-links a.left:focus .link-label, -#page-links a.left:active .link-label { - text-align: left; display: block; position: absolute; top : 120 %; left : 0; -} -/* hide description and remove it from static HTML flow, until user hovers over link */ -#page-links a.left:link .text, -#page-links a.left:visited .text { - display: none; -} -#page-links a.left:hover .text, -#page-links a.left:focus .text, -#page-links a.left:active .text { - text-align: left; display: block; position: absolute; left : 0; top: 145%; -} -/* Set up right links orientation now. */ -#page-links a.right:link .link-label, -#page-links a.right:visited .link-label { - display: none; -} -#page-links a.right:hover .link-label, -#page-links a.right:focus .link-label, -#page-links a.right:active .link-label { - text-align: right; display: block; position: absolute; top : 120 %; right : 0; -} -/* hide description and remove it from static HTML flow, until user hovers over link */ -#page-links a.right:link .text, -#page-links a.right:visited .text { - display: none; -} -#page-links a.right:hover .text, -#page-links a.right:focus .text, -#page-links a.right:active .text { - text-align: right; display: block; position: absolute; right : 0; top: 145%; -} -/* properties for each of the page-links */ -a#overview .background-image { - background-image : url(graphics/icons/ctool/overview72.gif); visibility : hidden; -} -a#tutorials .background-image { - background-image : url(graphics/icons/ctool/tutorials72.gif); visibility : hidden; -} -a#samples .background-image { - background-image : url(graphics/icons/ctool/samples72.gif); visibility : hidden; -} -a#news .background-image { - background-image : url(graphics/icons/ctool/whatsnew72.gif); visibility : hidden; -} -/* show the hover image on hover, focus, and active */ -#page-links a:hover .background-image, -#page-links a:focus .background-image, -#page-links a:active .background-image { - visibility : visible; -} -/* - * Set up the action links - */ -#action-links { - width : 98%; position : absolute; left : 0px; top : 20px; -} -#action-links a#workbench { - position : absolute; top : -16px; right : -8px; text-align : right; -} -#action-links a .background-image, -#action-links a #workbench_img { - height : 53px; width : 53px; text-align : center; vertical-align : top; -} -/* special case for mozilla */ -#action-links a > .background-image, -#action-links a > #workbench_img { - vertical-align : middle; -} -/* remove the hover image from the flow of the document, - so it doesn't take up space and change the position - of the main image */ -#action-links a .background-image { - position : absolute; -} -#action-links a#workbench .background-image { - background-image : url(graphics/icons/ctool/wb48.gif); visibility : hidden; -} -#action-links a#workbench:hover .background-image, -#action-links a#workbench:focus .background-image, -#action-links a#workbench:active .background-image { - visibility : visible; - position: absolute; - top: 0px; - right: 0px; -} -/* hide the link and description until users hover over the link */ -#action-links a p .text, #action-links a .link-label { - display : none; -} -#action-links a:hover .link-label, -#action-links a:focus .link-label, -#action-links a:active .link-label { - display : block; width : 16em; - margin-left : 10px; -} -#action-links a:hover p .text, -#action-links a:focus p .text, -#action-links a:active p .text { - display : block; width : 16em; -} -#action-links a:hover, -#action-links a:focus, -#action-links a:active { - border : 0px; -} +/* + * Set up general font colours, sizes, etc. Some of these will override + * settings from the shared CSS + */ +.intro-header H1 { + font-family: Arial, Helvetica, sans-serif; + font-size: 20px; + color: #5B6B74; +/* font-size : 18pt; */ +} +#page-links a .link-label, #action-links a .link-label { + font-size : 13pt; + font-weight : 600; + color : #5B6B74; +} +#page-links a p .text, #action-links a p .text { + font-size : 13pt; + font-weight : 500; + color : #5B6B74; +} +/* + * Set up the content for the root page. + */ +body { + min-width : 770px; + /* since IE doesn't support min-width, use expression */ + width:expression(document.body.clientWidth < 770? "770px": "auto" ); + /* swapped Eclipse background image for Carbide version */ + background-image : url(graphics/rootpage/background_carbide.jpg); + background-repeat : no-repeat; + background-position : top left; + background-color : #CCC; +} +#root { + /* Carbide branding mod */ + /* swapped Eclipse background image for Carbide version */ + /* background-image : url(graphics/rootpage/brandmark.gif); */ + /* background-image : url(graphics/rootpage/brandmark.png); */ + background-repeat : no-repeat; + background-position : bottom left; + min-height : 450px; + height : 100%; + height : expression(document.body.clientHeight < 450? "450px": "100%" ); +} +/* + * Set up the navigation bar. It should be centered in the middle + * of the page + */ +#links-background { + /* removed dot graphic that ran across page! */ + width : 100%; + height : 177px; + margin-top : 18%; + margin-bottom : auto; + text-align : center; +} +/* specify a width for Moz so we can center. + * **Important** If additional links are added, we will have to increase this width + * to accomodate them, otherwise they will wrap to a new line + */ +#links-background > #page-links { + width : 33em; + margin : 0 auto; +} +#page-links { + position : relative; + top : 50px; +} +#page-links a { + position : relative; + width : 86px; + margin-left : 1em; + margin-right : 1em; + text-align : center; + vertical-align : top; +} +/* float left for Moz so the items all appear inline */ +#page-links > a { + float : left; + position : relative; +} +#page-links a img { + height : 72px; /* was 82 */ + width : 72px; /* was 82 */ + vertical-align : middle; +} +/* remove the hover image from the flow of the document, + so it doesn't take up space and change the position + of the link label and descriptions */ +#page-links a .background-image { + position : absolute; +} +/* properly align the link label and text based on class (left vs. right) */ +#page-links a:hover { + /* This is needed for IE to force the hover pseudo selectors below to work.*/ + padding : 0 em; +} +/* Hide both the label and the description of the link and remove them from static HTML flow, until user hovers over link */ +/* First, set the width of both the label and the description to a max of 15 em. */ +/* This can be changed when translated to different country locals. */ +#page-links a span { + width : 16em; +} +/* Set up left links orientation first. */ +#page-links a.left:link .link-label, +#page-links a.left:visited .link-label { + display: none; +} +#page-links a.left:hover .link-label, +#page-links a.left:focus .link-label, +#page-links a.left:active .link-label { + text-align: left; + display: block; + position: absolute; + top : 120 %; + left : 0; +} +/* hide description and remove it from static HTML flow, until user hovers over link */ +#page-links a.left:link .text, +#page-links a.left:visited .text { + display: none; +} +#page-links a.left:hover .text, +#page-links a.left:focus .text, +#page-links a.left:active .text { + text-align: left; + display: block; + position: absolute; + left : 0; + top: 145%; +} +/* Set up right links orientation now. */ +#page-links a.right:link .link-label, +#page-links a.right:visited .link-label { + display: none; +} +#page-links a.right:hover .link-label, +#page-links a.right:focus .link-label, +#page-links a.right:active .link-label { + text-align: right; + display: block; + position: absolute; + top : 120 %; + right : 0; +} +/* hide description and remove it from static HTML flow, until user hovers over link */ +#page-links a.right:link .text, +#page-links a.right:visited .text { + display: none; +} +#page-links a.right:hover .text, +#page-links a.right:focus .text, +#page-links a.right:active .text { + text-align: right; + display: block; + position: absolute; + right : 0; + top: 145%; +} +/* properties for each of the page-links */ +a#overview .background-image { + background-image : url(graphics/icons/ctool/overview72.gif); + visibility : hidden; +} +a#tutorials .background-image { + background-image : url(graphics/icons/ctool/tutorials72.gif); + visibility : hidden; +} +a#samples .background-image { + background-image : url(graphics/icons/ctool/samples72.gif); + visibility : hidden; +} +a#news .background-image { + background-image : url(graphics/icons/ctool/whatsnew72.gif); + visibility : hidden; +} +/* show the hover image on hover, focus, and active */ +#page-links a:hover .background-image, +#page-links a:focus .background-image, +#page-links a:active .background-image { + visibility : visible; +} +/* + * Set up the action links + */ +#action-links { + width : 98%; + position : absolute; + left : 0px; + top : 20px; +} +#action-links a#workbench { + position : absolute; + top : -16px; + right : -8px; + text-align : right; +} +#action-links a .background-image, +#action-links a #workbench_img { + height : 53px; + width : 53px; + text-align : center; + vertical-align : top; +} +/* special case for mozilla */ +#action-links a > .background-image, +#action-links a > #workbench_img { + vertical-align : middle; +} +/* remove the hover image from the flow of the document, + so it doesn't take up space and change the position + of the main image */ +#action-links a .background-image { + position : absolute; +} +#action-links a#workbench .background-image { + background-image : url(graphics/icons/ctool/wb48.gif); + visibility : hidden; +} +#action-links a#workbench:hover .background-image, +#action-links a#workbench:focus .background-image, +#action-links a#workbench:active .background-image { + visibility : visible; + position: absolute; + top: 0px; + right: 0px; +} +/* hide the link and description until users hover over the link */ +#action-links a p .text, #action-links a .link-label { + display : none; +} +#action-links a:hover .link-label, +#action-links a:focus .link-label, +#action-links a:active .link-label { + display : block; + width : 16em; + margin-left : 10px; +} +#action-links a:hover p .text, +#action-links a:focus p .text, +#action-links a:active p .text { + display : block; + width : 16em; +} +#action-links a:hover, +#action-links a:focus, +#action-links a:active { + border : 0px; +} diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp/intro/css/root_swt.properties --- a/core/com.nokia.carbide.cpp/intro/css/root_swt.properties Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp/intro/css/root_swt.properties Mon Aug 02 17:22:42 2010 -0500 @@ -1,35 +1,35 @@ -# -# intro/css/root_swt.properties -# -root.links-background.page-links.overview.link-icon = intro/css/graphics/icons/etool/overview72.gif -root.links-background.page-links.tutorials.link-icon = intro/css/graphics/icons/etool/tutorials72.gif -root.links-background.page-links.samples.link-icon= intro/css/graphics/icons/etool/samples72.gif -root.links-background.page-links.news.link-icon = intro/css/graphics/icons/etool/whatsnew72.gif -root.action-links.workbench.link-icon = intro/css/graphics/icons/etool/wb48.gif - -root.links-background.page-links.overview.hover-icon = intro/css/graphics/icons/ctool/overview72.gif -root.links-background.page-links.tutorials.hover-icon = intro/css/graphics/icons/ctool/tutorials72.gif -root.links-background.page-links.samples.hover-icon = intro/css/graphics/icons/ctool/samples72.gif -root.links-background.page-links.news.hover-icon = intro/css/graphics/icons/ctool/whatsnew72.gif -root.action-links.workbench.hover-icon = intro/css/graphics/icons/ctool/wb48.gif - - -root.links-background.page-links.overview.small-link-icon = intro/css/graphics/icons/etool/overview48.gif -root.links-background.page-links.tutorials.small-link-icon = intro/css/graphics/icons/etool/tutorials48.gif -root.links-background.page-links.samples.small-link-icon = intro/css/graphics/icons/etool/samples48.gif -root.links-background.page-links.news.small-link-icon = intro/css/graphics/icons/etool/whatsnew48.gif -root.action-links.workbench.small-link-icon = intro/css/graphics/icons/etool/wb48.gif - -root.links-background.page-links.overview.small-hover-icon = intro/css/graphics/icons/ctool/overview48.gif -root.links-background.page-links.tutorials.small-hover-icon = intro/css/graphics/icons/ctool/tutorials48.gif -root.links-background.page-links.samples.small-hover-icon = intro/css/graphics/icons/ctool/samples48.gif -root.links-background.page-links.news.small-hover-icon = intro/css/graphics/icons/ctool/whatsnew48.gif -root.action-links.workbench.small-hover-icon = intro/css/graphics/icons/ctool/wb48.gif - -# added generic carbide icon to set -root.links-background.page-links.carbide.link-icon = icons/brandmark_cpp.gif -root.links-background.page-links.carbide.hover-icon = icons/brandmark_cpp.gif - -root.layout.ncolumns = 1 -root.links-background.page-links.layout.hspacing = 40 -root.layout.vspacing = 35 +# +# intro/css/root_swt.properties +# +root.links-background.page-links.overview.link-icon = intro/css/graphics/icons/etool/overview72.gif +root.links-background.page-links.tutorials.link-icon = intro/css/graphics/icons/etool/tutorials72.gif +root.links-background.page-links.samples.link-icon= intro/css/graphics/icons/etool/samples72.gif +root.links-background.page-links.news.link-icon = intro/css/graphics/icons/etool/whatsnew72.gif +root.action-links.workbench.link-icon = intro/css/graphics/icons/etool/wb48.gif + +root.links-background.page-links.overview.hover-icon = intro/css/graphics/icons/ctool/overview72.gif +root.links-background.page-links.tutorials.hover-icon = intro/css/graphics/icons/ctool/tutorials72.gif +root.links-background.page-links.samples.hover-icon = intro/css/graphics/icons/ctool/samples72.gif +root.links-background.page-links.news.hover-icon = intro/css/graphics/icons/ctool/whatsnew72.gif +root.action-links.workbench.hover-icon = intro/css/graphics/icons/ctool/wb48.gif + + +root.links-background.page-links.overview.small-link-icon = intro/css/graphics/icons/etool/overview48.gif +root.links-background.page-links.tutorials.small-link-icon = intro/css/graphics/icons/etool/tutorials48.gif +root.links-background.page-links.samples.small-link-icon = intro/css/graphics/icons/etool/samples48.gif +root.links-background.page-links.news.small-link-icon = intro/css/graphics/icons/etool/whatsnew48.gif +root.action-links.workbench.small-link-icon = intro/css/graphics/icons/etool/wb48.gif + +root.links-background.page-links.overview.small-hover-icon = intro/css/graphics/icons/ctool/overview48.gif +root.links-background.page-links.tutorials.small-hover-icon = intro/css/graphics/icons/ctool/tutorials48.gif +root.links-background.page-links.samples.small-hover-icon = intro/css/graphics/icons/ctool/samples48.gif +root.links-background.page-links.news.small-hover-icon = intro/css/graphics/icons/ctool/whatsnew48.gif +root.action-links.workbench.small-hover-icon = intro/css/graphics/icons/ctool/wb48.gif + +# added generic carbide icon to set +root.links-background.page-links.carbide.link-icon = icons/Carbide_c_icon_32x32.png +root.links-background.page-links.carbide.hover-icon = icons/Carbide_c_icon_32x32.png + +root.layout.ncolumns = 1 +root.links-background.page-links.layout.hspacing = 40 +root.layout.vspacing = 35 diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp/intro/css/shared.css --- a/core/com.nokia.carbide.cpp/intro/css/shared.css Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp/intro/css/shared.css Mon Aug 02 17:22:42 2010 -0500 @@ -1,280 +1,280 @@ -/* - * Set up general fonts, sizes and colors - */ -body { font-family : Arial, sans-serif; } - -H1, H2, H3, H4, p, a { color : #4D4D4D; } - -.intro-header H1 { - font-size : 16pt; - font-weight : normal; - /* color : #E5E5E5; */ - /* added turquose to titles */ - color : #00A1D0; -} - -h2 { - font-size : 13pt; - font-weight : normal; - /* color : #7B8694; */ - /* changed color to dark gray */ - color : #333333; -} -/* For regular div labels */ -H4 .div-label { - font-size : 10pt; - font-weight : bold; -} - -/* For the main page content's title */ -#content-header H4 .div-label { - font-size : 14pt; - font-weight : normal; - /* color : #8C96A2; */ - /* changed color to dark gray */ - color : #333333; - float : none; - clear : both; -} - -/* Carbide branding mod */ -#copyright-footer{ - width:225px; - position:absolute; - bottom:5px; - left:5px; - font-family: Arial, Helvetica, sans-serif; - font-size: xx-small; - color: #666666; - font-weight: 500; - margin:0px; - padding: 5px; - /* BUGZ#1287 TEST TEST TEST */ - /* height : expression(document.body.clientHeight < 450? "450px": "100%" ); */ - /* top : expression(document.body.clientHeight < 500? "500px" : "100%" ); */ -} - -.page-description { - font-size : 10pt; - float : none; - clear : both; -} - -a { - font-weight : bold; - text-decoration : none; - color : #4D4D4D; -} - -a .link-label { - font-size : 10pt; - font-weight : normal; -} - -#navigation-links a .link-label { - font-size : 9pt; - font-weight : normal; - /* color : #E5E5E5; */ - /* added turquose to links */ - color : #00A1D0; -} - -a .text { - font-size : 8pt; - font-weight : normal; -} - -p .group-description { - font-size : 10pt; - font-weight : normal; -} - - -/* - * Set up other general properties like padding/margins - */ -html, body { width : 100%; height : 100%; } - -html, body, div, h1, h4, p, a { margin : 0px; padding : 0px; } - -.intro-header H1 { padding-top : 10px; margin-left : 10px; } - -/* For regular div labels */ -#page-content div H4 { - padding : 10px; - padding-bottom : 0px; -} - -/* For the main page content's div label */ -#page-content #content-header H4 { - padding-bottom : 10px; - padding-top : 0px; -} - -/* special case for Mozilla's main content-header label. - Mozilla 1.4 needs more room at the top */ -#page-content > #content-header H4 { padding-top : 10px; } - -/* Needed in IE to get shift+tab to show the active image properly */ -a:active { - border : solid 0px; -} - -a img { - border-width : 0; - background-repeat : no-repeat; -} - -/* - * to get scrollbars working in both IE and Mozilla - */ -html,body { overflow: auto; } -html>body { overflow: visible; } - -/* - * Set up the body, decorative background, and navigation for the content - * pages. - * Note: the root page handles its own background and navigation; these - * settings primarily apply to the content pages - */ -body { - background-color : #FFFFFF; - background-repeat : no-repeat; - background-position : bottom right; -} - -#curve-image { -/* width : 100%; - height : 164px; - position : absolute; - top : 0px; - background-image : url(graphics/contentpage/backgroundcurve.gif); - background-repeat : no-repeat; - background-position : top center; - margin : 0; - padding : 0; -*/ -} - -.intro-header { background-color : transparent; z-index : 100;} - -body, .page{ - min-width : 770px; - /* since IE doesn't support min-width, try expression */ - width:expression(document.body.clientWidth < 770? "770px": "auto" ); - min-height : 425px; - height : 100%; - height : expression(document.body.clientHeight < 425? "425px": "100%" ); -} - -.page { - min-height : 475px; - /* Carbide branding mod */ - /* background-image : url(graphics/contentpage/background.jpg); */ - background-image : url(graphics/rootpage/background_carbide.jpg); - background-repeat : repeat-x; - background-position : top left; -} - -#page-content { - background-repeat : no-repeat; - background-position : bottom right; - height : 70%; -} - -/* - * Lay out the navigation links - * (Root page does something similar for its navigation) - */ -#navigation-links { - position : relative; - left : 10px; - top : 5px; - height : 60px; - width : 98%; -} - -#navigation-links a { - padding-left : 5px; - padding-right : 5px; - float : left; - text-align : center; -} - -#navigation-links a img { - height : 52px; - width : 52px; - vertical-align : middle; -} - -#navigation-links a .link-label { display : block; margin-top : 5px;} - -#navigation-links a .text { display : none; } - -#navigation-links a:hover, -#navigation-links a:focus -#navigation-links a:active { border-right : 0px;} - -/* properties for each of the navigation-links */ -#navigation-links a#overview img { background-image : url(graphics/icons/etool/overview48.gif); } -#navigation-links a#overview:hover img, -#navigation-links a#overview:focus img, -#navigation-links a#overview:active img { background-image : url(graphics/icons/ctool/overview48.gif); } -/*#navigation-links a#overview:active img { background-image : url(graphics/icons/ctool/overview48sel.gif); }*/ - -#navigation-links a#tutorials img { background-image : url(graphics/icons/etool/tutorials48.gif); } -#navigation-links a#tutorials:hover img, -#navigation-links a#tutorials:active img, -#navigation-links a#tutorials:focus img { background-image : url(graphics/icons/ctool/tutorials48.gif); } -/*#navigation-links a#tutorials:active img { background-image : url(graphics/icons/ctool/tutorials48sel.gif); }*/ - -#navigation-links a#samples img { background-image : url(graphics/icons/etool/samples48.gif); } -#navigation-links a#samples:hover img, -#navigation-links a#samples:active img, -#navigation-links a#samples:focus img { background-image : url(graphics/icons/ctool/samples48.gif); } -/*#navigation-links a#samples:active img { background-image : url(graphics/icons/ctool/samples48sel.gif); }*/ - -#navigation-links a#news img { background-image : url(graphics/icons/etool/whatsnew48.gif); } -#navigation-links a#news:hover img, -#navigation-links a#news:focus img, -#navigation-links a#news:active img { background-image : url(graphics/icons/ctool/whatsnew48.gif); } -/*#navigation-links a#news:active img { background-image : url(graphics/icons/ctool/whatsnew48sel.gif); }*/ - -#navigation-links a#workbench { position : absolute; right : 0px; top : -35px; text-align : right;} -#navigation-links a#workbench .text { display : none; } -#navigation-links a#workbench img { background-image : url(graphics/icons/etool/wb48.gif); width : 53px; height : 53px;} -#navigation-links a#workbench:hover img, -#navigation-links a#workbench:focus img, -#navigation-links a#workbench:active img { background-image : url(graphics/icons/ctool/wb48.gif); } - -/* - * Lay out the page title and description - */ -h1, p { margin-left : 10px; } /* required in mozilla so the page description is properly indented */ - -/* position the page content so that the page title overlays the bottom - * of the background image, but make sure the content is always on top - * (using z-index) */ -#page-content { - float : none; - clear : both; - text-align : center; - margin-top : 35px; -} - -.page > #page-content { margin-top : 50px; } - -#page-content p { - padding-bottom : 15px; - text-align : left; - float : none; - clear : both; -} - -#page-content #content-header H4, .page-description { - text-align : left; - margin-right : 10px; - float : none; - clear : both; -} - +/* + * Set up general fonts, sizes and colors + */ +body { font-family : Arial, sans-serif; } + +H1, H2, H3, H4, p, a { color : #5B6B74; } + +.intro-header H1 { + font-size : 16pt; + font-weight : normal; + /* color : #E5E5E5; */ + /* added turquose to titles */ + color : #5B6B74; +} + +h2 { + font-size : 13pt; + font-weight : normal; + /* color : #7B8694; */ + /* changed color to dark gray */ + color : #5B6B74; +} +/* For regular div labels */ +H4 .div-label { + font-size : 10pt; + font-weight : bold; +} + +/* For the main page content's title */ +#content-header H4 .div-label { + font-size : 14pt; + font-weight : normal; + /* color : #8C96A2; */ + /* changed color to dark gray */ + color : #5B6B74; + float : none; + clear : both; +} + +/* Carbide branding mod */ +#copyright-footer{ + width:225px; + position:absolute; + bottom:5px; + left:5px; + font-family: Arial, Helvetica, sans-serif; + font-size: xx-small; + color: #666666; + font-weight: 500; + margin:0px; + padding: 5px; + /* BUGZ#1287 TEST TEST TEST */ + /* height : expression(document.body.clientHeight < 450? "450px": "100%" ); */ + /* top : expression(document.body.clientHeight < 500? "500px" : "100%" ); */ +} + +.page-description { + font-size : 10pt; + float : none; + clear : both; +} + +a { + font-weight : bold; + text-decoration : none; + color : #5B6B74; +} + +a .link-label { + font-size : 10pt; + font-weight : normal; +} + +#navigation-links a .link-label { + font-size : 9pt; + font-weight : normal; + /* color : #E5E5E5; */ + /* added turquose to links */ + color : #5B6B74; +} + +a .text { + font-size : 8pt; + font-weight : normal; +} + +p .group-description { + font-size : 10pt; + font-weight : normal; +} + + +/* + * Set up other general properties like padding/margins + */ +html, body { width : 100%; height : 100%; } + +html, body, div, h1, h4, p, a { margin : 0px; padding : 0px; } + +.intro-header H1 { padding-top : 10px; margin-left : 10px; } + +/* For regular div labels */ +#page-content div H4 { + padding : 10px; + padding-bottom : 0px; +} + +/* For the main page content's div label */ +#page-content #content-header H4 { + padding-bottom : 10px; + padding-top : 0px; +} + +/* special case for Mozilla's main content-header label. + Mozilla 1.4 needs more room at the top */ +#page-content > #content-header H4 { padding-top : 10px; } + +/* Needed in IE to get shift+tab to show the active image properly */ +a:active { + border : solid 0px; +} + +a img { + border-width : 0; + background-repeat : no-repeat; +} + +/* + * to get scrollbars working in both IE and Mozilla + */ +html,body { overflow: auto; } +html>body { overflow: visible; } + +/* + * Set up the body, decorative background, and navigation for the content + * pages. + * Note: the root page handles its own background and navigation; these + * settings primarily apply to the content pages + */ +body { + background-color : #FFFFFF; + background-repeat : no-repeat; + background-position : bottom right; +} + +#curve-image { +/* width : 100%; + height : 164px; + position : absolute; + top : 0px; + background-image : url(graphics/contentpage/backgroundcurve.gif); + background-repeat : no-repeat; + background-position : top center; + margin : 0; + padding : 0; +*/ +} + +.intro-header { background-color : transparent; z-index : 100;} + +body, .page{ + min-width : 770px; + /* since IE doesn't support min-width, try expression */ + width:expression(document.body.clientWidth < 770? "770px": "auto" ); + min-height : 425px; + height : 100%; + height : expression(document.body.clientHeight < 425? "425px": "100%" ); +} + +.page { + min-height : 475px; + /* Carbide branding mod */ + /* background-image : url(graphics/contentpage/background.jpg); */ + background-image : url(graphics/rootpage/background_carbide.jpg); + background-repeat : repeat-x; + background-position : top left; +} + +#page-content { + background-repeat : no-repeat; + background-position : bottom right; + height : 70%; +} + +/* + * Lay out the navigation links + * (Root page does something similar for its navigation) + */ +#navigation-links { + position : relative; + left : 10px; + top : 5px; + height : 60px; + width : 98%; +} + +#navigation-links a { + padding-left : 5px; + padding-right : 5px; + float : left; + text-align : center; +} + +#navigation-links a img { + height : 52px; + width : 52px; + vertical-align : middle; +} + +#navigation-links a .link-label { display : block; margin-top : 5px;} + +#navigation-links a .text { display : none; } + +#navigation-links a:hover, +#navigation-links a:focus +#navigation-links a:active { border-right : 0px;} + +/* properties for each of the navigation-links */ +#navigation-links a#overview img { background-image : url(graphics/icons/etool/overview48.gif); } +#navigation-links a#overview:hover img, +#navigation-links a#overview:focus img, +#navigation-links a#overview:active img { background-image : url(graphics/icons/ctool/overview48.gif); } +/*#navigation-links a#overview:active img { background-image : url(graphics/icons/ctool/overview48sel.gif); }*/ + +#navigation-links a#tutorials img { background-image : url(graphics/icons/etool/tutorials48.gif); } +#navigation-links a#tutorials:hover img, +#navigation-links a#tutorials:active img, +#navigation-links a#tutorials:focus img { background-image : url(graphics/icons/ctool/tutorials48.gif); } +/*#navigation-links a#tutorials:active img { background-image : url(graphics/icons/ctool/tutorials48sel.gif); }*/ + +#navigation-links a#samples img { background-image : url(graphics/icons/etool/samples48.gif); } +#navigation-links a#samples:hover img, +#navigation-links a#samples:active img, +#navigation-links a#samples:focus img { background-image : url(graphics/icons/ctool/samples48.gif); } +/*#navigation-links a#samples:active img { background-image : url(graphics/icons/ctool/samples48sel.gif); }*/ + +#navigation-links a#news img { background-image : url(graphics/icons/etool/whatsnew48.gif); } +#navigation-links a#news:hover img, +#navigation-links a#news:focus img, +#navigation-links a#news:active img { background-image : url(graphics/icons/ctool/whatsnew48.gif); } +/*#navigation-links a#news:active img { background-image : url(graphics/icons/ctool/whatsnew48sel.gif); }*/ + +#navigation-links a#workbench { position : absolute; right : 0px; top : -35px; text-align : right;} +#navigation-links a#workbench .text { display : none; } +#navigation-links a#workbench img { background-image : url(graphics/icons/etool/wb48.gif); width : 53px; height : 53px;} +#navigation-links a#workbench:hover img, +#navigation-links a#workbench:focus img, +#navigation-links a#workbench:active img { background-image : url(graphics/icons/ctool/wb48.gif); } + +/* + * Lay out the page title and description + */ +h1, p { margin-left : 10px; } /* required in mozilla so the page description is properly indented */ + +/* position the page content so that the page title overlays the bottom + * of the background image, but make sure the content is always on top + * (using z-index) */ +#page-content { + float : none; + clear : both; + text-align : center; + margin-top : 35px; +} + +.page > #page-content { margin-top : 50px; } + +#page-content p { + padding-bottom : 15px; + text-align : left; + float : none; + clear : both; +} + +#page-content #content-header H4, .page-description { + text-align : left; + margin-right : 10px; + float : none; + clear : both; +} + diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.cpp/plugin.xml --- a/core/com.nokia.carbide.cpp/plugin.xml Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.cpp/plugin.xml Mon Aug 02 17:22:42 2010 -0500 @@ -37,7 +37,7 @@ value="Carbide.c++ v3.0.0 for Symbian"/> + value="intro/css/graphics/rootpage/brandmark.png"/> diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/icons/icon_home.png Binary file core/com.nokia.carbide.discovery.ui/icons/icon_home.png has changed diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/plugin.xml --- a/core/com.nokia.carbide.discovery.ui/plugin.xml Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/plugin.xml Mon Aug 02 17:22:42 2010 -0500 @@ -49,6 +49,7 @@ @@ -66,11 +67,18 @@ order="100" title="%support.title"> + + @@ -81,19 +89,34 @@ + + + + diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/schema/portalPage.exsd --- a/core/com.nokia.carbide.discovery.ui/schema/portalPage.exsd Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/schema/portalPage.exsd Mon Aug 02 17:22:42 2010 -0500 @@ -83,6 +83,16 @@ + + + + optionally provide command bars visible in all layers + + + + + + diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/schema/portalPageLayer.exsd --- a/core/com.nokia.carbide.discovery.ui/schema/portalPageLayer.exsd Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/schema/portalPageLayer.exsd Mon Aug 02 17:22:42 2010 -0500 @@ -76,6 +76,13 @@ + + + + relative ordering of layers on a page (integer used to sort layers) + + + diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Activator.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Activator.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Activator.java Mon Aug 02 17:22:42 2010 -0500 @@ -21,18 +21,24 @@ import java.io.IOException; import java.io.InputStream; import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.text.MessageFormat; import java.util.Properties; import org.eclipse.core.net.proxy.IProxyData; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.osgi.service.datalocation.Location; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; @@ -50,6 +56,8 @@ private static final String PROPERTY_PROXYPORT = "network.proxy_port"; //$NON-NLS-1$ private static final String PROPERTY_PROXYHOST = "network.proxy_host"; //$NON-NLS-1$ + + private boolean proxyDataAvailable; /** * The constructor @@ -64,13 +72,66 @@ public void start(BundleContext context) throws Exception { plugin = this; super.start(context); - IProxyData proxyData = ProxyUtils.getProxyData(new URI("http://www.yahoo.com")); //$NON-NLS-1$ - if (proxyData != null) { - System.setProperty(PROPERTY_PROXYHOST, proxyData.getHost()); - System.setProperty(PROPERTY_PROXYPORT, String.valueOf(proxyData.getPort())); - } + Job j = new Job("Getting proxy info") { + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + IProxyData proxyData = ProxyUtils.getProxyData(new URI("http://www.yahoo.com")); + if (proxyData != null) { + System.setProperty(PROPERTY_PROXYHOST, proxyData.getHost()); + System.setProperty(PROPERTY_PROXYPORT, String.valueOf(proxyData.getPort())); + } + } catch (URISyntaxException e) { + } //$NON-NLS-1$ + setProxyDataAvailable(); + return Status.OK_STATUS; + } + }; + j.setSystem(true); + j.setUser(false); + j.schedule(); + } + + private synchronized void setProxyDataAvailable() { + proxyDataAvailable = true; + } + + public synchronized boolean isProxyDataAvailable() { + return proxyDataAvailable; } + public static void runInUIThreadWhenProxyDataSet(final Control control, final Runnable r) { + Job j = new Job("") { + @Override + protected IStatus run(IProgressMonitor monitor) { + setBusyCursor(control, true); + Activator activator = getDefault(); + while (!activator.isProxyDataAvailable()) { + try { + Thread.sleep(200); + } catch (InterruptedException e) { + } + } + setBusyCursor(control, false); + Display.getDefault().asyncExec(r); + return Status.OK_STATUS; + } + }; + j.setSystem(true); + j.setUser(false); + j.schedule(); + } + + public static void setBusyCursor(final Control control, final boolean isBusy) { + final Display display = control.getDisplay(); + display.syncExec(new Runnable() { + @Override + public void run() { + control.setCursor(isBusy ? display.getSystemCursor(SWT.CURSOR_WAIT) : null); + } + }); + } + /* * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.discovery.ui; import org.eclipse.osgi.util.NLS; @@ -15,26 +31,30 @@ public static String AbstractBrowserPortalPageLayer_OpenLocationTitle; public static String AbstractBrowserPortalPageLayer_ShowInBrowserLabel; public static String AbstractBrowserPortalPageLayer_URLLabel; + public static String AbstractDiscoveryPortalPageLayer_AdvancedInstallActionLabel; + public static String AbstractDiscoveryPortalPageLayer_CheckAllActionLabel; + public static String AbstractDiscoveryPortalPageLayer_CheckedItemsStatusMessage; + public static String AbstractDiscoveryPortalPageLayer_GatheringExtensionsDesc; + public static String AbstractDiscoveryPortalPageLayer_GatheringInstallInfoDesc; + public static String AbstractDiscoveryPortalPageLayer_InstallActionLabel; + public static String AbstractDiscoveryPortalPageLayer_InstallActionTooltip; + public static String AbstractDiscoveryPortalPageLayer_RefreshActionLabel; + public static String AbstractDiscoveryPortalPageLayer_Title; + public static String AbstractDiscoveryPortalPageLayer_UncheckAllActionLabel; public static String AbstractRSSPortalPageLayer_ReturnToFeedLabel; public static String AbstractRSSPortalPageLayer_RSSReadError; public static String Activator_MissingConfigURLError; - public static String InstallExtensionsPage_AdvancedInstallLabel; - public static String InstallExtensionsPage_BuzillaActionName; - public static String InstallExtensionsPage_CheckAllLabel; - public static String InstallExtensionsPage_GatherExtensionsTitle; - public static String InstallExtensionsPage_GatheringInstallInfoTitle; - public static String InstallExtensionsPage_InstallLabel; - public static String InstallExtensionsPage_InstallTip; - public static String InstallExtensionsPage_LinkBarTitle; - public static String InstallExtensionsPage_RefreshLabel; - public static String InstallExtensionsPage_StatusLineFmt; - public static String InstallExtensionsPage_UncheckAllLabel; - public static String InstallExtensionsPortalExtension_InstallExtensionsTitle; + public static String PortalEditor_BadCommandBarFactoryError; public static String PortalEditor_Name; public static String PortalEditor_NoLayersError; public static String PortalEditor_PageLoadError; public static String PortalEditor_PageOpenError; public static String PortalEditor_PageRankError; + public static String SettingsBarCreator_CapabilitiesActionLabel; + public static String SettingsBarCreator_CodeStyleActionLabel; + public static String SettingsBarCreator_KeyBindingsActionLabel; + public static String SettingsBarCreator_ProxiesActionLabel; + public static String SettingsBarCreator_Title; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties Mon Aug 02 17:22:42 2010 -0500 @@ -9,23 +9,27 @@ AbstractBrowserPortalPageLayer_OpenLocationTitle=Open Location AbstractBrowserPortalPageLayer_ShowInBrowserLabel=Show in browser AbstractBrowserPortalPageLayer_URLLabel=URL: +AbstractDiscoveryPortalPageLayer_AdvancedInstallActionLabel=Advanced install... +AbstractDiscoveryPortalPageLayer_CheckAllActionLabel=Check all +AbstractDiscoveryPortalPageLayer_CheckedItemsStatusMessage={0} item(s) checked +AbstractDiscoveryPortalPageLayer_GatheringExtensionsDesc=Gathering Extensions +AbstractDiscoveryPortalPageLayer_GatheringInstallInfoDesc=Gathering Install Information +AbstractDiscoveryPortalPageLayer_InstallActionLabel=Install... +AbstractDiscoveryPortalPageLayer_InstallActionTooltip=Install checked items +AbstractDiscoveryPortalPageLayer_RefreshActionLabel=Refresh +AbstractDiscoveryPortalPageLayer_Title=Install Extensions +AbstractDiscoveryPortalPageLayer_UncheckAllActionLabel=Check none AbstractRSSPortalPageLayer_ReturnToFeedLabel=Return to RSS AbstractRSSPortalPageLayer_RSSReadError=Could not read RSS from: {0} Activator_MissingConfigURLError=Could not find URL in configuration/server.properties file for key={0} -InstallExtensionsPage_AdvancedInstallLabel=Advanced install... -InstallExtensionsPage_BuzillaActionName=Carbide Bugzilla -InstallExtensionsPage_CheckAllLabel=Check all -InstallExtensionsPage_GatherExtensionsTitle=Gathering Extensions -InstallExtensionsPage_GatheringInstallInfoTitle=Gathering Install Information -InstallExtensionsPage_InstallLabel=Install... -InstallExtensionsPage_InstallTip=Install checked items -InstallExtensionsPage_LinkBarTitle=Links -InstallExtensionsPage_RefreshLabel=Refresh -InstallExtensionsPage_StatusLineFmt={0} item(s) checked -InstallExtensionsPage_UncheckAllLabel=Check none -InstallExtensionsPortalExtension_InstallExtensionsTitle=Install Extensions +PortalEditor_BadCommandBarFactoryError=Command bar factory class could not be created for id: {0 PortalEditor_Name=Carbide Portal PortalEditor_NoLayersError=Could not load portal page because no layers were found for id: {0} PortalEditor_PageLoadError=Could not load portal page PortalEditor_PageOpenError=Could not open portal -PortalEditor_PageRankError=Could not get rank for portal page {0} +PortalEditor_PageRankError=Could not get order value for portal page or layer: {0} +SettingsBarCreator_CapabilitiesActionLabel=Capabilities +SettingsBarCreator_CodeStyleActionLabel=Code Style +SettingsBarCreator_KeyBindingsActionLabel=Key bindings +SettingsBarCreator_ProxiesActionLabel=Proxies +SettingsBarCreator_Title=Settings diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/ActionUIUpdater.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/ActionUIUpdater.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/ActionUIUpdater.java Mon Aug 02 17:22:42 2010 -0500 @@ -19,7 +19,7 @@ import java.util.ArrayList; import java.util.List; -import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer.IActionUIUpdater; +import com.nokia.carbide.internal.discovery.ui.extension.IActionUIUpdater; class ActionUIUpdater implements IActionUIUpdater { diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalEditor.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalEditor.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalEditor.java Mon Aug 02 17:22:42 2010 -0500 @@ -54,12 +54,24 @@ import com.nokia.carbide.discovery.ui.Activator; import com.nokia.carbide.discovery.ui.Messages; +import com.nokia.carbide.internal.discovery.ui.extension.ICommandBarFactory; import com.nokia.carbide.internal.discovery.ui.extension.IPortalEditor; import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer; import com.nokia.cpp.internal.api.utils.core.Pair; import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; public class PortalEditor extends EditorPart implements IPortalEditor { + + class LayerExtension { + public LayerExtension(IPortalPageLayer layer, String title, int order) { + this.layer = layer; + this.title = title; + this.order = order; + } + public IPortalPageLayer layer; + public String title; + public int order; + } private static final String ID = "com.nokia.carbide.discovery.ui.portalEditor"; //$NON-NLS-1$ private static final String CONTEXT_ID = ID + ".context"; //$NON-NLS-1$ @@ -76,19 +88,20 @@ loadPortalPages(); } - private Map>> loadPortalLayers() { - Map>> pageIdToExtensionsMap = - new HashMap>>(); + private Map> loadPortalLayers() { + Map> pageIdToExtensionsMap = + new HashMap>(); IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Activator.PLUGIN_ID + ".portalPageLayer"); //$NON-NLS-1$ for (IConfigurationElement element : elements) { String pageId = element.getAttribute("pageId"); //$NON-NLS-1$ String title = element.getAttribute("title"); //$NON-NLS-1$ + int order = getOrderStringFromElement(element, title); try { IPortalPageLayer extension = (IPortalPageLayer) element.createExecutableExtension("class"); //$NON-NLS-1$ if (!pageIdToExtensionsMap.containsKey(pageId)) - pageIdToExtensionsMap.put(pageId, new ArrayList>()); - pageIdToExtensionsMap.get(pageId).add(new Pair(extension, title)); + pageIdToExtensionsMap.put(pageId, new ArrayList()); + pageIdToExtensionsMap.get(pageId).add(new LayerExtension(extension, title, order)); } catch (CoreException e) { Activator.logError(MessageFormat.format(Messages.PortalEditor_PageLoadError, pageId), e); } @@ -97,31 +110,30 @@ } private void loadPortalPages() { - Map>> portalLayersMap = loadPortalLayers(); + Map> portalLayersMap = loadPortalLayers(); List> pageList = new ArrayList>(); IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Activator.PLUGIN_ID + ".portalPage"); //$NON-NLS-1$ for (IConfigurationElement element : elements) { String id = element.getAttribute("id"); //$NON-NLS-1$ - int order = Integer.MAX_VALUE; - String orderString = element.getAttribute("order"); //$NON-NLS-1$ - if (orderString != null) { - try { - order = Integer.parseInt(orderString); - } - catch (NumberFormatException e) { - Activator.logError(MessageFormat.format(Messages.PortalEditor_PageRankError, id), e); - } - } + int order = getOrderStringFromElement(element, id); String title = element.getAttribute("title"); //$NON-NLS-1$ String imageFilePath = element.getAttribute("image"); //$NON-NLS-1$ String pluginId = element.getContributor().getName(); ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imageFilePath); - List> portalLayers = portalLayersMap.get(id); + List portalLayers = portalLayersMap.get(id); if (portalLayers == null || portalLayers.isEmpty()) { Activator.logError(MessageFormat.format(Messages.PortalEditor_NoLayersError, id), null); } - PortalPage portalPage = new PortalPage(title, imageDesc, id, portalLayers); + ICommandBarFactory commandBarFactory = null; + if (element.getAttribute("class") != null) { //$NON-NLS-1$ + try { + commandBarFactory = (ICommandBarFactory) element.createExecutableExtension("class"); //$NON-NLS-1$ + } catch (CoreException e) { + Activator.logError(MessageFormat.format(Messages.PortalEditor_BadCommandBarFactoryError, id), e); + } + } + PortalPage portalPage = new PortalPage(title, imageDesc, id, portalLayers, commandBarFactory); pageList.add(new Pair(portalPage, order)); } Collections.sort(pageList, new Comparator>() { @@ -136,6 +148,20 @@ } } + private int getOrderStringFromElement(IConfigurationElement element, String id) { + int order = Integer.MAX_VALUE; + String orderString = element.getAttribute("order"); //$NON-NLS-1$ + if (orderString != null) { + try { + order = Integer.parseInt(orderString); + } + catch (NumberFormatException e) { + Activator.logError(MessageFormat.format(Messages.PortalEditor_PageRankError, id), e); + } + } + return order; + } + @Override public void doSave(IProgressMonitor monitor) { } diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalPage.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalPage.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalPage.java Mon Aug 02 17:22:42 2010 -0500 @@ -17,6 +17,8 @@ package com.nokia.carbide.internal.discovery.ui.editor; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.eclipse.jface.action.Action; @@ -29,9 +31,10 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import com.nokia.carbide.internal.discovery.ui.editor.PortalEditor.LayerExtension; +import com.nokia.carbide.internal.discovery.ui.extension.IActionBar; +import com.nokia.carbide.internal.discovery.ui.extension.ICommandBarFactory; import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer; -import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer.IActionBar; -import com.nokia.cpp.internal.api.utils.core.Pair; public class PortalPage implements IActionBar { @@ -90,26 +93,34 @@ } } - private String id; private String title; private ImageDescriptor imageDescriptor; + private String id; + private final ICommandBarFactory commandBarFactory; private StackComposite pageComposite; private boolean initialized; private List layers; private Layer currentLayer; private IAction[] actions; - private List navigationTaskBars; + private List pageTaskBars; public PortalPage(String title, ImageDescriptor imageDescriptor, String id, - List> layerExtensionPairs) { + List layerExtensions, ICommandBarFactory commandBarFactory) { this.title = title; this.imageDescriptor = imageDescriptor; this.id = id; - layers = new ArrayList(layerExtensionPairs.size()); - for (Pair layerExtensionTitlePair : layerExtensionPairs) { - layers.add(new Layer(layerExtensionTitlePair.first, layerExtensionTitlePair.second)); + this.commandBarFactory = commandBarFactory; + layers = new ArrayList(layerExtensions.size()); + Collections.sort(layerExtensions, new Comparator() { + @Override + public int compare(LayerExtension o1, LayerExtension o2) { + return o1.order - o2.order; + } + }); + for (LayerExtension layerExtension : layerExtensions) { + layers.add(new Layer(layerExtension.layer, layerExtension.title)); } - navigationTaskBars = new ArrayList(layerExtensionPairs.size()); + pageTaskBars = new ArrayList(layerExtensions.size()); } public String getId() { @@ -157,12 +168,22 @@ GridDataFactory.fillDefaults().grab(false, true).applyTo(taskComposite); TaskBar taskBar = new TaskBar(taskComposite, backgroundParent, this); GridDataFactory.fillDefaults().minSize(150, SWT.DEFAULT).grab(true, false).indent(0, 0).applyTo(taskBar); - navigationTaskBars.add(taskBar); + pageTaskBars.add(taskBar); ActionUIUpdater updater = new ActionUIUpdater(); - IActionBar[] commandBars = layerExtension.createCommandBars(portalEditor, updater); + createCommandBars(backgroundParent, taskComposite, updater, + layerExtension.createCommandBars(portalEditor, updater)); + if (commandBarFactory != null) { + createCommandBars(backgroundParent, taskComposite, updater, + commandBarFactory.createCommandBars(portalEditor, updater)); + + } + } + + private void createCommandBars(Composite backgroundParent, Composite taskComposite, + ActionUIUpdater updater, IActionBar[] commandBars) { if (commandBars != null) { for (IActionBar actionBar : commandBars) { - taskBar = new TaskBar(taskComposite, backgroundParent, actionBar); + TaskBar taskBar = new TaskBar(taskComposite, backgroundParent, actionBar); updater.addTaskBar(taskBar); GridDataFactory.fillDefaults().minSize(150, SWT.DEFAULT).grab(true, false).indent(0, 0).applyTo(taskBar); } @@ -201,7 +222,7 @@ pageComposite.showControl(currentLayer.getControl()); if (!currentLayer.isInitialized()) currentLayer.initialize(); - for (TaskBar taskBar : navigationTaskBars) { + for (TaskBar taskBar : pageTaskBars) { taskBar.updateAllActionsUI(); } } diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/StackComposite.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/StackComposite.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/StackComposite.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.internal.discovery.ui.editor; import org.eclipse.swt.custom.StackLayout; diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java Mon Aug 02 17:22:42 2010 -0500 @@ -31,7 +31,7 @@ import org.eclipse.ui.forms.events.IHyperlinkListener; import org.eclipse.ui.forms.widgets.Hyperlink; -import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer.IActionBar; +import com.nokia.carbide.internal.discovery.ui.extension.IActionBar; class TaskBar extends RoundedCornerComposite { @@ -112,14 +112,18 @@ for (Entry entry : linkToActionMap.entrySet()) { IAction action = entry.getValue(); if (actionId.equals(action.getId())) { - entry.getKey().setEnabled(action.isEnabled()); + Hyperlink link = entry.getKey(); + if (link != null && !link.isDisposed()) + link.setEnabled(entry.getValue().isEnabled()); } } } public void updateAllActionsUI() { for (Entry entry : linkToActionMap.entrySet()) { - entry.getKey().setEnabled(entry.getValue().isEnabled()); + Hyperlink link = entry.getKey(); + if (link != null && !link.isDisposed()) + link.setEnabled(entry.getValue().isEnabled()); } } diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractBrowserPortalPageLayer.java Mon Aug 02 17:22:42 2010 -0500 @@ -111,8 +111,8 @@ updater.updateAll(); } - private void setLoading(boolean loading) { - browser.setCursor(loading ? browser.getDisplay().getSystemCursor(SWT.CURSOR_WAIT) : null); + public void setLoading(boolean loading) { + Activator.setBusyCursor(browser, loading); this.loading = loading; } @@ -156,13 +156,19 @@ @Override public void init() { if (browser != null) { - URL url = getURL(); - if (url != null) { - browser.setUrl(url.toString()); - } - actionBar.hookBrowser(); + Activator.runInUIThreadWhenProxyDataSet(browser, new Runnable() { + @Override + public void run() { + URL url = getURL(); + if (url != null) { + browser.setUrl(url.toString()); + actionBar.setLoading(true); + } + actionBar.hookBrowser(); + actionBar.update(); + } + }); } - actionBar.update(); } @Override diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractDiscoveryPortalPageLayer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractDiscoveryPortalPageLayer.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,324 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.extension; + +import java.net.URI; +import java.net.URISyntaxException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.equinox.internal.p2.discovery.Catalog; +import org.eclipse.equinox.internal.p2.discovery.DiscoveryCore; +import org.eclipse.equinox.internal.p2.discovery.compatibility.BundleDiscoveryStrategy; +import org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy; +import org.eclipse.equinox.internal.p2.discovery.model.CatalogItem; +import org.eclipse.equinox.internal.p2.ui.discovery.DiscoveryUi; +import org.eclipse.equinox.internal.p2.ui.discovery.wizards.CatalogConfiguration; +import org.eclipse.equinox.internal.p2.ui.discovery.wizards.CatalogViewer; +import org.eclipse.equinox.p2.core.IProvisioningAgent; +import org.eclipse.equinox.p2.operations.ProvisioningSession; +import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; +import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; +import org.eclipse.equinox.p2.ui.ProvisioningUI; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.actions.BaseSelectionListenerAction; + +import com.nokia.carbide.discovery.ui.Activator; +import com.nokia.carbide.discovery.ui.Messages; +import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; + +@SuppressWarnings("restriction") +public abstract class AbstractDiscoveryPortalPageLayer implements IPortalPageLayer { + + private class RunnableContextDialog extends ProgressMonitorDialog { + private final String title; + + private RunnableContextDialog(Shell parent, String title) { + super(parent); + this.title = title; + } + + @Override + protected void configureShell(Shell shell) { + super.configureShell(shell); + shell.setText(title); + } + + } + + protected class ActionBar implements IActionBar { + private IAction[] actions; + + public ActionBar(IEditorPart part) { + actions = makeActions(part); + } + + @Override + public String getTitle() { + return Messages.AbstractDiscoveryPortalPageLayer_Title; + } + + @Override + public IAction[] getActions() { + return actions; + } + + @Override + public String[] getHighlightedActionIds() { + return new String[] {INSTALL_ACTION_ID}; + } + } + + protected static final String INSTALL_ACTION_ID = + AbstractDiscoveryPortalPageLayer.class.getName() + ".install"; //$NON-NLS-1$ + protected static final String UNCHECK_ALL_ACTION_ID = + AbstractDiscoveryPortalPageLayer.class.getName() + ".uncheckAll"; //$NON-NLS-1$ + protected static final String CHECK_ALL_ACTION_ID = + AbstractDiscoveryPortalPageLayer.class.getName() + ".checkAll"; //$NON-NLS-1$ + protected static final String ADV_INSTALL_ACTION_ID = + AbstractDiscoveryPortalPageLayer.class.getName() + ".advancedInstall"; //$NON-NLS-1$ + protected static final String REFRESH_ACTION_ID = + AbstractDiscoveryPortalPageLayer.class.getName() + ".refresh"; //$NON-NLS-1$ + + private CatalogViewer viewer; + private List selectionListeners; + private IActionUIUpdater updater; + + @Override + public Control createControl(Composite parent, IEditorPart part) { + Composite c = new Composite(parent, SWT.NONE); + GridLayoutFactory.swtDefaults().applyTo(c); + viewer = new CatalogViewer(getCatalog(), part.getEditorSite(), + new RunnableContextDialog(part.getEditorSite().getShell(), + Messages.AbstractDiscoveryPortalPageLayer_GatheringExtensionsDesc), + getConfiguration()); + viewer.createControl(c); + GridDataFactory.fillDefaults().grab(true, true).applyTo(viewer.getControl()); + + return c; + } + + @Override + public void init() { + if (!WorkbenchUtils.isJUnitRunning()) { // do not initialize the catalog if JUnit is running + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + for (ISelectionChangedListener listener : selectionListeners) { + viewer.addSelectionChangedListener(listener); + } + viewer.updateCatalog(); + } + }); + } + } + + @Override + public IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater) { + this.updater = updater; + return new IActionBar[] { new ActionBar(part) }; + } + + protected CatalogConfiguration getConfiguration() { + CatalogConfiguration configuration = new CatalogConfiguration(); + configuration.setShowTagFilter(false); + return configuration; + } + + protected Catalog getCatalog() { + Catalog catalog = new Catalog(); + catalog.setEnvironment(DiscoveryCore.createEnvironment()); + catalog.setVerifyUpdateSiteAvailability(false); + + // look for remote descriptor + RemoteBundleDiscoveryStrategy remoteDiscoveryStrategy = new RemoteBundleDiscoveryStrategy(); + String url = getDirectoryURL(); + if (url != null) { + remoteDiscoveryStrategy.setDirectoryUrl(url); + catalog.getDiscoveryStrategies().add(remoteDiscoveryStrategy); + } + else // look for descriptors from installed bundles + catalog.getDiscoveryStrategies().add(new BundleDiscoveryStrategy()); + + return catalog; + } + + protected String getDirectoryURL() { + return Activator.getFromServerProperties(getClass().getName()); + } + + protected IAction[] makeActions(final IEditorPart part) { + selectionListeners = new ArrayList(); + List actions = new ArrayList(); + IAction action; + + // install + action = new BaseSelectionListenerAction(Messages.AbstractDiscoveryPortalPageLayer_InstallActionLabel) { + public void run() { + DiscoveryUi.install(viewer.getCheckedItems(), + new RunnableContextDialog(part.getEditorSite().getShell(), + Messages.AbstractDiscoveryPortalPageLayer_GatheringInstallInfoDesc)); + }; + + protected boolean updateSelection(IStructuredSelection selection) { + scheduleUpdateAllActionUIs(); + return !selection.isEmpty(); + }; + }; + action.setToolTipText(Messages.AbstractDiscoveryPortalPageLayer_InstallActionTooltip); + action.setId(INSTALL_ACTION_ID); + selectionListeners.add((ISelectionChangedListener) action); + actions.add(action); + + // refresh + action = new Action(Messages.AbstractDiscoveryPortalPageLayer_RefreshActionLabel) { + public void run() { + viewer.setSelection(StructuredSelection.EMPTY); + viewer.updateCatalog(); + viewer.refresh(); + } + }; + action.setId(REFRESH_ACTION_ID); + actions.add(action); + + // check all + action = new BaseSelectionListenerAction(Messages.AbstractDiscoveryPortalPageLayer_CheckAllActionLabel) { + public void run() { + viewer.setSelection(StructuredSelection.EMPTY); + viewer.setSelection(getAllItemsSelection()); + viewer.refresh(); + } + + private IStructuredSelection getAllItemsSelection() { + List catalogItems = new ArrayList(); + for (CatalogItem catalogItem : viewer.getCatalog().getItems()) { + if (!catalogItem.isInstalled()) + catalogItems.add(catalogItem); + } + return new StructuredSelection(catalogItems); + } + + protected boolean updateSelection(IStructuredSelection selection) { + scheduleUpdateAllActionUIs(); + return !getAllItemsSelection().equals(selection); + } + }; + action.setId(CHECK_ALL_ACTION_ID); + selectionListeners.add((ISelectionChangedListener) action); + actions.add(action); + + // uncheck all + action = new BaseSelectionListenerAction(Messages.AbstractDiscoveryPortalPageLayer_UncheckAllActionLabel) { + public void run() { + viewer.setSelection(StructuredSelection.EMPTY); + viewer.refresh(); + }; + + protected boolean updateSelection(IStructuredSelection selection) { + scheduleUpdateAllActionUIs(); + return !selection.isEmpty(); + }; + }; + action.setId(UNCHECK_ALL_ACTION_ID); + selectionListeners.add((ISelectionChangedListener) action); + actions.add(action); + + // advanced install + action = new Action(Messages.AbstractDiscoveryPortalPageLayer_AdvancedInstallActionLabel) { + public void run() { + showInstallWizard(); + } + }; + action.setId(ADV_INSTALL_ACTION_ID); + actions.add(action); + + ISelectionChangedListener selectionListener = new ISelectionChangedListener() { + @Override + public void selectionChanged(SelectionChangedEvent event) { + IStructuredSelection selection = (IStructuredSelection) event.getSelection(); + IActionBars bars = part.getEditorSite().getActionBars(); + bars.getStatusLineManager().setMessage( + selection.isEmpty() ? null : MessageFormat.format( + Messages.AbstractDiscoveryPortalPageLayer_CheckedItemsStatusMessage, selection.size())); + } + }; + selectionListeners.add(selectionListener); + + return (IAction[]) actions.toArray(new IAction[actions.size()]); + } + + @Override + public void dispose() { + for (ISelectionChangedListener listener : selectionListeners) { + viewer.removeSelectionChangedListener(listener); + } + } + + protected void showInstallWizard() { + ProvisioningUI defaultUI = ProvisioningUI.getDefaultUI(); + ProvisioningSession session = defaultUI.getSession(); + IProvisioningAgent agent = session.getProvisioningAgent(); + IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); + IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME); + for (URI uri : getCatalogURIs()) { + metadataManager.addRepository(uri); + artifactManager.addRepository(uri); + } + defaultUI.openInstallWizard(null, null, null); + } + + protected Collection getCatalogURIs() { + Set uris = new HashSet(); + for (CatalogItem catalogItem : viewer.getCatalog().getItems()) { + try { + uris.add(new URI(catalogItem.getSiteUrl())); + } catch (URISyntaxException e) { + // ignore bad URIs + } + } + return uris; + } + + protected void scheduleUpdateAllActionUIs() { + Display.getDefault().asyncExec(new Runnable() { + @Override + public void run() { + updater.updateAll(); + } + }); + } + +} \ No newline at end of file diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractRSSPortalPageLayer.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractRSSPortalPageLayer.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/AbstractRSSPortalPageLayer.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.internal.discovery.ui.extension; import java.net.URL; @@ -60,17 +76,22 @@ @Override public void init() { - URL url = getURL(); - if (url != null) { - try { - rss = SimpleRSSReader.readRSS(url); - displayRSS(); - actionBar.hookBrowser(); - } catch (Exception e) { - Activator.logError(MessageFormat.format(Messages.AbstractRSSPortalPageLayer_RSSReadError, url), e); + Activator.runInUIThreadWhenProxyDataSet(browser, new Runnable() { + @Override + public void run() { + URL url = getURL(); + if (url != null) { + try { + rss = SimpleRSSReader.readRSS(url); + displayRSS(); + actionBar.hookBrowser(); + } catch (Exception e) { + Activator.logError(MessageFormat.format(Messages.AbstractRSSPortalPageLayer_RSSReadError, url), e); + } + actionBar.update(); + } } - actionBar.update(); - } + }); } private void displayRSS() { @@ -85,16 +106,18 @@ buf.append("
    "); //$NON-NLS-1$ buf.append(clean(channel.getDescription())); buf.append("

    "); //$NON-NLS-1$ + buf.append(""); //$NON-NLS-1$ } buf.append(HTML_BODY_FOOTER); System.out.println(buf.toString()); diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IActionBar.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IActionBar.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.extension; + +import org.eclipse.jface.action.IAction; + +/** + * Interface to an action/navigation bar for the portal portal page layer + */ +public interface IActionBar { + + /** + * Required title for the action bar + * @return String + */ + String getTitle(); + + /** + * Actions shown in the action bar: + * Required: text and run() methods + * Optional: tool tip text + * Unused: image/check + * @return IAction + */ + IAction[] getActions(); + + /** + * Action ids for actions that should be emphasized in the action bar (e.g., bold font) + * @return String[] or null + */ + String[] getHighlightedActionIds(); + +} \ No newline at end of file diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IActionUIUpdater.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IActionUIUpdater.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.extension; + +/** + * Interface allowing the UI for provided actions of an IActionBar to be updated (e.g., enabled state) + */ +public interface IActionUIUpdater { + + /** + * Update the UI for a specific action by id + * @param actionId + */ + void update(String actionId); + + /** + * Update the UI for all actions in the IActionBar + */ + void updateAll(); + +} \ No newline at end of file diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/ICommandBarFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/ICommandBarFactory.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.extension; + +import org.eclipse.ui.IEditorPart; + +/** + * Interface to a factory for command bars for a portal page/layer + */ +public interface ICommandBarFactory { + + /** + * Return action bars for the portal page layer + * @param part IEditorPart + * @param updater IActionUIUpdater + * @return IActionBar[] + */ + IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater); + +} diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPageLayer.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPageLayer.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPageLayer.java Mon Aug 02 17:22:42 2010 -0500 @@ -16,7 +16,6 @@ */ package com.nokia.carbide.internal.discovery.ui.extension; -import org.eclipse.jface.action.IAction; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.ui.IEditorPart; @@ -24,53 +23,7 @@ /** * Interface to a portal page layer extension */ -public interface IPortalPageLayer { - - /** - * Interface to an action/navigation bar for the portal portal page layer - */ - public interface IActionBar { - - /** - * Required title for the action bar - * @return String - */ - String getTitle(); - - /** - * Actions shown in the action bar: - * Required: text and run() methods - * Optional: tool tip text - * Unused: image/check - * @return IAction - */ - IAction[] getActions(); - - /** - * Action ids for actions that should be emphasized in the action bar (e.g., bold font) - * @return String[] or null - */ - String[] getHighlightedActionIds(); - - } - - /** - * Interface allowing the UI for provided actions of an IActionBar to be updated (e.g., enabled state) - */ - public interface IActionUIUpdater { - - /** - * Update the UI for a specific action by id - * @param actionId - */ - void update(String actionId); - - /** - * Update the UI for all actions in the IActionBar - */ - void updateAll(); - - } +public interface IPortalPageLayer extends ICommandBarFactory { /** * Called to create the control for the portal page layer @@ -86,14 +39,6 @@ void init(); /** - * Return action bars for the portal page layer - * @param part IEditorPart - * @param updater IActionUIUpdater - * @return IActionBar[] - */ - IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater); - - /** * Called to dispose internal resources of the portal page layer */ void dispose(); diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/OpenPreferencePageAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/OpenPreferencePageAction.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.extension; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.preference.PreferenceDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.dialogs.PreferencesUtil; + +import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; + +/** + * An action to show a preference page + */ +public class OpenPreferencePageAction extends Action { + + private String preferencePageId; + + public OpenPreferencePageAction(String text, String preferencePageId) { + super(text); + this.preferencePageId = preferencePageId; + } + + @Override + public void run() { + Shell shell = WorkbenchUtils.getSafeShell(); + + PreferenceDialog dialog = + PreferencesUtil.createPreferenceDialogOn(shell, preferencePageId, null, null); + + dialog.open(); + } +} diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/BugzillaPage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/BugzillaPage.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.view; + +import com.nokia.carbide.internal.discovery.ui.extension.AbstractBrowserPortalPageLayer; + +public class BugzillaPage extends AbstractBrowserPortalPageLayer { +} diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/CreatingCarbidePage.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/CreatingCarbidePage.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/CreatingCarbidePage.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.internal.discovery.ui.view; import com.nokia.carbide.internal.discovery.ui.extension.AbstractRSSPortalPageLayer; diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.internal.discovery.ui.view; import com.nokia.carbide.internal.discovery.ui.extension.AbstractBrowserPortalPageLayer; diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPortalExtension.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPortalExtension.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPortalExtension.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,335 +1,39 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.internal.discovery.ui.view; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.eclipse.equinox.internal.p2.discovery.Catalog; -import org.eclipse.equinox.internal.p2.discovery.DiscoveryCore; -import org.eclipse.equinox.internal.p2.discovery.compatibility.BundleDiscoveryStrategy; -import org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy; -import org.eclipse.equinox.internal.p2.discovery.model.CatalogItem; -import org.eclipse.equinox.internal.p2.ui.discovery.DiscoveryUi; -import org.eclipse.equinox.internal.p2.ui.discovery.wizards.CatalogConfiguration; -import org.eclipse.equinox.internal.p2.ui.discovery.wizards.CatalogViewer; -import org.eclipse.equinox.p2.core.IProvisioningAgent; -import org.eclipse.equinox.p2.operations.ProvisioningSession; -import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; -import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager; -import org.eclipse.equinox.p2.ui.ProvisioningUI; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.layout.GridDataFactory; -import org.eclipse.jface.layout.GridLayoutFactory; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.BaseSelectionListenerAction; -import org.eclipse.ui.browser.IWorkbenchBrowserSupport; - -import com.nokia.carbide.discovery.ui.Activator; -import com.nokia.carbide.discovery.ui.Messages; -import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer; -import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; - -@SuppressWarnings("restriction") -public class InstallExtensionsPortalExtension implements IPortalPageLayer { - - private static final String INSTALL_ACTION_ID = InstallExtensionsPortalExtension.class.getName() + ".install"; //$NON-NLS-1$ - - private final class RunnableContextDialog extends ProgressMonitorDialog { - private final String title; - - private RunnableContextDialog(Shell parent, String title) { - super(parent); - this.title = title; - } - - @Override - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(title); - } - - } - - private final class ActionBar implements IActionBar { - private IAction[] actions; - - public ActionBar(IEditorPart part) { - actions = makeActions(part); - } - - @Override - public String getTitle() { - return Messages.InstallExtensionsPortalExtension_InstallExtensionsTitle; - } - @Override - public IAction[] getActions() { - return actions; - } - - @Override - public String[] getHighlightedActionIds() { - return new String[] {INSTALL_ACTION_ID}; - } - } - - private final class LinkBar implements IActionBar { - @Override - public String getTitle() { - return Messages.InstallExtensionsPage_LinkBarTitle; - } +import com.nokia.carbide.internal.discovery.ui.extension.AbstractDiscoveryPortalPageLayer; - @Override - public IAction[] getActions() { - IAction action = new Action(Messages.InstallExtensionsPage_BuzillaActionName) { - @Override - public void run() { - try { - URL url = new URL("https://xdabug001.ext.nokia.com/bugzilla"); //$NON-NLS-1$ - IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport(); - browserSupport.createBrowser(null).openURL(url); - } catch (MalformedURLException e) { - } catch (PartInitException e) { - } - } - }; - return new IAction[] { action }; - } - - @Override - public String[] getHighlightedActionIds() { - return null; - } - } - - private static final String DIRECTORY_KEY = "com.nokia.carbide.discovery.directory"; //$NON-NLS-1$ - - private CatalogViewer viewer; - private List selectionListeners; - private IActionUIUpdater updater; - - public InstallExtensionsPortalExtension() { - } +public class InstallExtensionsPortalExtension extends AbstractDiscoveryPortalPageLayer { @Override public Control createControl(Composite parent, IEditorPart part) { - Composite c = new Composite(parent, SWT.NONE); - GridLayoutFactory.swtDefaults().applyTo(c); - viewer = new CatalogViewer(getCatalog(), part.getEditorSite(), - new RunnableContextDialog(part.getEditorSite().getShell(), - Messages.InstallExtensionsPage_GatherExtensionsTitle), - getConfiguration()); - viewer.createControl(c); - GridDataFactory.fillDefaults().grab(true, true).applyTo(viewer.getControl()); - - // Create the help context id for the viewer's control - PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), - "com.nokia.carbide.discovery.ui.view.DiscoveryView.catalogviewer"); //$NON-NLS-1$ - return c; - } - - @Override - public void init() { - if (!WorkbenchUtils.isJUnitRunning()) { // do not initialize the catalog if JUnit is running - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - for (ISelectionChangedListener listener : selectionListeners) { - viewer.addSelectionChangedListener(listener); - } - viewer.updateCatalog(); - } - }); - } - } - - @Override - public IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater) { - this.updater = updater; - return new IActionBar[] { new ActionBar(part), new LinkBar() }; - } - - private CatalogConfiguration getConfiguration() { - CatalogConfiguration configuration = new CatalogConfiguration(); - configuration.setShowTagFilter(false); - return configuration; - } - - private Catalog getCatalog() { - Catalog catalog = new Catalog(); - catalog.setEnvironment(DiscoveryCore.createEnvironment()); - catalog.setVerifyUpdateSiteAvailability(false); - - // look for remote descriptor - RemoteBundleDiscoveryStrategy remoteDiscoveryStrategy = new RemoteBundleDiscoveryStrategy(); - String url = Activator.getFromServerProperties(DIRECTORY_KEY); - if (url != null) { - remoteDiscoveryStrategy.setDirectoryUrl(url); - catalog.getDiscoveryStrategies().add(remoteDiscoveryStrategy); - } - else // look for descriptors from installed bundles - catalog.getDiscoveryStrategies().add(new BundleDiscoveryStrategy()); - - return catalog; - } + Control control = super.createControl(parent, part); - private IAction[] makeActions(final IEditorPart part) { - selectionListeners = new ArrayList(); - List actions = new ArrayList(); - IAction action; - - // install - action = new BaseSelectionListenerAction(Messages.InstallExtensionsPage_InstallLabel) { - public void run() { - DiscoveryUi.install(viewer.getCheckedItems(), - new RunnableContextDialog(part.getEditorSite().getShell(), - Messages.InstallExtensionsPage_GatheringInstallInfoTitle)); - }; - - protected boolean updateSelection(IStructuredSelection selection) { - scheduleUpdateAllActionUIs(); - return !selection.isEmpty(); - }; - }; - action.setToolTipText(Messages.InstallExtensionsPage_InstallTip); - action.setId(INSTALL_ACTION_ID); - selectionListeners.add((ISelectionChangedListener) action); - actions.add(action); - - // refresh - action = new Action(Messages.InstallExtensionsPage_RefreshLabel) { - public void run() { - viewer.setSelection(StructuredSelection.EMPTY); - viewer.updateCatalog(); - viewer.refresh(); - } - }; - actions.add(action); - - // check all - action = new BaseSelectionListenerAction(Messages.InstallExtensionsPage_CheckAllLabel) { - public void run() { - viewer.setSelection(StructuredSelection.EMPTY); - viewer.setSelection(getAllItemsSelection()); - viewer.refresh(); - } - - private IStructuredSelection getAllItemsSelection() { - List catalogItems = new ArrayList(); - for (CatalogItem catalogItem : viewer.getCatalog().getItems()) { - if (!catalogItem.isInstalled()) - catalogItems.add(catalogItem); - } - return new StructuredSelection(catalogItems); - } + // Create the help context id for the viewer's control + PlatformUI.getWorkbench().getHelpSystem().setHelp(control, + "com.nokia.carbide.discovery.ui.view.DiscoveryView.catalogviewer"); //$NON-NLS-1$ - protected boolean updateSelection(IStructuredSelection selection) { - scheduleUpdateAllActionUIs(); - return !getAllItemsSelection().equals(selection); - } - }; - action.setId(InstallExtensionsPortalExtension.class.getName() + ".checkAll"); //$NON-NLS-1$ - selectionListeners.add((ISelectionChangedListener) action); - actions.add(action); - - // uncheck all - action = new BaseSelectionListenerAction(Messages.InstallExtensionsPage_UncheckAllLabel) { - public void run() { - viewer.setSelection(StructuredSelection.EMPTY); - viewer.refresh(); - }; - - protected boolean updateSelection(IStructuredSelection selection) { - scheduleUpdateAllActionUIs(); - return !selection.isEmpty(); - }; - }; - action.setId(InstallExtensionsPortalExtension.class.getName() + ".uncheckAll"); //$NON-NLS-1$ - selectionListeners.add((ISelectionChangedListener) action); - actions.add(action); - - // advanced install - action = new Action(Messages.InstallExtensionsPage_AdvancedInstallLabel) { - public void run() { - showInstallWizard(); - } - }; - actions.add(action); - - ISelectionChangedListener selectionListener = new ISelectionChangedListener() { - @Override - public void selectionChanged(SelectionChangedEvent event) { - IStructuredSelection selection = (IStructuredSelection) event.getSelection(); - IActionBars bars = part.getEditorSite().getActionBars(); - bars.getStatusLineManager().setMessage( - selection.isEmpty() ? null : MessageFormat.format( - Messages.InstallExtensionsPage_StatusLineFmt, selection.size())); - } - }; - selectionListeners.add(selectionListener); - - return (IAction[]) actions.toArray(new IAction[actions.size()]); + return control; } - - @Override - public void dispose() { - for (ISelectionChangedListener listener : selectionListeners) { - viewer.removeSelectionChangedListener(listener); - } - } - - private void showInstallWizard() { - ProvisioningUI defaultUI = ProvisioningUI.getDefaultUI(); - ProvisioningSession session = defaultUI.getSession(); - IProvisioningAgent agent = session.getProvisioningAgent(); - IMetadataRepositoryManager metadataManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME); - IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME); - for (URI uri : getCatalogURIs()) { - metadataManager.addRepository(uri); - artifactManager.addRepository(uri); - } - defaultUI.openInstallWizard(null, null, null); - } - - private Collection getCatalogURIs() { - Set uris = new HashSet(); - for (CatalogItem catalogItem : viewer.getCatalog().getItems()) { - try { - uris.add(new URI(catalogItem.getSiteUrl())); - } catch (URISyntaxException e) { - // ignore bad URIs - } - } - return uris; - }; - - private void scheduleUpdateAllActionUIs() { - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - updater.updateAll(); - } - }); - }; } diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/PulsarPageLayer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/PulsarPageLayer.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.view; + +import com.nokia.carbide.internal.discovery.ui.extension.AbstractDiscoveryPortalPageLayer; + + +public class PulsarPageLayer extends AbstractDiscoveryPortalPageLayer { + + @Override + protected String getDirectoryURL() { + return "http://tools.ext.nokia.com/pulsar/directory.xml"; //$NON-NLS-1$ + } + +} diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SettingsBarCreator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SettingsBarCreator.java Mon Aug 02 17:22:42 2010 -0500 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +package com.nokia.carbide.internal.discovery.ui.view; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.action.IAction; +import org.eclipse.ui.IEditorPart; + +import com.nokia.carbide.discovery.ui.Messages; +import com.nokia.carbide.internal.discovery.ui.extension.IActionBar; +import com.nokia.carbide.internal.discovery.ui.extension.IActionUIUpdater; +import com.nokia.carbide.internal.discovery.ui.extension.ICommandBarFactory; +import com.nokia.carbide.internal.discovery.ui.extension.OpenPreferencePageAction; + +public class SettingsBarCreator implements ICommandBarFactory { + + private class SettingsBar implements IActionBar { + @Override + public String getTitle() { + return Messages.SettingsBarCreator_Title; + } + + @Override + public IAction[] getActions() { + List actions = new ArrayList(); + actions.add(new OpenPreferencePageAction( + Messages.SettingsBarCreator_CapabilitiesActionLabel, + "org.eclipse.sdk.capabilities")); //$NON-NLS-1$ + actions.add(new OpenPreferencePageAction( + Messages.SettingsBarCreator_CodeStyleActionLabel, + "org.eclipse.cdt.ui.preferences.CodeFormatterPreferencePage")); //$NON-NLS-1$ + actions.add(new OpenPreferencePageAction( + Messages.SettingsBarCreator_KeyBindingsActionLabel, + "org.eclipse.ui.preferencePages.Keys")); //$NON-NLS-1$ + actions.add(new OpenPreferencePageAction( + Messages.SettingsBarCreator_ProxiesActionLabel, + "org.eclipse.ui.net.NetPreferences")); //$NON-NLS-1$ + return (IAction[]) actions.toArray(new IAction[actions.size()]); + } + + @Override + public String[] getHighlightedActionIds() { + return null; + } + } + + @Override + public IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater) { + return new IActionBar[] { new SettingsBar() }; + } + +} \ No newline at end of file diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,6 +1,52 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.internal.discovery.ui.view; -import com.nokia.carbide.internal.discovery.ui.extension.AbstractBrowserPortalPageLayer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.IEditorPart; + +import com.nokia.carbide.internal.discovery.ui.extension.IActionBar; +import com.nokia.carbide.internal.discovery.ui.extension.IActionUIUpdater; +import com.nokia.carbide.internal.discovery.ui.extension.IPortalPageLayer; + +public class SupportPage implements IPortalPageLayer { -public class SupportPage extends AbstractBrowserPortalPageLayer { + @Override + public Control createControl(Composite parent, IEditorPart part) { + Composite composite = new Composite(parent, SWT.NONE); + composite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); + composite.setLayout(new FillLayout()); + + return composite; + } + + @Override + public void init() { + } + + @Override + public IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater) { + return null; + } + + @Override + public void dispose() { + } } diff -r 9aa73dba4a42 -r b94a1c13f1e5 core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/WrenchSciencePage.java --- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/WrenchSciencePage.java Mon Aug 02 16:50:54 2010 -0500 +++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/WrenchSciencePage.java Mon Aug 02 17:22:42 2010 -0500 @@ -1,3 +1,19 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ package com.nokia.carbide.internal.discovery.ui.view; import com.nokia.carbide.internal.discovery.ui.extension.AbstractRSSPortalPageLayer;