Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 157870 Details for
Bug 122772
[Wizards] NewWizardAction would be able to customize the title and description of the opened wizard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch v02
NewWizardTitle 02.txt (text/plain), 8.06 KB, created by
Prakash Rangaraj
on 2010-02-02 01:27:11 EST
(
hide
)
Description:
Patch v02
Filename:
MIME Type:
Creator:
Prakash Rangaraj
Created:
2010-02-02 01:27:11 EST
Size:
8.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java,v >retrieving revision 1.19 >diff -u -r1.19 UIWizardsAuto.java >--- Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java 8 May 2006 20:51:28 -0000 1.19 >+++ Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIWizardsAuto.java 2 Feb 2010 06:24:54 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.ui.dialogs.WizardNewProjectReferencePage; > import org.eclipse.ui.help.WorkbenchHelp; > import org.eclipse.ui.internal.IWorkbenchHelpContextIds; >+import org.eclipse.ui.internal.WorkbenchMessages; > import org.eclipse.ui.internal.WorkbenchPlugin; > import org.eclipse.ui.internal.dialogs.ExportWizard; > import org.eclipse.ui.internal.dialogs.ImportWizard; >@@ -264,22 +265,7 @@ > // Create wizard selection wizard. > NewWizard wizard = new NewWizard(); > wizard.setProjectsOnly(true); >- ISelection selection = getWorkbench().getActiveWorkbenchWindow() >- .getSelectionService().getSelection(); >- IStructuredSelection selectionToPass = null; >- if (selection instanceof IStructuredSelection) >- selectionToPass = (IStructuredSelection) selection; >- else >- selectionToPass = StructuredSelection.EMPTY; >- wizard.init(getWorkbench(), selectionToPass); >- IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault() >- .getDialogSettings(); >- IDialogSettings wizardSettings = workbenchSettings >- .getSection("NewWizardAction");//$NON-NLS-1$ >- if (wizardSettings == null) >- wizardSettings = workbenchSettings.addNewSection("NewWizardAction");//$NON-NLS-1$ >- wizard.setDialogSettings(wizardSettings); >- wizard.setForcePreviousAndNextButtons(true); >+ initNewWizard(wizard); > > // Create wizard dialog. > WizardDialog dialog = new WizardDialog(getShell(), wizard); >@@ -294,7 +280,44 @@ > > public void testNewResource() { > NewWizard wizard = new NewWizard(); >- ISelection selection = getWorkbench().getActiveWorkbenchWindow() >+ initNewWizard(wizard); >+ >+ WizardDialog dialog = new WizardDialog(getShell(), wizard); >+ dialog.create(); >+ dialog.getShell().setSize( >+ Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), >+ SIZING_WIZARD_HEIGHT_2); >+ WorkbenchHelp.setHelp(dialog.getShell(), IWorkbenchHelpContextIds.NEW_WIZARD); >+ DialogCheck.assertDialogTexts(dialog, this); >+ } >+ >+ public void testWizardWindowTitle() { >+ >+ checkWizardWindowTitle(null); >+ checkWizardWindowTitle("My New Wizard"); //$NON-NLS-1$ >+ >+ } >+ >+ private void checkWizardWindowTitle(String windowTitle) { >+ >+ NewWizard newWizard = new NewWizard(); >+ newWizard.setWindowTitle(windowTitle); >+ >+ initNewWizard(newWizard); >+ >+ WizardDialog dialog = new WizardDialog(getShell(), newWizard); >+ dialog.create(); >+ >+ if(windowTitle == null) >+ windowTitle = WorkbenchMessages.NewWizard_title; >+ >+ assertEquals(windowTitle, dialog.getShell().getText()); >+ >+ dialog.close(); >+ } >+ >+ private void initNewWizard(NewWizard wizard) { >+ ISelection selection = getWorkbench().getActiveWorkbenchWindow() > .getSelectionService().getSelection(); > IStructuredSelection selectionToPass = null; > if (selection instanceof IStructuredSelection) >@@ -310,15 +333,8 @@ > wizardSettings = workbenchSettings.addNewSection("NewWizardAction");//$NON-NLS-1$ > wizard.setDialogSettings(wizardSettings); > wizard.setForcePreviousAndNextButtons(true); >+ } > >- WizardDialog dialog = new WizardDialog(getShell(), wizard); >- dialog.create(); >- dialog.getShell().setSize( >- Math.max(SIZING_WIZARD_WIDTH_2, dialog.getShell().getSize().x), >- SIZING_WIZARD_HEIGHT_2); >- WorkbenchHelp.setHelp(dialog.getShell(), IWorkbenchHelpContextIds.NEW_WIZARD); >- DialogCheck.assertDialogTexts(dialog, this); >- } > > } > >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/actions/NewWizardAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/NewWizardAction.java,v >retrieving revision 1.29 >diff -u -r1.29 NewWizardAction.java >--- Eclipse UI/org/eclipse/ui/actions/NewWizardAction.java 9 May 2008 14:13:13 -0000 1.29 >+++ Eclipse UI/org/eclipse/ui/actions/NewWizardAction.java 2 Feb 2010 06:24:58 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -67,6 +67,12 @@ > */ > private String categoryId = null; > >+ /** >+ * The title of the wizard window or <code>null</code> to use the default >+ * wizard window title. >+ */ >+ private String windowTitle = null; >+ > /** > * The workbench window; or <code>null</code> if this > * action has been <code>dispose</code>d. >@@ -128,6 +134,26 @@ > categoryId = id; > } > >+ /** >+ * <p> >+ * Sets the title of the wizard window >+ * <p> >+ * >+ * <p> >+ * If the title of the wizard window is <code>null</code>, the default >+ * wizard window title will be used. >+ * </p> >+ * >+ * @param windowTitle >+ * The title of the wizard window, otherwise <code>null</code> >+ * (default wizard window title). >+ * >+ * @since 3.6 >+ */ >+ public void setWizardWindowTitle(String windowTitle) { >+ this.windowTitle = windowTitle; >+ } >+ > /* (non-Javadoc) > * Method declared on IAction. > */ >@@ -138,6 +164,7 @@ > } > NewWizard wizard = new NewWizard(); > wizard.setCategoryId(categoryId); >+ wizard.setWindowTitle(windowTitle); > > ISelection selection = workbenchWindow.getSelectionService() > .getSelection(); >@@ -162,6 +189,7 @@ > } > > wizard.init(workbenchWindow.getWorkbench(), selectionToPass); >+ > IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault() > .getDialogSettings(); > IDialogSettings wizardSettings = workbenchSettings >Index: Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizard.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizard.java,v >retrieving revision 1.26 >diff -u -r1.26 NewWizard.java >--- Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizard.java 8 May 2006 20:55:46 -0000 1.26 >+++ Eclipse UI/org/eclipse/ui/internal/dialogs/NewWizard.java 2 Feb 2010 06:24:58 -0000 >@@ -11,7 +11,6 @@ > package org.eclipse.ui.internal.dialogs; > > import java.util.StringTokenizer; >- > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.wizard.IWizard; > import org.eclipse.jface.wizard.Wizard; >@@ -105,11 +104,14 @@ > this.workbench = aWorkbench; > this.selection = currentSelection; > >- if (projectsOnly) { >- setWindowTitle(WorkbenchMessages.NewProject_title); >- } else { >- setWindowTitle(WorkbenchMessages.NewWizard_title); >- } >+ if (getWindowTitle() == null) { >+ // No title supplied. Set the default title >+ if (projectsOnly) { >+ setWindowTitle(WorkbenchMessages.NewProject_title); >+ } else { >+ setWindowTitle(WorkbenchMessages.NewWizard_title); >+ } >+ } > setDefaultPageImageDescriptor(WorkbenchImages > .getImageDescriptor(IWorkbenchGraphicConstants.IMG_WIZBAN_NEW_WIZ)); > setNeedsProgressMonitor(true); >@@ -167,4 +169,5 @@ > } > return super.canFinish(); > } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 122772
:
157829
| 157870