Project p = new Project(); Application a = new Application(); a.setProject(p); p.getApplications().add(a); em.persist(p);
return new Application(); }; }());
/** /** * @return a default BundleDescriptor for this archivist */ @Override public Application getDefaultBundleDescriptor() { return new Application(habitat); }
UIManager.put("TableHeader.background", Color.yellow); EventQueue.invokeLater(new Runnable() { @Override public void run() { new Application(); } });
public static Application getInstance(){ if(INSTANCE == null){ return new Application(); } else return INSTANCE; }
public Application[] getApplicants() { return new Application[] { new Application("Blair", "C", "Bass"), new Application("Daniel", "R", "Humphrey"), new Application("Charlie", "L", "Trout"), new Application("Damascus", "L", "Roberto"), new Application("Sofia", "M", "Montrone"), new Application() }; }
import org.junit.runners.model.InitializationError; import android.app.Application; import com.xtremelabs.robolectric.RobolectricTestRunner; public class MyTestRunner extends RobolectricTestRunner { public MyTestRunner(Class<?> testClass) throws InitializationError { super(testClass); } @Override protected Application createApplication() { return new Application() { }; } }
package forums; import forums.kartikPatel.tennis.Application; public class Main { public static void main(String[] args) { new Application().run(); } }
public static Application getSharedApplication() { if(_application == null) { _application = new Application(); view = new View(); }
class SendApplication{ List<Application> peopleAttending = null; public SendApplication(){ List<Application> peopleAttending = new ArrayList<Application>(); } public void storeApplication(String name, String item) { peopleAttending.add(new Application(name, item)); } //...... other methods follow }
private void saveFile(byte[] zip, String name, String description) throws IOException { InputStream is = new ByteArrayInputStream(zip); ZipInputStream zis = new ZipInputStream(is); Application app = new Application(); ZipEntry entry = null; while ((entry = zis.getNextEntry()) != null) { String entryName = entry.getName(); if (entryName.equals("readme.txt")) { new Scanner(zis); //!!! //... zis.closeEntry();
final ApplicationContextMock appContext = new ApplicationContextMock(); appContext.putBean(mock(MyServiceA.class)); Application app = new Application() { public void init() { ... getComponentInstantiationListeners().add(new SpringComponentInjector(this, appContext)); } } WicketTester wicketTester = new WicketTester(app); wicketTester.startComponent(MyComponent.class);
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { Application obj = new Application(); @SuppressWarnings("resource") ConfigurableApplicationContext applicationContext = new ClassPathXmlApplicationContext("META-INF/spring/applicationContext.xml"); applicationContext.registerShutdownHook(); applicationContext.getBeanFactory().autowireBeanProperties( obj, AutowireCapableBeanFactory.AUTOWIRE_NO, false); return application.sources(Application.class); }
/** * @return the descriptor instance to associate with this XMLNode */ public Application getDescriptor() { if (descriptor==null) { descriptor = new Application(Globals.getDefaultHabitat()); } return descriptor; }
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); List<ResolveInfo> appData = packageManager.queryIntentActivities( mainIntent, 0); for (ResolveInfo appInfo : appData) { Application application = new Application(); application.setApplicationName(appInfo.loadLabel(packageManager) .toString()); }
Application application = mock(Application.class); List<Application> aps = Collections.singletonList(new Application()); when(application.findSomething(any(), anyVararg())).thenReturn(aps); System.out.println(application.findSomething("foo").size()); System.out.println(application.findSomething("bar", 17).size()); System.out.println(application.findSomething(new Object(), 17, 18, 19, 20).size());
SessionFactory sf = HibernateUtil.getSessionFactory(); Session session = sf.openSession(); session.beginTransaction(); Application app1 = new Application(); Application app2 = new Application(); Computer comp = new Computer(); comp.getApplications().add(app1); comp.getApplications().add(app2); session.saveOrUpdate(comp); session.getTransaction().commit(); session.close();
Derogation derogation = new Derogation(); derogation.setApplication(new Application()); derogation.getApplication().setNom("applicationName"); Criteria criteria = session.createCriteria(Derogation.class); criteria.add(Example.create(derogation)); //For the ManyToOne child criteria.createCriteria("application").add(Example.create(derogation.getApplication())); //For the OneToMany child for(DerogationLinux derogationLinux : derogation.getListDerogationLinux()) criteria.createCriteria("listDerogationLinux").add(Example.create(derogationLinux));
// give your application a name and icon (optionally) Application serverApp = new Application("Server App"); // create reusable notification types, their names are used in the Growl settings NotificationType start = new NotificationType("ServerStart"); NotificationType shutdown = new NotificationType("ServerShutdown"); NotificationType[] notificationTypes = new NotificationType[] {start, shutdown}; // connect to Growl on the given host GrowlConnector growl = new GrowlConnector("localhost"); // now register the application in growl growl.register(serverApp, notificationTypes); // finally send the notification growl.notify(new Notification(serverApp, start, "Server is starting", "Good luck"));
public void postConstruct() { //Generate Policy for the Dummy Module WebBundleDescriptor wbd = new WebBundleDescriptor(); Application application = new Application(habitat); application.setVirtual(true); application.setName(DEFAULT_WEB_MODULE_NAME); application.setRegistrationName(DEFAULT_WEB_MODULE_NAME); wbd.setApplication(application); generatePolicy(wbd); } private void generatePolicy(WebBundleDescriptor wbd) {