SlideShare a Scribd company logo
DRAG&DROP CON WICKET DnD [Santi Caltabiano]
--------------------------------------------------------------------------------
--------------------------------------------------
Libreria: wicket-dnd
--------------------------------------------------------------------------------
--------------------------------------------------
- https://code.google.com/p/wicket-dnd/
Wicket DnD per wicket 1.5 e 1.6
- https://github.com/svenmeier/wicket-dnd
Wicket DnD per wicket 1.7
> https://github.com/svenmeier/wicket-dnd
--------------------------------------------------------------------------------
--------------------------------------------------
HTML: Homepage.html
--------------------------------------------------------------------------------
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>osanet</title>
</head>
<body>
<wicket:extend>
<table wicket:id="container01" style="background: red;">
<tr style="background: green;">
<td><span wicket:id="label01">CCC</span></td>
</tr>
<tr>
<td>BBBB</td>
</tr>
<tr style="background: yellow;">
<td><span wicket:id="label02">CCC</span></td>
</tr>
</table>
</wicket:extend>
</body>
</html>
--------------------------------------------------------------------------------
--------------------------------------------------
Homepage.java
--------------------------------------------------------------------------------
--------------------------------------------------
/*
* HomePage.java
*
* Created on 3 settembre 2008, 14.46
*/
package com.osanet.pages.secured;
import com.osanet.application.annotations.SecuredPage;
import com.osanet.pages.templates.TemplatePageWithMenubar;
import static com.osanet.application.log.Log.appLog;
import com.osanet.application.log.Log;
import com.osanet.components.Label;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import wicketdnd.DragSource;
import wicketdnd.DropTarget;
import wicketdnd.Location;
import wicketdnd.Operation;
import wicketdnd.Reject;
import wicketdnd.Transfer;
import wicketdnd.theme.HumanTheme;
import wicketdnd.theme.WindowsTheme;
/**
* Homepage per l'utente standard
* @author Santino
*/
@SecuredPage
public class HomePage extends TemplatePageWithMenubar {
private WebMarkupContainer container01;
private Label label01;
private Label label02;
public HomePage() {
// Container contenente i componenti interessati dal D&D
container01=new WebMarkupContainer("container01");
container01.setOutputMarkupId(true);
add(container01);
// Tema per il drag&drop
container01.add(new HumanTheme());
// Oggetto per la gestione dei drag. Operazioni previste: move e copy
DragSource dragSource=new DragSource(Operation.MOVE, Operation.COPY){
@Override
public void onAfterDrop(AjaxRequestTarget target, Transfer transfer)
{
System.out.println("After Drop");
}
@Override
public void onBeforeDrop(Component drag, Transfer transfer) throws
Reject {
System.out.println("Before Drop");
}
};
container01.add(dragSource);
// Il tag da trascinare è di tipo span
dragSource.drag("span");
// Container per la gestione dei drop. Operazioni consentite: move e copy
DropTarget dropTarget=new DropTarget(Operation.MOVE, Operation.COPY){
@Override
public void onDrop(AjaxRequestTarget target, Transfer transfer,
Location location) throws Reject {
System.out.println("XXXXX03:"+location.getModel().toString());
}
};
container01.add(dropTarget);
// Il interessato dal drop è di tipo span
dropTarget.dropCenter("span");
// Oggetto interessato dal D&D
label01=new Label("label01","AAAAA");
label01.setOutputMarkupId(true);
container01.add(label01);
// Oggetto interessato dal D&D
label02=new Label("label02","CCCCC");
label02.setOutputMarkupId(true);
container01.add(label02);
}
}

More Related Content

Viewers also liked

Gymn ap pavlou_paphos_b_2014
Gymn ap pavlou_paphos_b_2014Gymn ap pavlou_paphos_b_2014
Gymn ap pavlou_paphos_b_2014
sofia georgiou
 
Anteprima con flash viewer [by sc]
Anteprima con flash viewer [by sc]Anteprima con flash viewer [by sc]
Anteprima con flash viewer [by sc]santi caltabiano
 
Ad project ben &jerry
Ad project ben &jerryAd project ben &jerry
Ad project ben &jerry
valagna
 
Lease
LeaseLease
Jaya supermarket presentation 2011 latest
Jaya supermarket presentation 2011 latestJaya supermarket presentation 2011 latest
Jaya supermarket presentation 2011 latest
Kartini Ibrahim
 
Tugas akhir tik semester 1 kelas 8 smp
Tugas akhir  tik semester 1 kelas 8 smpTugas akhir  tik semester 1 kelas 8 smp
Tugas akhir tik semester 1 kelas 8 smp
taqiyamumtaz
 
Sgf’s sportsgrene
Sgf’s sportsgreneSgf’s sportsgrene
Sgf’s sportsgrene
nicobirk
 
презентация
презентацияпрезентация
презентацияanastassia1993
 
Актуальные проблемы современного маркетинга
Актуальные проблемы современного маркетингаАктуальные проблемы современного маркетинга
Актуальные проблемы современного маркетинга
Vasiliy Starostin
 

Viewers also liked (9)

Gymn ap pavlou_paphos_b_2014
Gymn ap pavlou_paphos_b_2014Gymn ap pavlou_paphos_b_2014
Gymn ap pavlou_paphos_b_2014
 
Anteprima con flash viewer [by sc]
Anteprima con flash viewer [by sc]Anteprima con flash viewer [by sc]
Anteprima con flash viewer [by sc]
 
Ad project ben &jerry
Ad project ben &jerryAd project ben &jerry
Ad project ben &jerry
 
Lease
LeaseLease
Lease
 
Jaya supermarket presentation 2011 latest
Jaya supermarket presentation 2011 latestJaya supermarket presentation 2011 latest
Jaya supermarket presentation 2011 latest
 
Tugas akhir tik semester 1 kelas 8 smp
Tugas akhir  tik semester 1 kelas 8 smpTugas akhir  tik semester 1 kelas 8 smp
Tugas akhir tik semester 1 kelas 8 smp
 
Sgf’s sportsgrene
Sgf’s sportsgreneSgf’s sportsgrene
Sgf’s sportsgrene
 
презентация
презентацияпрезентация
презентация
 
Актуальные проблемы современного маркетинга
Актуальные проблемы современного маркетингаАктуальные проблемы современного маркетинга
Актуальные проблемы современного маркетинга
 

More from santi caltabiano

Esercizio semicirconferenze tangenti [sc]
Esercizio   semicirconferenze tangenti [sc]Esercizio   semicirconferenze tangenti [sc]
Esercizio semicirconferenze tangenti [sc]
santi caltabiano
 
Area di un segmento parabolico
Area di un segmento parabolicoArea di un segmento parabolico
Area di un segmento parabolico
santi caltabiano
 
L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]
santi caltabiano
 
L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]
santi caltabiano
 
L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]
santi caltabiano
 
Legge di gravitazione universale [prof. santi caltabiano]
Legge di gravitazione universale [prof. santi caltabiano]Legge di gravitazione universale [prof. santi caltabiano]
Legge di gravitazione universale [prof. santi caltabiano]
santi caltabiano
 
Le tre leggi di keplero [prof. santi caltabiano]
Le tre leggi di keplero [prof. santi caltabiano]Le tre leggi di keplero [prof. santi caltabiano]
Le tre leggi di keplero [prof. santi caltabiano]
santi caltabiano
 
Caduta di un corpo [prof. santi caltabiano]
Caduta di un corpo [prof. santi caltabiano]Caduta di un corpo [prof. santi caltabiano]
Caduta di un corpo [prof. santi caltabiano]
santi caltabiano
 
Applicazione dei principi della dinamica [prof. santi caltabiano]
Applicazione dei principi  della dinamica [prof. santi caltabiano]Applicazione dei principi  della dinamica [prof. santi caltabiano]
Applicazione dei principi della dinamica [prof. santi caltabiano]
santi caltabiano
 
Principi della dinamica [prof. santi caltabiano]
Principi della dinamica [prof. santi caltabiano]Principi della dinamica [prof. santi caltabiano]
Principi della dinamica [prof. santi caltabiano]
santi caltabiano
 
Le leve [prof. santi caltabiano]
Le leve [prof. santi caltabiano]Le leve [prof. santi caltabiano]
Le leve [prof. santi caltabiano]
santi caltabiano
 
Coppie di forze [prof. santi caltabiano]
Coppie di forze [prof. santi caltabiano]Coppie di forze [prof. santi caltabiano]
Coppie di forze [prof. santi caltabiano]
santi caltabiano
 
Momento di una forza [prof. santi caltabiano]
Momento di una forza [prof. santi caltabiano]Momento di una forza [prof. santi caltabiano]
Momento di una forza [prof. santi caltabiano]
santi caltabiano
 
Equilibrio sul piano inclinato [s. caltabiano]
Equilibrio sul piano inclinato [s. caltabiano]Equilibrio sul piano inclinato [s. caltabiano]
Equilibrio sul piano inclinato [s. caltabiano]
santi caltabiano
 
La piramide di numeri (prof. s. caltabiano)
La piramide di numeri (prof. s. caltabiano) La piramide di numeri (prof. s. caltabiano)
La piramide di numeri (prof. s. caltabiano)
santi caltabiano
 
20 dinamica forze d'attrito
20 dinamica   forze d'attrito20 dinamica   forze d'attrito
20 dinamica forze d'attrito
santi caltabiano
 
10 dinamica concetto di forza
10 dinamica   concetto di forza10 dinamica   concetto di forza
10 dinamica concetto di forza
santi caltabiano
 
Vettori
VettoriVettori
00130 cinematica moto rettilineo e velocita media
00130 cinematica   moto rettilineo e velocita media00130 cinematica   moto rettilineo e velocita media
00130 cinematica moto rettilineo e velocita media
santi caltabiano
 
50 cinematica moto rettilineo uniformemente accelerato
50 cinematica   moto rettilineo uniformemente accelerato50 cinematica   moto rettilineo uniformemente accelerato
50 cinematica moto rettilineo uniformemente accelerato
santi caltabiano
 

More from santi caltabiano (20)

Esercizio semicirconferenze tangenti [sc]
Esercizio   semicirconferenze tangenti [sc]Esercizio   semicirconferenze tangenti [sc]
Esercizio semicirconferenze tangenti [sc]
 
Area di un segmento parabolico
Area di un segmento parabolicoArea di un segmento parabolico
Area di un segmento parabolico
 
L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte03) [prof. santi caltabiano]
 
L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte02) [prof. santi caltabiano]
 
L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]
L'equilibrio nei fluidi (parte01) [prof. santi caltabiano]
 
Legge di gravitazione universale [prof. santi caltabiano]
Legge di gravitazione universale [prof. santi caltabiano]Legge di gravitazione universale [prof. santi caltabiano]
Legge di gravitazione universale [prof. santi caltabiano]
 
Le tre leggi di keplero [prof. santi caltabiano]
Le tre leggi di keplero [prof. santi caltabiano]Le tre leggi di keplero [prof. santi caltabiano]
Le tre leggi di keplero [prof. santi caltabiano]
 
Caduta di un corpo [prof. santi caltabiano]
Caduta di un corpo [prof. santi caltabiano]Caduta di un corpo [prof. santi caltabiano]
Caduta di un corpo [prof. santi caltabiano]
 
Applicazione dei principi della dinamica [prof. santi caltabiano]
Applicazione dei principi  della dinamica [prof. santi caltabiano]Applicazione dei principi  della dinamica [prof. santi caltabiano]
Applicazione dei principi della dinamica [prof. santi caltabiano]
 
Principi della dinamica [prof. santi caltabiano]
Principi della dinamica [prof. santi caltabiano]Principi della dinamica [prof. santi caltabiano]
Principi della dinamica [prof. santi caltabiano]
 
Le leve [prof. santi caltabiano]
Le leve [prof. santi caltabiano]Le leve [prof. santi caltabiano]
Le leve [prof. santi caltabiano]
 
Coppie di forze [prof. santi caltabiano]
Coppie di forze [prof. santi caltabiano]Coppie di forze [prof. santi caltabiano]
Coppie di forze [prof. santi caltabiano]
 
Momento di una forza [prof. santi caltabiano]
Momento di una forza [prof. santi caltabiano]Momento di una forza [prof. santi caltabiano]
Momento di una forza [prof. santi caltabiano]
 
Equilibrio sul piano inclinato [s. caltabiano]
Equilibrio sul piano inclinato [s. caltabiano]Equilibrio sul piano inclinato [s. caltabiano]
Equilibrio sul piano inclinato [s. caltabiano]
 
La piramide di numeri (prof. s. caltabiano)
La piramide di numeri (prof. s. caltabiano) La piramide di numeri (prof. s. caltabiano)
La piramide di numeri (prof. s. caltabiano)
 
20 dinamica forze d'attrito
20 dinamica   forze d'attrito20 dinamica   forze d'attrito
20 dinamica forze d'attrito
 
10 dinamica concetto di forza
10 dinamica   concetto di forza10 dinamica   concetto di forza
10 dinamica concetto di forza
 
Vettori
VettoriVettori
Vettori
 
00130 cinematica moto rettilineo e velocita media
00130 cinematica   moto rettilineo e velocita media00130 cinematica   moto rettilineo e velocita media
00130 cinematica moto rettilineo e velocita media
 
50 cinematica moto rettilineo uniformemente accelerato
50 cinematica   moto rettilineo uniformemente accelerato50 cinematica   moto rettilineo uniformemente accelerato
50 cinematica moto rettilineo uniformemente accelerato
 

Recently uploaded

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 

Recently uploaded (20)

A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 

Esempio drag&drop [wicket dnd][sc]

  • 1. DRAG&DROP CON WICKET DnD [Santi Caltabiano] -------------------------------------------------------------------------------- -------------------------------------------------- Libreria: wicket-dnd -------------------------------------------------------------------------------- -------------------------------------------------- - https://code.google.com/p/wicket-dnd/ Wicket DnD per wicket 1.5 e 1.6 - https://github.com/svenmeier/wicket-dnd Wicket DnD per wicket 1.7 > https://github.com/svenmeier/wicket-dnd -------------------------------------------------------------------------------- -------------------------------------------------- HTML: Homepage.html -------------------------------------------------------------------------------- -------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <html> <head> <title>osanet</title> </head> <body> <wicket:extend> <table wicket:id="container01" style="background: red;"> <tr style="background: green;"> <td><span wicket:id="label01">CCC</span></td> </tr> <tr> <td>BBBB</td> </tr> <tr style="background: yellow;"> <td><span wicket:id="label02">CCC</span></td> </tr> </table> </wicket:extend> </body> </html> -------------------------------------------------------------------------------- -------------------------------------------------- Homepage.java -------------------------------------------------------------------------------- -------------------------------------------------- /* * HomePage.java * * Created on 3 settembre 2008, 14.46 */
  • 2. package com.osanet.pages.secured; import com.osanet.application.annotations.SecuredPage; import com.osanet.pages.templates.TemplatePageWithMenubar; import static com.osanet.application.log.Log.appLog; import com.osanet.application.log.Log; import com.osanet.components.Label; import org.apache.wicket.Component; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.markup.html.WebMarkupContainer; import wicketdnd.DragSource; import wicketdnd.DropTarget; import wicketdnd.Location; import wicketdnd.Operation; import wicketdnd.Reject; import wicketdnd.Transfer; import wicketdnd.theme.HumanTheme; import wicketdnd.theme.WindowsTheme; /** * Homepage per l'utente standard * @author Santino */ @SecuredPage public class HomePage extends TemplatePageWithMenubar { private WebMarkupContainer container01; private Label label01; private Label label02; public HomePage() { // Container contenente i componenti interessati dal D&D container01=new WebMarkupContainer("container01"); container01.setOutputMarkupId(true); add(container01); // Tema per il drag&drop container01.add(new HumanTheme()); // Oggetto per la gestione dei drag. Operazioni previste: move e copy DragSource dragSource=new DragSource(Operation.MOVE, Operation.COPY){ @Override public void onAfterDrop(AjaxRequestTarget target, Transfer transfer) { System.out.println("After Drop"); } @Override public void onBeforeDrop(Component drag, Transfer transfer) throws Reject { System.out.println("Before Drop"); } }; container01.add(dragSource); // Il tag da trascinare è di tipo span dragSource.drag("span"); // Container per la gestione dei drop. Operazioni consentite: move e copy DropTarget dropTarget=new DropTarget(Operation.MOVE, Operation.COPY){
  • 3. @Override public void onDrop(AjaxRequestTarget target, Transfer transfer, Location location) throws Reject { System.out.println("XXXXX03:"+location.getModel().toString()); } }; container01.add(dropTarget); // Il interessato dal drop è di tipo span dropTarget.dropCenter("span"); // Oggetto interessato dal D&D label01=new Label("label01","AAAAA"); label01.setOutputMarkupId(true); container01.add(label01); // Oggetto interessato dal D&D label02=new Label("label02","CCCCC"); label02.setOutputMarkupId(true); container01.add(label02); } }