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 244547 Details for
Bug 437398
[ccp] Don't select extension when asking for new file name on paste
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
bug437398-ccp.patch (text/plain), 3.98 KB, created by
Noopur Gupta
on 2014-06-26 08:17:06 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Noopur Gupta
Created:
2014-06-26 08:17:06 EDT
Size:
3.98 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java >index ef497c3..c0c5867 100644 >--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java >+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2014 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 >@@ -82,27 +82,27 @@ > public INewNameQuery createNewCompilationUnitNameQuery(ICompilationUnit cu, String initialSuggestedName) { > String[] keys= { BasicElementLabels.getJavaElementName(JavaCore.removeJavaLikeExtension(cu.getElementName()))}; > String message= Messages.format(ReorgMessages.ReorgQueries_enterNewNameQuestion, keys); >- return createStaticQuery(createCompilationUnitNameValidator(cu), message, initialSuggestedName, getShell()); >+ return createStaticQuery(createCompilationUnitNameValidator(cu), message, initialSuggestedName, true, getShell()); > } > > > public INewNameQuery createNewResourceNameQuery(IResource res, String initialSuggestedName) { > String[] keys= { BasicElementLabels.getResourceName(res)}; > String message= Messages.format(ReorgMessages.ReorgQueries_enterNewNameQuestion, keys); >- return createStaticQuery(createResourceNameValidator(res), message, initialSuggestedName, getShell()); >+ return createStaticQuery(createResourceNameValidator(res), message, initialSuggestedName, res.getType() == IResource.FILE, getShell()); > } > > > public INewNameQuery createNewPackageNameQuery(IPackageFragment pack, String initialSuggestedName) { > String[] keys= {JavaElementLabels.getElementLabel(pack, JavaElementLabels.ALL_DEFAULT)}; > String message= Messages.format(ReorgMessages.ReorgQueries_enterNewNameQuestion, keys); >- return createStaticQuery(createPackageNameValidator(pack), message, initialSuggestedName, getShell()); >+ return createStaticQuery(createPackageNameValidator(pack), message, initialSuggestedName, false, getShell()); > } > > public INewNameQuery createNewPackageFragmentRootNameQuery(IPackageFragmentRoot root, String initialSuggestedName) { > String[] keys= {JavaElementLabels.getElementLabel(root, JavaElementLabels.ALL_DEFAULT)}; > String message= Messages.format(ReorgMessages.ReorgQueries_enterNewNameQuestion, keys); >- return createStaticQuery(createPackageFragmentRootNameValidator(root), message, initialSuggestedName, getShell()); >+ return createStaticQuery(createPackageFragmentRootNameValidator(root), message, initialSuggestedName, false, getShell()); > } > > >@@ -119,7 +119,7 @@ > }; > } > >- private static INewNameQuery createStaticQuery(final IInputValidator validator, final String message, final String initial, final Shell shell){ >+ private static INewNameQuery createStaticQuery(final IInputValidator validator, final String message, final String initial, final boolean isFile, final Shell shell) { > return new INewNameQuery(){ > public String getNewName() throws OperationCanceledException { > InputDialog dialog= new InputDialog(shell, ReorgMessages.ReorgQueries_nameConflictMessage, message, initial, validator) { >@@ -132,6 +132,15 @@ > TextFieldNavigationHandler.install(getText()); > return area; > } >+ >+ @Override >+ protected void createButtonsForButtonBar(Composite parent) { >+ super.createButtonsForButtonBar(parent); >+ int lastIndexOfDot= initial.lastIndexOf('.'); >+ if (isFile && lastIndexOfDot > 0) { >+ getText().setSelection(0, lastIndexOfDot); >+ } >+ } > }; > if (dialog.open() == Window.CANCEL) > throw new OperationCanceledException();
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 437398
: 244547