当前位置: 首页>>代码示例>>Java>>正文


Java DND.error方法代码示例

本文整理汇总了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);
}
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:19,代码来源:CustomTransfer.java

示例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) {
    }
}
 
开发者ID:nilsschmidt1337,项目名称:ldparteditor,代码行数:19,代码来源:MyDummyTransfer2.java

示例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) {
    }
}
 
开发者ID:nilsschmidt1337,项目名称:ldparteditor,代码行数:19,代码来源:MyDummyTransfer.java

示例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) {
		
	}
}
 
开发者ID:tmfev,项目名称:IDRT-Import-and-Mapping-Tool,代码行数:21,代码来源:ServerTransferType.java

示例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) {
		
	}
}
 
开发者ID:tmfev,项目名称:IDRT-Import-and-Mapping-Tool,代码行数:21,代码来源:I2b2ProjectTransferType.java

示例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();
	}
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:19,代码来源:ColumnModelTransfer.java

示例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);
}
 
开发者ID:jo-source,项目名称:jo-widgets,代码行数:8,代码来源:ObjectTransfer.java

示例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);
	}
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:11,代码来源:XLiffTextTransfer.java

示例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);
	}
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:11,代码来源:HSTextTransfer.java


注:本文中的org.eclipse.swt.dnd.DND.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。