List of usage examples for java.awt.datatransfer Clipboard addFlavorListener
public synchronized void addFlavorListener(FlavorListener listener)
From source file:org.docx4all.ui.main.WordMLEditor.java
void preStartup(JApplet applet) { _applet = applet;//w w w. ja va 2s .co m _viewManager = new ViewManager(); _iframeMap = new HashMap<String, JInternalFrame>(); log.info("setting up InternalFrameListener"); _internalFrameListener = new InternalFrameListener(); log.info("setting up TitleBarMouseListener"); _titleBarMouseListener = new TitleBarMouseListener(); log.info("setting up ToolBarStates"); _toolbarStates = new ToolBarStates(); Clipboard clipboard = getContext().getClipboard(); clipboard.addFlavorListener(_toolbarStates); //As a FlavorListener, _toolbarStates will ONLY be notified //when there is a DataFlavor change in Clipboard. //Therefore, make sure that toolbarStates' _isPasteEnable property //is initialised correctly. boolean available = clipboard.isDataFlavorAvailable(WordMLTransferable.STRING_FLAVOR) || clipboard.isDataFlavorAvailable(WordMLTransferable.WORDML_FRAGMENT_FLAVOR); _toolbarStates.setPasteEnabled(available); log.info("setting up VFSJFileChooser"); initVFSJFileChooser(); log.info("setting up WmlExitListener"); addExitListener(new WmlExitListener()); }