Package java.awt.datatransfer

Examples of java.awt.datatransfer.StringSelection


    if (clipboard == null) {
      return;
    }
    StringBuilder text = new StringBuilder();
    treeLogTraverse(text, node, 0);
    StringSelection selection = new StringSelection(text.toString());
    clipboard.setContents(selection, selection);
  }
View Full Code Here


            int rowEnd = Utilities.getRowEnd(output, pos);
            String line = output.getDocument().getText(rowStart, rowEnd - rowStart);
            if (opListener.getCmdHistory().contains(line)) {
                output.select(rowStart, rowEnd);
                cmdText.setText(line);
                systemClipboard.setContents(new StringSelection(line), this);
            }
        } catch (BadLocationException e) {
            e.printStackTrace();
        }
View Full Code Here

                if (i < colMaxSelectionIndex) {
                    content.append(lineSeparator);
                }
            }

            return new StringSelection(content.toString());
        }
View Full Code Here

      putValue(Action.NAME, UtilMessages.getInstance().getString("SystemInformationDialog.CopyToClipboard")); // NON-NLS
    }

    public void actionPerformed(final ActionEvent e)
    {
      ClipboardManager.getManager().setRawContent(new StringSelection(getSystemInformationAsText()));
    }
View Full Code Here

        }
        final Object value = selectedValues[i];
        b.append(quoter.doQuoting(String.valueOf(value)));
      }

      return new StringSelection(b.toString());
    }
View Full Code Here

        at.printStackTrace(pw);
      }

      pw.close();

      ClipboardManager.getManager().setRawContent(new StringSelection(b.toString()));
    }
View Full Code Here

        return Arrays.asList(CopyAction.ID);
    }

    public boolean triggerAction(JTree tree, String action) throws Exception {
        if (action.equals(CopyAction.ID)) {
            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getExperimentInfo()), null);
        }
        return super.triggerAction(tree, action);
    }
View Full Code Here

  public boolean triggerAction(JTree tree,String action) throws Exception{
    if (action.equals(ViewAction.ID)) {
      TextWindow textWindow = new TextWindow(getXBayaEngine(), getParameter().getName(), getParameter().getValue().toString(),"Parameter Content");
      textWindow.show();
    } else if (action.equals(CopyAction.ID)) {
          Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getParameter().getValue().toString()), null);
        }
    return super.triggerAction(tree, action);
  }
View Full Code Here

    }

    @Override
    public void setClipboard(final String clip, final Class<?> class1) {
        final Clipboard cb = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
        cb.setContents(new StringSelection(clip), null);
    }
View Full Code Here

     * job.end(); } frame.dispose();
     */

    public static void saveToClipboard(final String text) {
        final Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
        final StringSelection ss = new StringSelection(text);
        cb.setContents(ss, ss);
    }
View Full Code Here

TOP

Related Classes of java.awt.datatransfer.StringSelection

Copyright © 2018 www.massapicom. 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.