--- a/core/com.nokia.carbide.discovery.ui/plugin.properties Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/plugin.properties Wed Jul 14 12:01:27 2010 -0500
@@ -1,2 +1,3 @@
view.name=Install Extensions
-menu.title=Carbide Portal
\ No newline at end of file
+menu.title=Carbide Portal
+portal.desc=Install extensions, get support, install SDKs, find latest news
\ No newline at end of file
--- a/core/com.nokia.carbide.discovery.ui/plugin.xml Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/plugin.xml Wed Jul 14 12:01:27 2010 -0500
@@ -15,12 +15,13 @@
default="false"
icon="icons/Carbide_c_icon_16x16.png"
id="com.nokia.carbide.discovery.ui.portalEditor"
- name="Carbide.c++ Portal">
+ name="%menu.title">
</editor>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
+ description="%portal.desc"
id="com.nokia.carbide.discovery.commands.launch"
name="%menu.title">
</command>
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/Messages.java Wed Jul 14 12:01:27 2010 -0500
@@ -13,6 +13,15 @@
public static String DiscoveryView_RefreshLabel;
public static String DiscoveryView_StatusLineFmt;
public static String DiscoveryView_UncheckAllLabel;
+ public static String HomePage_Title;
+ public static String InstallExtensionsPage_ActionBarTitle;
+ public static String InstallExtensionsPage_BuzillaActionName;
+ public static String InstallExtensionsPage_LinkBarTitle;
+ public static String InstallExtensionsPage_Title;
+ public static String PortalEditor_Name;
+ public static String PortalEditor_PageLoadError;
+ public static String PortalEditor_PageOpenError;
+ public static String SupportPage_Title;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/messages.properties Wed Jul 14 12:01:27 2010 -0500
@@ -7,3 +7,12 @@
DiscoveryView_RefreshLabel=Refresh
DiscoveryView_StatusLineFmt={0} item(s) checked
DiscoveryView_UncheckAllLabel=Uncheck All Items
+HomePage_Title=Home
+InstallExtensionsPage_ActionBarTitle=Install Actions
+InstallExtensionsPage_BuzillaActionName=Carbide Bugzilla
+InstallExtensionsPage_LinkBarTitle=Links
+InstallExtensionsPage_Title=Install Extensions
+PortalEditor_Name=Carbide Portal
+PortalEditor_PageLoadError=Could not load portal page
+PortalEditor_PageOpenError=Could not open portal
+SupportPage_Title=Carbide Support
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/ActionUIUpdater.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/ActionUIUpdater.java Wed Jul 14 12:01:27 2010 -0500
@@ -16,26 +16,35 @@
*/
package com.nokia.carbide.internal.discovery.ui.editor;
+import java.util.ArrayList;
+import java.util.List;
+
import com.nokia.carbide.internal.discovery.ui.extension.IPortalPage.IActionUIUpdater;
class ActionUIUpdater implements IActionUIUpdater {
- private TaskBar taskBar;
+ private List<TaskBar> taskBars;
+
+ public ActionUIUpdater() {
+ taskBars = new ArrayList<TaskBar>();
+ }
- void setTaskBar(TaskBar taskBar) {
- this.taskBar = taskBar;
+ void addTaskBar(TaskBar taskBar) {
+ taskBars.add(taskBar);
}
@Override
public void update(String actionId) {
- if (taskBar != null)
+ for (TaskBar taskBar : taskBars) {
taskBar.updateActionUI(actionId);
+ }
}
@Override
public void updateAll() {
- if (taskBar != null)
+ for (TaskBar taskBar : taskBars) {
taskBar.updateAllActionsUI();
+ }
}
}
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/NavigationBar.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/NavigationBar.java Wed Jul 14 12:01:27 2010 -0500
@@ -34,6 +34,7 @@
class NavigationBar extends RoundedCornerComposite {
+ private static final String FONT_NAME = "Arial"; //$NON-NLS-1$
private PortalEditor portalEditor;
@@ -56,12 +57,11 @@
parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
this.portalEditor = portalEditor;
buttonToPageMap = new LinkedHashMap<Button, IPortalPage>();
- setLayoutData(GridDataFactory.swtDefaults().grab(true, false)
- .align(SWT.CENTER, SWT.TOP).indent(10, 10).create());
- setLayout(RowLayoutFactory.swtDefaults().margins(3, 3).pack(false).wrap(false).create());
+ GridDataFactory.swtDefaults().grab(true, false).align(SWT.CENTER, SWT.TOP).indent(10, 10).applyTo(this);
+ RowLayoutFactory.swtDefaults().margins(3, 3).pack(false).wrap(false).applyTo(this);
listener = new ButtonListener();
- buttonFont = this.portalEditor.createFont("Arial", 12, SWT.NORMAL);
- selectedButtonFont = this.portalEditor.createFont("Arial", 12, SWT.BOLD);
+ buttonFont = this.portalEditor.createFont(FONT_NAME, 12, SWT.NORMAL);
+ selectedButtonFont = this.portalEditor.createFont(FONT_NAME, 12, SWT.BOLD);
}
public void initUI() {
@@ -76,7 +76,7 @@
b.setText(page.getText());
b.setImage(this.portalEditor.createImage(page.getImageDescriptor()));
b.addSelectionListener(listener);
- b.setLayoutData(RowDataFactory.swtDefaults().hint(200, SWT.DEFAULT).create());
+ RowDataFactory.swtDefaults().hint(200, SWT.DEFAULT).applyTo(b);
buttonToPageMap.put(b, page);
}
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalEditor.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/PortalEditor.java Wed Jul 14 12:01:27 2010 -0500
@@ -47,6 +47,7 @@
import org.eclipse.ui.part.EditorPart;
import com.nokia.carbide.discovery.ui.Activator;
+import com.nokia.carbide.discovery.ui.Messages;
import com.nokia.carbide.internal.discovery.ui.extension.IPortalPage;
import com.nokia.carbide.internal.discovery.ui.extension.IPortalPage.IActionBar;
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
@@ -74,13 +75,13 @@
private void getPortalPages() {
uninitializedPages = new ArrayList<IPortalPage>();
IConfigurationElement[] elements =
- Platform.getExtensionRegistry().getConfigurationElementsFor(Activator.PLUGIN_ID + ".portalPage");
+ Platform.getExtensionRegistry().getConfigurationElementsFor(Activator.PLUGIN_ID + ".portalPage"); //$NON-NLS-1$
for (IConfigurationElement element : elements) {
try {
uninitializedPages.add((IPortalPage) element.createExecutableExtension("class")); //$NON-NLS-1$
}
catch (CoreException e) {
- Activator.logError("Could not load portal page", e);
+ Activator.logError(Messages.PortalEditor_PageLoadError, e);
}
}
}
@@ -121,7 +122,7 @@
// create background
backgroundParent = new Composite(parent, SWT.NONE);
applyBG(backgroundParent);
- backgroundParent.setLayout(GridLayoutFactory.fillDefaults().create());
+ GridLayoutFactory.fillDefaults().applyTo(backgroundParent);
// create top naviation bar
navigationBar = createNavigationBar(backgroundParent);
// create stack composite
@@ -135,36 +136,35 @@
Control control = createPage(page);
pageToControlMap.put(page, control);
}
- stackComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(stackComposite);
}
private Control createPage(IPortalPage page) {
Composite pageComposite = new SharedBackgroundComposite(stackComposite, backgroundParent);
- pageComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).spacing(20, 0)
- .extendedMargins(20, 20, 20, 0).create());
+ GridLayoutFactory.fillDefaults().numColumns(2).spacing(20, 0).extendedMargins(20, 20, 20, 0).applyTo(pageComposite);
ActionUIUpdater updater = new ActionUIUpdater();
IActionBar[] commandBars = page.createCommandBars(this, updater);
if (commandBars.length > 0) {
Composite taskComposite = new SharedBackgroundComposite(pageComposite, backgroundParent);
- taskComposite.setLayout(GridLayoutFactory.fillDefaults().create());
- taskComposite.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).create());
+ GridLayoutFactory.fillDefaults().applyTo(taskComposite);
+ GridDataFactory.fillDefaults().grab(false, true).applyTo(taskComposite);
for (IActionBar actionBar : commandBars) {
Control control = createTaskBarControl(taskComposite, actionBar, updater);
- control.setLayoutData(GridDataFactory.fillDefaults().indent(0, 0).create());
+ GridDataFactory.fillDefaults().indent(0, 0).applyTo(control);
}
}
Composite pageControl = new RoundedCornerComposite(pageComposite, backgroundParent,
null, pageComposite.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- pageControl.setLayout(GridLayoutFactory.fillDefaults().margins(2, 2).create());
- pageControl.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
+ GridLayoutFactory.fillDefaults().margins(2, 2).applyTo(pageControl);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(pageControl);
Control control = page.createControl(pageControl, this);
- control.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(control);
return pageComposite;
}
private Control createTaskBarControl(Composite clientArea, IActionBar actionBar, ActionUIUpdater updater) {
TaskBar taskBar = new TaskBar(clientArea, this, actionBar);
- updater.setTaskBar(taskBar);
+ updater.addTaskBar(taskBar);
return taskBar;
}
@@ -213,7 +213,7 @@
try {
WorkbenchUtils.openEditor(getInput(), ID);
} catch (PartInitException e) {
- Activator.logError("Could not open portal", e);
+ Activator.logError(Messages.PortalEditor_PageOpenError, e);
}
}
@@ -238,7 +238,7 @@
@Override
public String getName() {
- return "Carbide.c++ Portal";
+ return Messages.PortalEditor_Name;
}
@Override
@@ -265,7 +265,6 @@
Font createFont(String name, int height, int style) {
Font font = new Font(Display.getCurrent(), name, height, style);
-
resources.add(font);
return font;
}
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/editor/TaskBar.java Wed Jul 14 12:01:27 2010 -0500
@@ -35,6 +35,8 @@
class TaskBar extends RoundedCornerComposite {
+ private static final String FONT_NAME = "Arial"; //$NON-NLS-1$
+
private final class ActionListener implements IHyperlinkListener {
@Override
public void linkActivated(HyperlinkEvent e) {
@@ -66,21 +68,18 @@
this.portalEditor = portalEditor;
createTitle(actionBar);
createActions(actionBar);
- setLayoutData(GridDataFactory.swtDefaults().grab(true, true).align(SWT.CENTER, SWT.BEGINNING).create());
- setLayout(RowLayoutFactory.swtDefaults().type(SWT.VERTICAL).margins(10, 10).extendedMargins(5, 5, 5, 10).fill(true).wrap(false).create());
+ GridDataFactory.swtDefaults().grab(true, true).align(SWT.CENTER, SWT.BEGINNING).applyTo(this);
+ RowLayoutFactory.swtDefaults().type(SWT.VERTICAL).margins(10, 10).extendedMargins(5, 5, 5, 10).fill(true).wrap(false).applyTo(this);
}
private void createTitle(IActionBar actionBar) {
- String title = actionBar.getTitle();
- if (title != null) {
- Label l = new Label(this, SWT.LEFT);
- l.setFont(portalEditor.createFont("Arial", 10, SWT.BOLD));
- l.setBackground(l.getDisplay().getSystemColor(SWT.COLOR_WHITE));
- l.setText(title);
- l.setLayoutData(RowDataFactory.swtDefaults().create());
- l = new Label(this, SWT.HORIZONTAL | SWT.SEPARATOR);
- l.setLayoutData(RowDataFactory.swtDefaults().create());
- }
+ Label l = new Label(this, SWT.LEFT);
+ l.setFont(portalEditor.createFont(FONT_NAME, 10, SWT.BOLD));
+ l.setBackground(l.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+ l.setText(actionBar.getTitle());
+ RowDataFactory.swtDefaults().applyTo(l);
+ l = new Label(this, SWT.HORIZONTAL | SWT.SEPARATOR);
+ RowDataFactory.swtDefaults().applyTo(l);
}
private void createActions(IActionBar actionBar) {
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPage.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/extension/IPortalPage.java Wed Jul 14 12:01:27 2010 -0500
@@ -33,7 +33,7 @@
public interface IActionBar {
/**
- * Optional title for the action bar
+ * Required title for the action bar
* @return String
*/
String getTitle();
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/HomePage.java Wed Jul 14 12:01:27 2010 -0500
@@ -7,6 +7,7 @@
import org.eclipse.ui.IEditorPart;
import com.nokia.carbide.discovery.ui.Activator;
+import com.nokia.carbide.discovery.ui.Messages;
import com.nokia.carbide.internal.discovery.ui.extension.IPortalPage;
public class HomePage implements IPortalPage {
@@ -16,12 +17,12 @@
@Override
public String getText() {
- return "Home";
+ return Messages.HomePage_Title;
}
@Override
public ImageDescriptor getImageDescriptor() {
- return Activator.getImageDescriptor("icons/Carbide_c_icon_16x16.png");
+ return Activator.getImageDescriptor("icons/Carbide_c_icon_16x16.png"); //$NON-NLS-1$
}
@Override
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPage.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/InstallExtensionsPage.java Wed Jul 14 12:01:27 2010 -0500
@@ -4,6 +4,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
@@ -49,8 +50,10 @@
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;
@@ -85,7 +88,7 @@
@Override
public String getTitle() {
- return "Install Extensions";
+ return Messages.InstallExtensionsPage_ActionBarTitle;
}
@Override
@@ -93,12 +96,35 @@
return actions;
}
}
+
+ private final class LinkBar implements IActionBar {
+ @Override
+ public String getTitle() {
+ return Messages.InstallExtensionsPage_LinkBarTitle;
+ }
+
+ @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 };
+ }
+ }
private static final String DIRECTORY_KEY = "com.nokia.carbide.discovery.directory"; //$NON-NLS-1$
private CatalogViewer viewer;
private List<ISelectionChangedListener> selectionListeners;
- private IActionBar actionBar;
private IActionUIUpdater updater;
public InstallExtensionsPage() {
@@ -106,7 +132,7 @@
@Override
public String getText() {
- return "Install Extensions";
+ return Messages.InstallExtensionsPage_Title;
}
@Override
@@ -149,8 +175,7 @@
@Override
public IActionBar[] createCommandBars(IEditorPart part, IActionUIUpdater updater) {
this.updater = updater;
- actionBar = new ActionBar(part);
- return new IActionBar[] { actionBar };
+ return new IActionBar[] { new ActionBar(part), new LinkBar() };
}
private CatalogConfiguration getConfiguration() {
@@ -229,7 +254,7 @@
return !getAllItemsSelection().equals(selection);
}
};
- action.setId(getClass().getName() + ".checkAll");
+ action.setId(getClass().getName() + ".checkAll"); //$NON-NLS-1$
selectionListeners.add((ISelectionChangedListener) action);
actions.add(action);
@@ -244,7 +269,7 @@
return !selection.isEmpty();
};
};
- action.setId(getClass().getName() + ".uncheckAll");
+ action.setId(getClass().getName() + ".uncheckAll"); //$NON-NLS-1$
selectionListeners.add((ISelectionChangedListener) action);
actions.add(action);
@@ -260,7 +285,7 @@
return !selection.isEmpty();
};
};
- action.setId(getClass().getName() + ".install");
+ action.setId(getClass().getName() + ".install"); //$NON-NLS-1$
selectionListeners.add((ISelectionChangedListener) action);
actions.add(action);
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java Wed Jul 14 09:40:09 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/view/SupportPage.java Wed Jul 14 12:01:27 2010 -0500
@@ -7,6 +7,7 @@
import org.eclipse.ui.IEditorPart;
import com.nokia.carbide.discovery.ui.Activator;
+import com.nokia.carbide.discovery.ui.Messages;
import com.nokia.carbide.internal.discovery.ui.extension.IPortalPage;
public class SupportPage implements IPortalPage {
@@ -16,12 +17,12 @@
@Override
public String getText() {
- return "Carbide Support";
+ return Messages.SupportPage_Title;
}
@Override
public ImageDescriptor getImageDescriptor() {
- return Activator.getImageDescriptor("icons/Carbide_c_icon_16x16.png");
+ return Activator.getImageDescriptor("icons/Carbide_c_icon_16x16.png"); //$NON-NLS-1$
}
@Override