Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 83474 - [CellEditors] TextCellEditor does not correctly determine paste enablement
Summary: [CellEditors] TextCellEditor does not correctly determine paste enablement
Status: RESOLVED DUPLICATE of bug 88527
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-21 19:28 EST by Pratik Shah CLA
Modified: 2005-08-15 10:46 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 Pratik Shah CLA 2005-01-21 19:28:36 EST
I propose that TextCellEditor#isPasteEnabled() be changed to the following:

boolean result = false;
if (text != null && !text.isDisposed()) {
    Clipboard cb = new Clipboard(Display.getDefault());
    TransferData[] transferTypes = cb.getAvailableTypes();
    for (int i = 0; i < transferTypes.length; i++) {
        if (TextTransfer.getInstance().isSupportedType(transferTypes[i])) {
            result = true;
            break;
        }
    }
    cb.dispose();
}
return result;
Comment 1 Tod Creasey CLA 2005-01-24 08:57:52 EST
Can you explain the problem please?
Comment 2 Randy Hudson CLA 2005-01-24 10:24:03 EST
Paste is enabled but can't actually work because no text is on the Clipboard.

Changing the behavior would require that paste re-enable later.  This is 
currently not possible since clipboard notification doesn't exist.
Comment 3 Pratik Shah CLA 2005-01-24 12:05:34 EST
TextCellEditor updates the status of paste (on the context menu) when you 
copy/cut some text in that celleditor.  And if you copy/cut it from somewhere 
else, the textcelleditor loses focus and disappears.  So, I think this change 
would work even without the clipboard notification.
Comment 4 Randy Hudson CLA 2005-01-24 13:15:24 EST
I think that menu is a native one for the win32 control. A paste action tied 
into the celleditor could be displayed anywhere (or actually, only toolitems 
and menuitems, otherwise focus would be lost). The copy could occur within the 
celleditor itself, making paste dynamically enabled.
Comment 5 Eric Moffatt CLA 2005-08-15 10:46:17 EDT

*** This bug has been marked as a duplicate of 88527 ***