Community
Participate
Working Groups
The text field where one types the name of the Java Type in Open Type dialog could be initialized with the contents of clipboard if it contains a valod Java Type name. The text should be pre selected so that user can simply hit delete and start from scratch. This is helpful when one has copied the Java Type name into the clipboard from some other window - for example command shell window or other editor etc. This could be applied to other dialogs also i.e. Open Type Hierarchy, Java Search etc. This behaviour may be under the control of some perference - something like: [ ] Initialize dialogs with Clipboard content when applicable. under Windows:Preferences:Java:Dialogs
Time permitted.
Here is a snippet of code that may help: --- OpenTypeSelectionDialog dialog = ...; : Clipboard cb = new Clipboard(....getDisplay()); TextTransfer transfer = TextTransfer.getInstance(); String data = (String)cb.getContents(transfer); if (data != null) { // check if selection is a Java type name boolean isValid = data.length() > 0 && Character.isJavaIdentifierStart(data.charAt(0)); for (int i = 1; isValid && i < data.length(); i++) { isValid = Character.isJavaIdentifierPart(data.charAt(i)); } if (isValid) { dialog.setFilter(data); } } cb.dispose(); --- There may already be utility methods in JDT to check if the contents of a String is a valid Java Type name.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.
*** Bug 465526 has been marked as a duplicate of this bug. ***