Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration de la derniere version du code stable vers le trunk
- Loading branch information
amine.oualialami@supinfo.com
committed
May 21, 2011
0 parents
commit 8cfef5c
Showing
117 changed files
with
10,092 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/ProfilerService"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/mvp4j-api"/> | ||
<classpathentry combineaccessrules="false" kind="src" path="/mvp4j-impl"/> | ||
<classpathentry kind="lib" path="lib/DTOBuilder-0.1.jar"/> | ||
<classpathentry kind="lib" path="lib/jboss-aop-jdk50-client.jar"/> | ||
<classpathentry kind="lib" path="lib/jboss-aspect-jdk50-client.jar"/> | ||
<classpathentry kind="lib" path="lib/jboss-client.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ProfilerClient</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#Wed Mar 16 16:11:34 GMT 2011 | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.6 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.6 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.atos.profilerclient; | ||
|
||
import javax.swing.JTable; | ||
|
||
import org.mvp4j.AppController; | ||
import org.mvp4j.adapter.MVPAdapter; | ||
import org.mvp4j.adapter.MVPBinding; | ||
import org.mvp4j.adapter.ModelComponent; | ||
import org.mvp4j.impl.reflect.AppControllerReflect; | ||
import org.mvp4j.impl.reflect.AppControllerReflectFactory; | ||
import org.mvp4j.impl.swing.SwingAdapter; | ||
|
||
import com.atos.profilerclient.ui.model.CustomizedTableModel; | ||
import com.atos.profilerclient.ui.model.MyConverter; | ||
import com.atos.profilerclient.ui.model.MyConverter2; | ||
import com.atos.profilerclient.ui.model.UserModel; | ||
import com.atos.profilerclient.ui.presenter.UserPresenter; | ||
import com.atos.profilerclient.ui.view.ProfilsView; | ||
import com.atos.profilerclient.ui.view.UserView; | ||
|
||
public class Launch { | ||
|
||
public static void main(String[] args) { | ||
|
||
UserView view = new UserView(); | ||
UserModel model = new UserModel(); | ||
UserPresenter presenter = new UserPresenter(view, model); | ||
|
||
|
||
|
||
|
||
AppControllerReflect appController = AppControllerReflectFactory | ||
.getAppControllerInstance(); | ||
|
||
MVPBinding mvpBinding = appController.bind(view, model, presenter); | ||
|
||
mvpBinding.getComponentModel(view.getDateTextField()).setConverter(new MyConverter()); | ||
// mvpBinding.getComponentModel(view.getNameTextField()).setConverter(new MyConverter()); | ||
// mvpBinding.setComponentModel(view.getTable(), CustomizedTableModel.class); | ||
|
||
|
||
// ModelComponent modelComponent = appController.getCurrentAdapter().getComponentModel(view, view.getNameTextField()); | ||
// modelComponent.setConverter(new MyConverter()); | ||
// ModelComponent modelComponent2 = appController.getCurrentAdapter().getComponentModel(view, view.getTelTextField()); | ||
// modelComponent2.setConverter(new MyConverter2()); | ||
|
||
|
||
|
||
// appController.getCurrentAdapter().setComponentModel(view,model, view.getTable(), CustomizedTableModel.class); | ||
|
||
view.setVisible(true); | ||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
ProfilerClient/src/com/atos/profilerclient/ui/model/CustomizedTableModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.atos.profilerclient.ui.model; | ||
|
||
|
||
|
||
import org.mvp4j.adapter.ModelBinding; | ||
import org.mvp4j.impl.swing.JTableModelComponent; | ||
|
||
public class CustomizedTableModel extends JTableModelComponent { | ||
|
||
|
||
|
||
public CustomizedTableModel(ModelBinding modelBinding) { | ||
super(modelBinding); | ||
// getCustomizedColumns().put("idUser", "id toto"); | ||
// getCustomizedColumns().put("name", "name toto"); | ||
// getCustomizedColumns().put("phone", "phone toto"); | ||
getCustomizedColumns().put("name","profil name"); | ||
initTableModel(getCustomizedColumns()); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} |
43 changes: 43 additions & 0 deletions
43
ProfilerClient/src/com/atos/profilerclient/ui/model/MyConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.atos.profilerclient.ui.model; | ||
|
||
import java.awt.Component; | ||
import java.awt.Graphics; | ||
import java.awt.Rectangle; | ||
import java.beans.PropertyChangeListener; | ||
import java.beans.PropertyEditor; | ||
import java.text.DateFormat; | ||
import java.text.ParseException; | ||
import java.text.SimpleDateFormat; | ||
|
||
import java.util.Date; | ||
import java.util.logging.SimpleFormatter; | ||
|
||
import org.mvp4j.Converter; | ||
|
||
public class MyConverter implements Converter { | ||
|
||
@Override | ||
public Object convertComponentToModel(Class<?> type, Object value) { | ||
|
||
DateFormat formater=new SimpleDateFormat("dd-mm-yyyy"); | ||
Date dateformat = null; | ||
try { | ||
dateformat=formater.parse(""+value); | ||
dateformat=formater.parse(formater.format(dateformat)); | ||
} catch (ParseException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
System.out.println(value); | ||
return dateformat ; | ||
} | ||
|
||
@Override | ||
public Object convertModelToComponent(Object value) { | ||
|
||
DateFormat formater=new SimpleDateFormat("dd-mm-yyyy") ; | ||
return formater.format(value); | ||
} | ||
|
||
|
||
} |
44 changes: 44 additions & 0 deletions
44
ProfilerClient/src/com/atos/profilerclient/ui/model/MyConverter2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.atos.profilerclient.ui.model; | ||
|
||
import org.mvp4j.Converter; | ||
|
||
public class MyConverter2 implements Converter { | ||
|
||
@Override | ||
public Object convertComponentToModel(Class<?> type, Object value) { | ||
System.out.println("----------------------MyConverter 2------------------"); | ||
if (value instanceof String) { | ||
if (type == Integer.class) | ||
return new Integer((String) value); | ||
else if(type==int.class) | ||
return new Integer((String) value); | ||
else if(type==float.class) | ||
return new Float((String) value); | ||
else if (type == Float.class) | ||
return new Float((String) value); | ||
else if (type == String.class) | ||
return value.toString(); | ||
else if(type==double.class) | ||
return new Double((String) value); | ||
else if (type == Double.class) | ||
return new Double((String) value); | ||
|
||
|
||
throw new IllegalArgumentException(); | ||
} | ||
else if (value instanceof Object) | ||
return value; | ||
else { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public Object convertModelToComponent(Object value) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
|
||
} |
57 changes: 57 additions & 0 deletions
57
ProfilerClient/src/com/atos/profilerclient/ui/model/ProfilsModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.atos.profilerclient.ui.model; | ||
|
||
import java.util.List; | ||
|
||
import com.atos.profilerclient.dao.UserSessionDAOImpl; | ||
import com.atos.profilerclient.dto.ProfilDTO; | ||
|
||
public class ProfilsModel { | ||
|
||
|
||
private String name; | ||
private List<ProfilDTO> profils; | ||
private ProfilDTO profil; | ||
|
||
|
||
public List<ProfilDTO> getProfils() { | ||
|
||
UserSessionDAOImpl userSession = new UserSessionDAOImpl(); | ||
profils = userSession.loadAllProfils(); | ||
return profils; | ||
} | ||
|
||
|
||
public void setProfils(List<ProfilDTO> profils) { | ||
this.profils = profils; | ||
} | ||
|
||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
|
||
public ProfilDTO getProfil() { | ||
return profil; | ||
} | ||
|
||
|
||
public void setProfil(ProfilDTO profil) { | ||
this.profil = profil; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
} |
Oops, something went wrong.