use of org.eclipse.swt.dnd.Clipboard in project GT by Tencent.
the class CopyAllFromTableViewAction method run.
@Override
public void run() {
StringBuffer sb = getContents();
clipboard = new Clipboard(Display.getCurrent());
Transfer[] transfers = new Transfer[] { TextTransfer.getInstance() };
clipboard.setContents(new String[] { sb.toString() }, transfers);
}
use of org.eclipse.swt.dnd.Clipboard in project GT by Tencent.
the class CopyAllFromTreeViewAction method run.
@Override
public void run() {
StringBuffer sb = getContents();
clipboard = new Clipboard(Display.getCurrent());
Transfer[] transfers = new Transfer[] { TextTransfer.getInstance() };
clipboard.setContents(new String[] { sb.toString() }, transfers);
}
use of org.eclipse.swt.dnd.Clipboard in project GT by Tencent.
the class CopySelectedItemsFromTreeViewAction method run.
@Override
public void run() {
StringBuffer sb = getContents();
clipboard = new Clipboard(Display.getCurrent());
Transfer[] transfers = new Transfer[] { TextTransfer.getInstance() };
clipboard.setContents(new String[] { sb.toString() }, transfers);
}
use of org.eclipse.swt.dnd.Clipboard in project dbeaver by serge-rider.
the class ResultSetUtils method getAttributeValueFromClipboard.
@Nullable
public static Object getAttributeValueFromClipboard(DBDAttributeBinding attribute) throws DBCException {
DBPDataSource dataSource = attribute.getDataSource();
Clipboard clipboard = new Clipboard(Display.getCurrent());
try (DBCSession session = DBUtils.openUtilSession(VoidProgressMonitor.INSTANCE, dataSource, "Copy from clipboard")) {
String strValue = (String) clipboard.getContents(TextTransfer.getInstance());
return attribute.getValueHandler().getValueFromObject(session, attribute.getAttribute(), strValue, true);
} finally {
clipboard.dispose();
}
}
use of org.eclipse.swt.dnd.Clipboard in project dbeaver by serge-rider.
the class ResultSetUtils method copyToClipboard.
public static void copyToClipboard(String string) {
if (string != null && string.length() > 0) {
Clipboard clipboard = new Clipboard(Display.getCurrent());
try {
TextTransfer textTransfer = TextTransfer.getInstance();
clipboard.setContents(new Object[] { string }, new Transfer[] { textTransfer });
} finally {
clipboard.dispose();
}
}
}
Aggregations