Giter Club home page Giter Club logo

wicket-dnd's Introduction

wicket-dnd

A generic Drag&Drop framework for Wicket:

(see http://code.google.com/p/wicket-dnd for Wicket 1.4 and 1.5)

  • operate on any markup element via selectors
  • drag and drop between any Wicket components
  • vertical, horizontal and hierarchical structured markup
  • drag initiators (a.k.a. handles)
  • common desktop metaphors with MOVE, COPY and LINK operations
  • transfer types
  • themeable
  • works in Firefox, Safari, Chrome, Opera

See our live examples on http://wicket-dnd-jquery.appspot.com (beware - very slow!).

Themes

You have to add a theme (build-in or your own) to your component you want to enable for DnD, e.g.

container.add(new WindowsTheme());

Drag source

Enable a component as a source of drags:

container.add(new DragSource(Operation.MOVE) {
  public void onAfterDrop(AjaxRequestTarget target, Transfer transfer) {
    // remove transfer data
  }
}.drag("tr"));

In this example only a MOVE operation is allowed. Drags are initiated on <tr> tags.

Drop target

Enable a component as a target for drops:

container.add(new DropTarget(Operation.MOVE, Operation.COPY) {
  public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) {
    // add transfer data
  }
}.dropCenter("tr"));

In this example MOVE and COPY operations are allowed. Drops are performed on center of <tr> tags, the location holds a reference to the actual component and the anchor the transfer was dropped on.

Maven dependency

Releases are available on Maven central and OSS Sonatype.

<dependency>
  <groupId>com.github.svenmeier.wicket-dnd</groupId>
  <artifactId>wicket-dnd</artifactId>
  <version>0.6.2</version>
</dependency>

<dependency>
  <groupId>com.github.svenmeier.wicket-dnd</groupId>
  <artifactId>wicket-dnd</artifactId>
  <version>0.7.3</version>
</dependency>

For snapshot releases you have to use the OSS Sonatype Snapshot repository:

<dependency>
  <groupId>com.github.svenmeier.wicket-dnd</groupId>
  <artifactId>wicket-dnd</artifactId>
  <version>0.7.4-SNAPSHOT</version>
</dependency>

<repository>
  <id>sonatype-snapshots</id>
  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>		
</repository>

wicket-dnd's People

Contributors

svenmeier avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.