code
stringlengths
3
1.18M
language
stringclasses
1 value
package com.ch_linghu.fanfoudroid.db; /** * All information of status table * */ public final class StatusTablesInfo { }
Java
package com.ch_linghu.fanfoudroid.db; import android.database.Cursor; import android.provider.BaseColumns; import android.util.Log; import com.ch_linghu.fanfoudroid.data.User; public final class UserInfoTable implements BaseColumns { public static final String TAG = "UserInfoTable"; public static fin...
Java
package com.ch_linghu.fanfoudroid.db; import java.text.ParseException; import android.database.Cursor; import android.provider.BaseColumns; import android.util.Log; import com.ch_linghu.fanfoudroid.data.Dm; /** * Table - Direct Messages * */ public final class MessageTable implements BaseColumns { public stat...
Java
package com.ch_linghu.fanfoudroid.db; import android.database.Cursor; import android.provider.BaseColumns; import android.util.Log; import com.ch_linghu.fanfoudroid.data.Tweet; import com.ch_linghu.fanfoudroid.util.DateTimeHelper; /** * Table - Statuses <br /> * <br /> * 为节省流量,故此表不保证本地数据库中所有消息具有前后连贯性, 而只确保最新的MAX_...
Java
package com.ch_linghu.fanfoudroid.db; import java.text.ParseException; import android.database.Cursor; import android.provider.BaseColumns; import android.util.Log; import com.ch_linghu.fanfoudroid.data.User; /** * Table - Followers * */ public final class FollowTable implements BaseColumns { public static fi...
Java
package com.ch_linghu.fanfoudroid.db; import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.List; import java.util.Locale; import android.content.ContentValues; import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; imp...
Java
package com.ch_linghu.fanfoudroid; import java.util.ArrayList; import java.util.List; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; import android.view.KeyEvent; import android.view.Lay...
Java
/* * Copyright (C) 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
Java
package com.ch_linghu.fanfoudroid; import java.text.ParseException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.database.Cursor; import android.graphics.B...
Java
package com.ch_linghu.fanfoudroid.util; import java.io.InputStream; import java.io.OutputStream; public class StreamUtils { public static void CopyStream(InputStream is, OutputStream os) { final int buffer_size = 1024; try { byte[] bytes = new byte[buffer_size]; for (;;) { int count = is.rea...
Java
package com.ch_linghu.fanfoudroid.util; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Arrays; import java.util.HashMap; import android.util.Log; import com.ch_linghu.fanfoudroid.TwitterApplication; /** * Debug Timer * * Usage: -------------------------------- DebugTimer.start()...
Java
package com.ch_linghu.fanfoudroid.util; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; import android.util.Log; import com.ch_linghu.fanfoudroid.R; import com.ch_linghu.fanfoudroid.TwitterAppl...
Java
package com.ch_linghu.fanfoudroid.util; import java.io.File; import java.io.IOException; import android.os.Environment; /** * 对SD卡文件的管理 * * @author ch.linghu * */ public class FileHelper { private static final String TAG = "FileHelper"; private static final String BASE_PATH = "fanfoudroid"; public static...
Java
package com.ch_linghu.fanfoudroid.util; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import android.t...
Java
/* * Copyright (C) 2009 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
Java
package com.ch_linghu.fanfoudroid; import java.text.MessageFormat; import java.util.List; import android.content.Intent; import android.os.Bundle; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.View; import android.widget.AdapterView; import android.widget.Adapte...
Java
package com.ch_linghu.fanfoudroid; import java.util.HashSet; //import org.acra.ReportingInteractionMode; //import org.acra.annotation.ReportsCrashes; import android.app.Application; import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; import android.net...
Java
package com.markupartist.android.widget; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.GestureDetector; import android.view.LayoutInflater; import android.view.MotionEv...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
package org.damazio.notifier.comm.pairing; import java.util.Collection; import java.util.HashMap; import java.util.Map; public class DeviceManager { public static class Device { public final long deviceId; public final String ipAddress; public final String bluetoothAddress; public Device(long devi...
Java
package org.damazio.notifier.comm.transport.cloud; import static org.damazio.notifier.Constants.TAG; import java.util.Arrays; import org.damazio.notifier.event.EventManager; import org.damazio.notifier.protocol.Common.Event; import com.google.protobuf.InvalidProtocolBufferException; import android.content.Broadcas...
Java
package org.damazio.notifier.comm.transport.cloud; import static org.damazio.notifier.Constants.TAG; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class RegistrationReceiver extends BroadcastReceiver { private static final S...
Java
package org.damazio.notifier.comm.transport; public enum TransportType { IP, BLUETOOTH, USB, CLOUD; }
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
package org.damazio.notifier.comm.transport; import static org.damazio.notifier.Constants.TAG; import org.damazio.notifier.event.EventContext; import org.damazio.notifier.protocol.Common.Event; import android.os.Handler; import android.os.HandlerThread; import android.os.Message; import android.os.Process; import an...
Java
package org.damazio.notifier.comm.transport; import java.util.EnumMap; import java.util.EnumSet; import org.damazio.notifier.NotifierService.NotifierServiceModule; import org.damazio.notifier.comm.transport.ip.IpEventSender; import org.damazio.notifier.event.EventContext; import org.damazio.notifier.event.EventListen...
Java
package org.damazio.notifier.comm.transport.ip; import static org.damazio.notifier.Constants.TAG; import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketAddress; import java.net.UnknownHostException; import...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright (C) 2007 Esmertec AG. * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICEN...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright (C) 2007-2008 Esmertec AG. * Copyright (C) 2007-2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/lice...
Java
/* * Copyright (C) 2007 Esmertec AG. * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICEN...
Java
/* * Copyright (C) 2007 Esmertec AG. * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICEN...
Java
/* * Copyright (C) 2007-2008 Esmertec AG. * Copyright (C) 2007-2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/lice...
Java
/* * Copyright (C) 2007-2008 Esmertec AG. * Copyright (C) 2007-2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/lice...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
package org.damazio.notifier.util; import static org.damazio.notifier.Constants.TAG; import android.content.Context; import android.provider.Settings; import android.util.Log; public class DeviceUtils { public static long getDeviceId(Context context) { String deviceIdStr = Settings.Secure.getString( co...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
/* * Copyright 2011 Rodrigo Damazio * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Java
package serviceWeb; import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationExcepti...
Java
package serviceWeb; import java.sql.SQLException; import java.sql.SQLXML; import java.util.Map; /** * Interface de connexion à la base de données, pour pouvoir implémenter d'autres SGBD */ public interface EchangeBDXML { public SQLXML getXML(); public void getBases() throws SQLException; public void...
Java
package serviceWeb; import java.sql.SQLException; import java.util.Iterator; import java.util.Map; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; /** * Fonctions utilitaires utilisées par plusieurs ServerResource */ public class FonctionsServerResource { /** * Ajouter le...
Java
package serviceWeb; import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.restlet.data.CharacterSet; import...
Java
package serviceWeb; import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.restlet.data.CharacterSet; import...
Java
package serviceWeb; import org.restlet.Component; import org.restlet.data.Protocol; /** * Serveur gérant les ressources de base de données. Elles répondent à GET (lecture), * PUT (mise à jour) et DELETE. Les erreurs possibles sont toutes prises en charge. */ public class Serveur { public static void main(String...
Java
package serviceWeb.modelePostgreSQL; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /** * Class Database qui gère la connexion à une base postgreSQL */ public class Database { /** * Nom du driver */ pr...
Java
package serviceWeb.modelePostgreSQL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLXML; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * Class EchangeBDXML qui gère le dialogue avec une base ...
Java
package serviceWeb; import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.restlet.data.CharacterSet; import...
Java
package serviceWeb; import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.restlet.data.CharacterSet; import...
Java
package clientWeb; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; import java.net.URLConnection; import java.util.Iterator; import ja...
Java
package constraint; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; /** * Quick simple check to validate the email address, just for the demo. * Not very correct. * * @author mark * */ public class EmailConstraintValidator implements ConstraintValidator<Email, S...
Java
package constraint; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import javax.validation.Constraint; import javax.validation.Payload; @Constraint(validatedBy = EmailConstraintValidator.class) @Target({...
Java
package entities; import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import ejb.UserDAO; @ManagedBean public class UserConvertor implements Converter { @EJB private UserDAO users; @O...
Java
package entities; import java.util.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.validation.constraints.Size; import constraint.Email; @Entity public class User { private Integer id; @Size(min = 2...
Java
package util; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.context.Flash; public class Messages { public static void addFlashMessage(String message) { Flash flash = FacesContext.getCurrentInstance().getExternalContext().getFlash(); flash.setKeepMessage...
Java
package backing; import java.util.List; import javax.annotation.PostConstruct; import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; import ejb.UserDAO; import entities.User; @RequestScoped @ManagedBean public class Index { private List<User> users; @EJB private Us...
Java
package backing; import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import ejb.UserDAO; import entities.User; @ViewScoped @ManagedBean public class UserDelete { private User user; @EJB private UserDAO userDAO; public String delete() { userDAO.delete(user); re...
Java
package backing; import static util.Messages.addFlashMessage; import javax.ejb.EJB; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import ejb.UserDAO; import entities.User; @ViewScoped @ManagedBean public class UserEdit { private User user; @EJB private UserDAO userDAO; public vo...
Java
package ejb; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import entities.User; @Stateless public class UserDAO { @PersistenceContext(unitName = "first_test") private EntityManager entityManager; public void save(User u...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class BalaA here. * * @author (your name) * @version (a version number or a date) */ public class BalaA extends Actor { /** * Act - do whatever the BalaA wants to do. This method is called whene...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class BotonArriba here. * * @author (your name) * @version (a version number or a date) */ public class BotonArriba extends Actor { /** * Act - do whatever the BotonArriba wants to do...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Hamburguesa here. * * @author (your name) * @version (a version number or a date) */ public class Hamburgesa extends Extras { public Hamburgesa () { } /** Manda lla...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class BotonSiguiente here. * * @author (your name) * @version (a version number or a date) */ public class BotonSiguiente extends Actor { /** * Act - do whatever the BotonSiguiente wa...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.*; /** * Write a description of class Plankton here. * * @author (your name) * @version (a version number or a date) */ public class Plankton extends Extras { public Plankton() { } /** ...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Actores here. * * @author (your name) * @version (a version number or a date) */ public class Extras extends Actor { private int vel;// controla la velocidad del extra private SimpleTimer...
Java
/** * A simple timer class that allows you to keep track of how much time * has passed between events. * * You use this class by creating a timer as a member field in your actor (or whatever): * <pre> * * private SimpleTimer timer = new SimpleTimer(); * </pre> * * Then when you want to start the timer (for...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.awt.Color; import java.util.List; /** * An actor class that can display a scoreboard, using Greenfoot's * UserInfo class. * * You typically use this by including some code into the world for when your game ends: * * <...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Flor here. * * @author (your name) * @version (a version number or a date) */ public class Flor extends Extras { public Flor () { } /** Manda llamar el Método cae() y B...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class BotonIzq here. * * @author (your name) * @version (a version number or a date) */ public class BotonIzq extends Actor { /** * Act - do whatever the BotonIzq wants to do. This me...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Play here. * * @author (your name) * @version (a version number or a date) */ public class Play extends Actor { /** * Act - do whatever the Play wants to do. This method is call...
Java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Burbuja here. * * @author (your name) * @version (a version number or a date) */ public class Burbuja extends Extras { private boolean b; public Burbuja () { b=true; } /...
Java