use of java.awt.datatransfer.StringSelection in project android by JetBrains.
the class PTableTest method testPasteIsNotAvailableWhenNothingIsSelected.
public void testPasteIsNotAvailableWhenNothingIsSelected() {
when(myCopyPasteManager.getContents()).thenReturn(new StringSelection("new value"));
assertThat(myTable.isPastePossible(myContext)).isFalse();
assertThat(myTable.isPasteEnabled(myContext)).isTrue();
myTable.performPaste(myContext);
assertHasOriginalValues();
}
use of java.awt.datatransfer.StringSelection in project android by JetBrains.
the class PTableTest method testPasteIsNotAvailableToGroupNode.
public void testPasteIsNotAvailableToGroupNode() throws Exception {
when(myCopyPasteManager.getContents()).thenReturn(new StringSelection("new value"));
myTable.setRowSelectionInterval(2, 2);
assertThat(myTable.isPastePossible(myContext)).isFalse();
assertThat(myTable.isPasteEnabled(myContext)).isTrue();
myTable.performPaste(myContext);
assertHasOriginalValues();
}
use of java.awt.datatransfer.StringSelection in project android by JetBrains.
the class GenerateLayoutTestSkeletonAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
NlModel model = getModel(event.getProject());
if (model == null) {
return;
}
int option = Messages.showDialog(model.getProject(), "Generate LayoutTest skeleton with the current layout components.", "Generate LayoutTest Skeleton", new String[] { "Copy to Clipboard", "Cancel" }, 0, AndroidIcons.AndroidTestRoot);
if (option == 0) {
CopyPasteManager.getInstance().setContents(new StringSelection(generateModelFixture(model)));
}
}
use of java.awt.datatransfer.StringSelection in project android by JetBrains.
the class PTable method performCopy.
@Override
public void performCopy(@NotNull DataContext dataContext) {
PTableItem item = getSelectedNonGroupItem();
if (item == null) {
return;
}
myCopyPasteManager.setContents(new StringSelection(item.getValue()));
}
use of java.awt.datatransfer.StringSelection in project intellij-community by JetBrains.
the class DumpLookupElementWeights method dumpLookupElementWeights.
public static void dumpLookupElementWeights(final LookupImpl lookup) {
LookupElement selected = lookup.getCurrentItem();
String sb = "selected: " + selected;
if (selected != null) {
sb += "\nprefix: " + lookup.itemPattern(selected);
}
sb += "\nweights:\n" + StringUtil.join(getLookupElementWeights(lookup, true), "\n");
System.out.println(sb);
LOG.info(sb);
try {
CopyPasteManager.getInstance().setContents(new StringSelection(sb));
} catch (Exception ignore) {
}
}
Aggregations