package org.reldb.dbrowser.handlers.edit;

import org.reldb.dbrowser.handlers.EditMenuItem;

public class Paste extends EditMenuItem {
	public Paste() {
		super("paste");
	}
}

@@ -51,126 +51,989 @@
 org.
-reldb.dbrowser.handlers.EditMenuItem;%0A%0Apublic class Paste extends EditMenuItem %7B%0A%09public Paste() %7B%0A%09%09super(%22paste%22);%0A%09%7D
+eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;%0Aimport org.eclipse.swt.dnd.Clipboard;%0Aimport org.eclipse.swt.dnd.HTMLTransfer;%0Aimport org.eclipse.swt.dnd.TextTransfer;%0Aimport org.eclipse.swt.widgets.Display;%0Aimport org.reldb.dbrowser.handlers.EditMenuItem;%0A%0Apublic class Paste extends EditMenuItem %7B%0A%09public Paste() %7B%0A%09%09super(%22paste%22);%0A%09%7D%0A%09%0A%09private boolean isThereSomethingToPaste() %7B%0A%09%09Clipboard clipboard = new Clipboard(Display.getCurrent());%0A%09%09try %7B%0A%09%09%09TextTransfer textTransfer = TextTransfer.getInstance();%0A%09%09%09HTMLTransfer htmlTransfer = HTMLTransfer.getInstance();%0A%09%09%09String textData = (String)clipboard.getContents(textTransfer);%0A%09%09%09String htmlData = (String)clipboard.getContents(htmlTransfer);%0A%09%09%09return (textData != null && textData.length() %3E 0) %7C%7C (htmlData != null && htmlData.length() %3E 0);%0A%09%09%7D finally %7B%0A%09%09%09clipboard.dispose();%09%0A%09%09%7D%0A%09%7D%0A%09%0A%09public boolean canExecute(MHandledMenuItem item) %7B%0A%09%09return super.canExecute(item) && isThereSomethingToPaste();%0A%09%7D%0A
 %0A%7D%0A

Paste menu only shows when there is something to paste.