Package javax.swing

Examples of javax.swing.TransferHandler$DropHandler


                }
            }
        });

        propertiesTable.setDragEnabled(true);
        propertiesTable.setTransferHandler(new TransferHandler("testProperty"));

        if (getHolder().getModelItem() != null) {
            DropTarget dropTarget = new DropTarget(propertiesTable, new PropertyHolderTablePropertyExpansionDropTarget());
            dropTarget.setDefaultActions(DnDConstants.ACTION_COPY_OR_MOVE);
        }
View Full Code Here


  public void setDragEnabled( boolean state )
  {   
    if ( state ) {
      XTransferHandlerFactory thf = XTransferHandlerFactory.getInstance( XProjectManager.getCurrentProject());
      if ( thf != null ) {
        TransferHandler th = thf.getTransferHandler( this, null );
        if ( th != null ) {
          super.setDragEnabled( true );
          setTransferHandler( th );
//            addMouseListener( this );
//            addMouseMotionListener( this );
View Full Code Here

      //Arbitrarily define a 5-pixel shift as the
      //official beginning of a drag.
      if ((( dx > 5 ) || ( dy > 5 )) &&  dockable.canDrag ) {
        //This is a drag, not a click.
        JComponent c = (JComponent)e.getSource();
        TransferHandler handler = c.getTransferHandler();
        //Tell the transfer handler to initiate the drag.
        handler.exportAsDrag( c, firstMouseEvent, action );
        firstMouseEvent = null;
     
        glassPane = (Container)getRootPane().getGlassPane();
        glassPane.setVisible( true );
        dockable.dockedContainer.addDragProxies( glassPane );
View Full Code Here

    else if ( attribNameLwr.equals( "dragenabled" )) {
      boolean state = "true".equals( attribValueLwr );
      if ( state ) {
        XTransferHandlerFactory thf = XTransferHandlerFactory.getInstance( XProjectManager.getCurrentProject());
        if ( thf != null ) {
          TransferHandler th = thf.getTransferHandler( this, null );
          if ( th != null ) {
            addMouseListener( this );
            addMouseMotionListener( this );
            setTransferHandler( th );
            return 0;
View Full Code Here

      //official beginning of a drag.
      if (( dx > 5 ) || ( dy > 5 )) {
        //This is a drag, not a click.
        JComponent c = (JComponent)e.getSource();
        //Tell the transfer handler to initiate the drag.
        TransferHandler handler = c.getTransferHandler();
        handler.exportAsDrag( c, firstMouseEvent, action );
        firstMouseEvent = null;
      }
    }
  }
View Full Code Here

  public void setDragEnabled( boolean state )
  {   
    if ( state ) {
      XTransferHandlerFactory thf = XTransferHandlerFactory.getInstance( XProjectManager.getCurrentProject());
      if ( thf != null ) {
        TransferHandler th = thf.getTransferHandler( this, null );
        if ( th != null ) {
          super.setDragEnabled( true );
          setTransferHandler( th );
          return;
        }
View Full Code Here

     *            the <code>JTextComponent</code> that should accept drops of data elements
     * @param insertPattern
     *            a format pattern describing the string that should be inserted
     */
    public static void installDropHandler(JTextComponent tc, String insertPattern) {
        TransferHandler defaultHandler = tc.getTransferHandler();
        if (!(defaultHandler instanceof ImportHandler)) {
            tc.setTransferHandler(new ImportHandler(insertPattern, defaultHandler));
        }
    }
View Full Code Here

            tc.setTransferHandler(new ImportHandler(insertPattern, defaultHandler));
        }
    }
   
    public static void installRejector(JTextComponent tc) {
        TransferHandler defaultHandler = tc.getTransferHandler();
        if (!(defaultHandler instanceof Rejector)) {
            tc.setTransferHandler(new Rejector(defaultHandler));
        }
    }
View Full Code Here

            sup.installSingleQuoteAction(textPane);
        }
    }

    private void installTransferHandler() {
        TransferHandler original = textPane.getTransferHandler();
        TransferHandler customized = new ExpressionAreaTransferHandler(original);
        textPane.setTransferHandler(customized);
    }
View Full Code Here

        return dynamicTree.getModel();
    }

    public void addDropStrategy(TreeDropStrategy s) {
        labelDropHandler.addDropStrategy(s);
        TransferHandler treeHandler = tree.getTransferHandler();
        if (treeHandler instanceof TreeTransferHandler) {
            ((TreeTransferHandler) treeHandler).addDropStrategy(s);
        }
    }
View Full Code Here

TOP

Related Classes of javax.swing.TransferHandler$DropHandler

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.