Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 76589 - Use the name of a class in clipboard to initialize OpenType dialog [dialogs]
Summary: Use the name of a class in clipboard to initialize OpenType dialog [dialogs]
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 465526 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-19 14:41 EDT by Sandip Chitale CLA
Modified: 2015-04-27 04:47 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sandip Chitale CLA 2004-10-19 14:41:20 EDT
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
Comment 1 Dirk Baeumer CLA 2004-10-20 05:58:29 EDT
Time permitted.
Comment 2 Sandip Chitale CLA 2004-10-20 13:03:15 EDT
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.
Comment 3 Denis Roy CLA 2009-08-30 02:17:44 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.
Comment 4 Dani Megert CLA 2015-04-27 04:47:41 EDT
*** Bug 465526 has been marked as a duplicate of this bug. ***