當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。