Skip to content

Commit

Permalink
Migration de la derniere version du code stable vers le trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
amine.oualialami@supinfo.com committed May 21, 2011
0 parents commit 8cfef5c
Show file tree
Hide file tree
Showing 117 changed files with 10,092 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ProfilerClient/.classpath
@@ -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>
17 changes: 17 additions & 0 deletions ProfilerClient/.project
@@ -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>
12 changes: 12 additions & 0 deletions ProfilerClient/.settings/org.eclipse.jdt.core.prefs
@@ -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 added ProfilerClient/lib/DTOBuilder-0.1.jar
Binary file not shown.
Binary file added ProfilerClient/lib/jboss-aop-jdk50-client.jar
Binary file not shown.
Binary file added ProfilerClient/lib/jboss-aspect-jdk50-client.jar
Binary file not shown.
Binary file added ProfilerClient/lib/jboss-client.jar
Binary file not shown.
59 changes: 59 additions & 0 deletions ProfilerClient/src/com/atos/profilerclient/Launch.java
@@ -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);






}
}
@@ -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());
}












}
@@ -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);
}


}
@@ -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;
}


}
@@ -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;
}










}

0 comments on commit 8cfef5c

Please sign in to comment.