Package org.olat.core.commons.services.clipboard

Examples of org.olat.core.commons.services.clipboard.ClipboardEntry


    if (event == ComponentUtil.VALIDATE_EVENT) {
      // before rendering, check if we can still or newly offer the paste
      // button.
      // this is the case when the clipboard contains an entry which matches
      // the desired dataflavor
      ClipboardEntry cbe = cbs.getClipboardEntry();
      if (cbe == null) {
        // or do a setVisible?
        pasteFrom.setEnabled(false);
      } else {
        // there is an entry in the clipboard, check if we can make use of it.
       
        // TODO: Improve this handling
        boolean accepted = false;
        for (int i = 0; !accepted && i < acceptedFlavorInterfaces.length; i++) {
          Class aclass = acceptedFlavorInterfaces[i];
          if (aclass.equals(cbe.getClass())) {
            pasteFrom.setEnabled(true);
            accepted = true;
          }
        }
      }
View Full Code Here


  }

  @Override
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == copyTo) {
      ClipboardEntry cbe = cbCreator.createClipboardEntry();
      cbs.setClipboardEntry(cbe);
    }
  }
View Full Code Here

  public void event(UserRequest ureq, Component source, Event event) {
    if (event == ComponentUtil.VALIDATE_EVENT) {
      // before rendering, check if we can still or newly offer the paste
      // button. this is the case when the clipboard contains an entry which
      // matches the desired dataflavor
      ClipboardEntry cbe = cbs.getClipboardEntry();
      if (cbe == null) {
        expandedP.setContent(null);
        if (trayContentC != null) trayContentC.dispose();
      } else {
        if (cbe != latestCB) {
          latestCB = cbe;
          trayContentC = cbe.createTrayUI().createController(ureq, getWindowControl());
          frdC = new FloatingResizableDialogController(ureq, getWindowControl(), trayContentC.getInitialComponent(), "clipboard tray");
          frdC.addControllerListener(this);
          detail = frdC.getInitialComponent();
          expandedP.setContent(detail);
        }
View Full Code Here

    // nothing to do yet
  }

  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == pasteFromC) {
      ClipboardEntry cbe = cps.getClipboardEntryFrom(event);
      DemoClipboardEntry dcbe = (DemoClipboardEntry) cbe;
      getWindowControl().setInfo("content of clipboard is:"+dcbe.getText());
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.core.commons.services.clipboard.ClipboardEntry

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.