本文整理匯總了Java中org.eclipse.swt.dnd.DND.error方法的典型用法代碼示例。如果您正苦於以下問題:Java DND.error方法的具體用法?Java DND.error怎麽用?Java DND.error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.dnd.DND
的用法示例。
在下文中一共展示了DND.error方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
@Override
public void javaToNative (Object object, TransferData transferData) {
if (!checkCustom(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
byte [] bytes = null;
if (object instanceof ByteBuffer) {
bytes = ((ByteBuffer)object).array();
} else {
if (object instanceof byte []) {
bytes = (byte []) object;
}
}
if (bytes == null) {
DND.error(DND.ERROR_INVALID_DATA);
}
super.javaToNative(bytes, transferData);
}
示例2: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
@Override
public void javaToNative(Object object, TransferData transferData) {
if (!checkMyType(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
MyDummyType2 myTypes = (MyDummyType2) object;
try {
// write data to a byte array and then ask super to convert to
// pMedium
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream writeOut = new DataOutputStream(out);
writeOut.writeInt(myTypes.dummy);
byte[] buffer2 = out.toByteArray();
writeOut.close();
super.javaToNative(buffer2, transferData);
} catch (IOException e) {
}
}
示例3: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
@Override
public void javaToNative(Object object, TransferData transferData) {
if (!checkMyType(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
MyDummyType myTypes = (MyDummyType) object;
try {
// write data to a byte array and then ask super to convert to
// pMedium
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream writeOut = new DataOutputStream(out);
writeOut.writeInt(myTypes.dummy);
byte[] buffer2 = out.toByteArray();
writeOut.close();
super.javaToNative(buffer2, transferData);
} catch (IOException e) {
}
}
示例4: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
@Override
public void javaToNative(Object object, TransferData transferData) {
try {
if (!checkMyType(object) || !isSupportedType(transferData)) {
MessageDialog.openError(Application.getShell(), "Error", "You cannot drop this item here!");
DND.error(DND.ERROR_INVALID_DATA);
}
Server server = (Server) object;
// write data to a byte array and then ask super to convert to pMedium
ByteArrayOutputStream out = new ByteArrayOutputStream();
ObjectOutputStream writeOut = new ObjectOutputStream(out);
writeOut.writeObject(server);
byte[] buffer = out.toByteArray();
writeOut.close();
super.javaToNative(buffer, transferData);
} catch (IOException e) {
}
}
示例5: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
@Override
public void javaToNative(Object object, TransferData transferData) {
try {
if (!checkMyType(object) || !isSupportedType(transferData)) {
MessageDialog.openError(Application.getShell(), "Error", "You cannot drop this item here!");
DND.error(DND.ERROR_INVALID_DATA);
}
I2b2Project server = (I2b2Project) object;
// write data to a byte array and then ask super to convert to pMedium
ByteArrayOutputStream out = new ByteArrayOutputStream();
ObjectOutputStream writeOut = new ObjectOutputStream(out);
writeOut.writeObject(server);
byte[] buffer = out.toByteArray();
writeOut.close();
super.javaToNative(buffer, transferData);
} catch (IOException e) {
}
}
示例6: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
public void javaToNative(Object object, TransferData transferData)
{
if (!checkColumnModel(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
ColumnModel[] cols = (ColumnModel[]) object;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(out);
DataOutputStream writeOut = new DataOutputStream(out);
oos.writeObject(cols);
byte[] buffer = out.toByteArray();
writeOut.close();
super.javaToNative(buffer, transferData);
} catch (IOException e) {
e.printStackTrace();
}
}
示例7: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
@Override
public void javaToNative(final Object object, final TransferData transferData) {
if (!validate(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
super.javaToNative(Serializer.serialize(object), transferData);
}
示例8: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
public void javaToNative(Object object, TransferData transferData) {
if (!checkMyType(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
String string = (String) object;
byte[] bytes = string.getBytes();
if (bytes != null) {
super.javaToNative(bytes, transferData);
}
}
示例9: javaToNative
import org.eclipse.swt.dnd.DND; //導入方法依賴的package包/類
public void javaToNative(Object object, TransferData transferData) {
if (!checkMyType(object) || !isSupportedType(transferData)) {
DND.error(DND.ERROR_INVALID_DATA);
}
String string = (String)object;
byte[] bytes = string.getBytes();
if (bytes != null) {
super.javaToNative(bytes, transferData);
}
}