This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Select a inner part of a string constant, execute the hint and the selected part is extracted to a variable/field/parameter/constant. See the feature in eclipse: http://eclipseone.wordpress.com/2010/04/19/extract-constants-from-strings-and-numbers-with-eclipse-refactorings/
Somehow related to https://netbeans.org/bugzilla/show_bug.cgi?id=238295
I understand how extraction of a part of String could work, but what to do with numbers ? I've read through the original text on EclipseONE, but the former two procedures are just NetBeans Introduce Constant hint, we're missing just the last extract part of string intention. Do I miss something ?
*** Bug 238295 has been marked as a duplicate of this bug. ***
(In reply to Svata Dedic from comment #2) > I understand how extraction of a part of String could work, but what to do > with numbers ? I've read through the original text on EclipseONE, but the > former two procedures are just NetBeans Introduce Constant hint, we're > missing just the last extract part of string intention. Do I miss something ? No, you didn't. The subheading "Pick out part of a string" was the only relevant one. I like to propose a patch for it, but org.netbeans.spi.java.hints.HintContext only provides the caret location and not the selection start and selection end. That was the reason I only support "split at caret" in my plugin https://github.com/markiewb/nb-additional-hints/commit/f5530a3989bed487b0473db7c74c541c83a2da84 BTW: Is it possible to set the caret location/selection after applying a fix/transformation? Worth an RFE I think...
Created attachment 147654 [details] How it is done in IntellijIDEA - taken from http://jetbrains.dzone.com/articles/top-20-refactoring-features