Examples of StringSelection


Examples of java.awt.datatransfer.StringSelection

               buf.append(colDef.getColumnName()).append(getData(colDef, cellObj, StatType.UPDATE));
            }

            buf.append(" WHERE\n");
         }
         final StringSelection ss = new StringSelection(buf.toString());
         Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, ss);
      }
   }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

            colNames.setLength(0);
            vals.setLength(0);

         }
         final StringSelection ss = new StringSelection(buf.toString());
         Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, ss);
      }
   }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

   * Place a String on the clipboard, and make this class the
   * owner of the Clipboard's contents.
   */
  public void setClipboardContents( String aString )
  {
    StringSelection stringSelection = new StringSelection( aString ) ;
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() ;
    clipboard.setContents( stringSelection, this ) ;
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

            // putValue(MNEMONIC_KEY, GUIGlobals.copyKeyCode);
        }

        public void actionPerformed(ActionEvent e) {
            String s = (entry.getField(BibtexFields.KEY_FIELD));
            StringSelection ss = new StringSelection(s);

            if (s != null)
                Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, ss);
        }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

                pasteText();
            }
        }

        private void copySelectedText() {
            final StringSelection selection = new StringSelection(sourceTextComponent.getSelectedText());
            clipboard.setContents(selection, this);
        }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

            final StringSelection selection = new StringSelection(sourceTextComponent.getSelectedText());
            clipboard.setContents(selection, this);
        }

        private void cutSelectedText() {
            final StringSelection selection = new StringSelection(sourceTextComponent.getSelectedText());
            clipboard.setContents(selection, this);

            final int start = sourceTextComponent.getSelectionStart();
            final int end = sourceTextComponent.getSelectionEnd();
            try {
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

            putValue(Action.MNEMONIC_KEY, new Integer('u'));
            putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK));
        }

        public void actionPerformed(ActionEvent evt) {
            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getText()), XTextField.this);
            setText("");
        }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

    }

    // Supporting actions
    class CopyAction extends AbstractCopyAction {
        public void actionPerformed(ActionEvent evt) {
            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getText()), XTextField.this);
        }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

  public void lostOwnership(Clipboard clipboard, Transferable contents) {
  }
 
 
  void setClipboardContents( String str ){
    StringSelection stringSelection = new StringSelection( str );
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents( stringSelection, this );
  }
View Full Code Here

Examples of java.awt.datatransfer.StringSelection

      }
      sb.deleteCharAt(sb.length() - 1);
      sb.append("\n");
    }
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    StringSelection stsel = new StringSelection(sb.toString());

    clipboard.setContents(stsel, stsel);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.