-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta
-
sparc
-
solaris_2.6
Name: auR10023 Date: 01/10/2001
Method javax.swing.TransferHandler.getSourceActions(JComponent c) returns
TransferHandler.COPY instead of TransferHandler.NONE when JComponent c does
not contain necessary property.
The javadoc says:
...
Returns:
This is implemented to return COPY if the transfer property can be found, otherwise
NONE is returned. A return value of NONE disables any transfers out of the component.
...
Here is the example:
---t.java---
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class t{
public static void main(String [] args) {
TransferHandler testHandler = new TransferHandler("stringProperty");
JComponent c = new TestComp();
if (testHandler.getSourceActions(c) == TransferHandler.NONE) {
System.out.println("Returns NONE");
} else if (testHandler.getSourceActions(c) == TransferHandler.COPY) {
System.out.println("Returns COPY");
}
}
}
class TestComp extends javax.swing.JComponent
implements java.io.Serializable {
public TestComp() {
}
}
-----output-----
Returns COPY
======================================================================