本文整理汇总了Java中java.awt.datatransfer.DataFlavor.match方法的典型用法代码示例。如果您正苦于以下问题:Java DataFlavor.match方法的具体用法?Java DataFlavor.match怎么用?Java DataFlavor.match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.datatransfer.DataFlavor
的用法示例。
在下文中一共展示了DataFlavor.match方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import java.awt.datatransfer.DataFlavor; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
boolean passed = true;
try {
df1 = new DataFlavor("application/postscript");
df2 = new DataFlavor();
df3 = new DataFlavor();
} catch (ClassNotFoundException e1) {
throw new RuntimeException("Could not create DataFlavors. This should never happen.");
} catch (IllegalArgumentException e2) {
passed = false;
}
try {
boolean b;
b = df1.match(df2);
b = df2.match(df1);
b = df2.match(df3);
} catch (NullPointerException e) {
throw new RuntimeException("The test FAILED: DataFlavor.match still throws NPE");
}
if (!passed) {
throw new RuntimeException("Test FAILED");
}
System.out.println("Test PASSED");
}
示例2: isDataFlavorSupported
import java.awt.datatransfer.DataFlavor; //导入方法依赖的package包/类
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
if (flavor.match(DataTableColumnCollection.DATATABLE_COLUMN_COLLECTION_FLAVOR)) {
return true;
}
return false;
}
示例3: isDataFlavorSupported
import java.awt.datatransfer.DataFlavor; //导入方法依赖的package包/类
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
if (flavor.match(VALUE_SOURCE_FLAVOR)) {
return true;
}
return false;
}
示例4: isDataFlavorSupported
import java.awt.datatransfer.DataFlavor; //导入方法依赖的package包/类
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
if (flavor.match(RANGE_AXIS_CONFIG_FLAVOR)) {
return true;
}
return false;
}
示例5: isDataFlavorSupported
import java.awt.datatransfer.DataFlavor; //导入方法依赖的package包/类
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
if (flavor.match(DataFlavor.plainTextFlavor)) {
return true;
}
return false;
}