1 6 7 package com.quikj.client.beans; 8 9 13 public class Clipboard 14 { 15 private static Clipboard instance = null; 16 private StringBuffer buffer = new StringBuffer (); 17 18 19 private Clipboard() 20 { 21 instance = this; 22 } 23 24 public static Clipboard getInstance() 25 { 26 if (instance == null) 27 { 28 new Clipboard(); 29 } 30 31 return instance; 32 } 33 34 public void copy(String text) 35 { 36 buffer = new StringBuffer (text); 37 } 38 39 public void append(String text) 40 { 41 buffer.append(text); 42 } 43 44 public void clear() 45 { 46 buffer = new StringBuffer (); 47 } 48 49 public String paste() 50 { 51 return buffer.toString(); 52 } 53 } 54 | Popular Tags |