# HG changeset patch # User Eugene Ostroukhov # Date 1268354718 28800 # Node ID 38f012067872b59ab3a845cebe738ce8cd71ebad # Parent 2c5d9bdb5ccee13a6a440478d409a0e3dc113cc7 Bug 2207 fix, wizard banners diff -r 2c5d9bdb5cce -r 38f012067872 org.symbian.tools.wrttools/plugin.xml --- a/org.symbian.tools.wrttools/plugin.xml Thu Mar 11 16:16:44 2010 -0800 +++ b/org.symbian.tools.wrttools/plugin.xml Thu Mar 11 16:45:18 2010 -0800 @@ -191,19 +191,32 @@ - + Creates a new Symbian WRT application project using one of the provided templates + + + Create WRT project from deployable WGZ application archive + + @@ -275,23 +288,11 @@ + name="Existing WRT Projects into Workspace"> Import WRT project created in Aptana, Adobe Dreamweaver or WRT IDE - - - Create WRT project from deployable WGZ application archive - - @@ -323,11 +324,21 @@ + + + + + + + + @@ -555,7 +566,8 @@ diff -r 2c5d9bdb5cce -r 38f012067872 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java --- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java Thu Mar 11 16:16:44 2010 -0800 +++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java Thu Mar 11 16:45:18 2010 -0800 @@ -22,13 +22,13 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; -import com.intel.bluetooth.BlueCoveImpl; +import org.symbian.tools.wrttools.core.WRTImages; +import org.symbian.tools.wrttools.sdt.utils.Logging; -import org.symbian.tools.wrttools.core.deploy.PreferenceConstants; -import org.symbian.tools.wrttools.sdt.utils.Logging; +import com.intel.bluetooth.BlueCoveImpl; /** * The activator class controls the plug-in life cycle @@ -73,17 +73,11 @@ plugin = null; super.stop(context); } -/* - public void startBluetoothOperation() { - IPreferenceStore prefStore = getPreferenceStore(); - if (prefStore.getBoolean(PreferenceConstants.DEBUG_ENABLED)) - enableBlueCoveDiagnostics(true); - } - - public void stopBluetoothOperation() { - enableBlueCoveDiagnostics(false); - } -*/ + + @Override + protected void initializeImageRegistry(ImageRegistry reg) { + WRTImages.init(reg); + } /** Toggle BlueCove logging */ diff -r 2c5d9bdb5cce -r 38f012067872 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/WRTImages.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/WRTImages.java Thu Mar 11 16:45:18 2010 -0800 @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2010 Symbian Foundation 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: + * Symbian Foundation - initial contribution. + * Contributors: + * Description: + * Overview: + * Details: + * Platforms/Drives/Compatibility: + * Assumptions/Requirement/Pre-requisites: + * Failures and causes: + */ +package org.symbian.tools.wrttools.core; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.symbian.tools.wrttools.Activator; + +public class WRTImages { + private static final String IMAGE_IMPORT_WIZARD_BANNER = "import_wizard_banner.png"; + private static final String IMAGE_IMPORT_WGZ_BANNER = "import_w_banner.png"; + private static final String IMAGE_NEW_WIZARD_BANNER = "WRT_wizard_banner.png"; + + public static void init(ImageRegistry reg) { + add(reg, IMAGE_IMPORT_WIZARD_BANNER); + add(reg, IMAGE_IMPORT_WGZ_BANNER); + add(reg, IMAGE_NEW_WIZARD_BANNER); + } + + private static void add(ImageRegistry reg, String key) { + reg.put(key, Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "/icons/" + key)); + } + + public static ImageDescriptor importWizardBanner() { + return Activator.getDefault().getImageRegistry().getDescriptor(IMAGE_IMPORT_WIZARD_BANNER); + } + + public static ImageDescriptor importWgzWizardBanner() { + return Activator.getDefault().getImageRegistry().getDescriptor(IMAGE_IMPORT_WGZ_BANNER); + } + + public static ImageDescriptor newWizardBanner() { + return Activator.getDefault().getImageRegistry().getDescriptor(IMAGE_NEW_WIZARD_BANNER); + } + +} diff -r 2c5d9bdb5cce -r 38f012067872 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WgzImportWizard.java --- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WgzImportWizard.java Thu Mar 11 16:16:44 2010 -0800 +++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WgzImportWizard.java Thu Mar 11 16:45:18 2010 -0800 @@ -12,6 +12,8 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExecutableExtension; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -20,18 +22,23 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; import org.eclipse.ui.IImportWizard; +import org.eclipse.ui.INewWizard; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.statushandlers.StatusManager; +import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard; import org.symbian.tools.wrttools.Activator; +import org.symbian.tools.wrttools.core.WRTImages; import org.symbian.tools.wrttools.core.WrtIdeCorePreferences; import org.symbian.tools.wrttools.util.ProjectUtils; -public class WgzImportWizard extends Wizard implements IImportWizard { +public class WgzImportWizard extends Wizard implements IImportWizard, INewWizard, IExecutableExtension { private IFile file; private WgzImportWizardPage page; + private IConfigurationElement config; public WgzImportWizard() { setWindowTitle("Import WRT Application Archive"); + setDefaultPageImageDescriptor(WRTImages.importWgzWizardBanner()); setNeedsProgressMonitor(true); } @@ -89,6 +96,7 @@ } }); if (holder[0] != null) { + BasicNewProjectResourceWizard.updatePerspective(config); Activator.getDefault().getPreferenceStore().setValue(WrtIdeCorePreferences.WGZ_IMPORT_PATH, new File(archiveName).getParentFile().getAbsolutePath()); ProjectUtils.focusOn(holder[0]); @@ -119,4 +127,9 @@ } } + public void setInitializationData(IConfigurationElement config, String propertyName, Object data) + throws CoreException { + this.config = config; + } + } diff -r 2c5d9bdb5cce -r 38f012067872 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java --- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java Thu Mar 11 16:16:44 2010 -0800 +++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WrtWidgetWizard.java Thu Mar 11 16:45:18 2010 -0800 @@ -59,6 +59,7 @@ import org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer; import org.symbian.tools.wrttools.Activator; import org.symbian.tools.wrttools.core.ProjectTemplate; +import org.symbian.tools.wrttools.core.WRTImages; import org.symbian.tools.wrttools.core.libraries.IWrtIdeContainer; import org.symbian.tools.wrttools.util.NonClosingStream; import org.symbian.tools.wrttools.util.ProjectUtils; @@ -67,12 +68,13 @@ private WizardNewProjectCreationPage resourcePage; private WizardContext context; private DataBindingContext bindingContext; - private Map templateDetails = new HashMap(); + private final Map templateDetails = new HashMap(); private WRTProjectTemplateWizardPage templatesPage; private WRTProjectFilesWizardPage filesPage; private IConfigurationElement config; public WrtWidgetWizard() { + setDefaultPageImageDescriptor(WRTImages.newWizardBanner()); setWindowTitle("New Web Runtime Application"); setNeedsProgressMonitor(true); } diff -r 2c5d9bdb5cce -r 38f012067872 org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/projectimport/WrtProjectsImportWizard.java --- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/projectimport/WrtProjectsImportWizard.java Thu Mar 11 16:16:44 2010 -0800 +++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/projectimport/WrtProjectsImportWizard.java Thu Mar 11 16:45:18 2010 -0800 @@ -30,6 +30,7 @@ import org.eclipse.ui.INewWizard; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard; +import org.symbian.tools.wrttools.core.WRTImages; import org.symbian.tools.wrttools.util.ProjectUtils; public class WrtProjectsImportWizard extends Wizard implements @@ -41,7 +42,8 @@ public WrtProjectsImportWizard() { setWindowTitle("Import WRT Project"); setNeedsProgressMonitor(true); - } + setDefaultPageImageDescriptor(WRTImages.importWizardBanner()); + } @Override public boolean performCancel() {