@Override @Nonnull public T get() { return find(serviceClass); } };
/******************************************************************************************************************* * * @deprecated Use {@link #createProviderFor(Class)} instead. * ******************************************************************************************************************/ @Nonnull @Deprecated public static <T> Provider<T> findProvider (final @Nonnull Class<T> serviceClass) { return createProviderFor(serviceClass); }
/******************************************************************************************************************* * * Creates a {@link Provider} that can be used to find a service registered in the global {@link Lookup} or a * {@link TopComponent}. Please look at the class javadoc for more information. * * @param serviceClass the service class * @return the {@code Provider} * ******************************************************************************************************************/ @Nonnull public static <T> T find (final @Nonnull Class<T> serviceClass) { Class<? extends T> serviceClass2 = serviceClass; final ImplementedBy implementedBy = serviceClass.getAnnotation(ImplementedBy.class); if (implementedBy != null) { serviceClass2 = (Class<? extends T>)implementedBy.value(); } if ((TOP_COMPONENT_CLASS != null) && TOP_COMPONENT_CLASS.isAssignableFrom(serviceClass2)) { return topComponentFind(serviceClass2); } else { return simpleFind(serviceClass2); } }
protected ModuleActorGroupActivator (final @Nonnull Class<? extends ActorGroupActivator> activatorClass) { actorActivator = Locator.find(activatorClass); }
/******************************************************************************************************************* * * Creates a {@link Provider} that can be used to find a service registered in the global {@link Lookup} or a * {@link TopComponent}. Please look at the class javadoc for more information. * * @param serviceClass the service class * @return the {@code Provider} * ******************************************************************************************************************/ @Nonnull public static <T> T find (final @Nonnull Class<T> serviceClass) { Class<? extends T> serviceClass2 = serviceClass; final ImplementedBy implementedBy = serviceClass.getAnnotation(ImplementedBy.class); if (implementedBy != null) { serviceClass2 = (Class<? extends T>)implementedBy.value(); } if ((TOP_COMPONENT_CLASS != null) && TOP_COMPONENT_CLASS.isAssignableFrom(serviceClass2)) { return topComponentFind(serviceClass2); } else { return simpleFind(serviceClass2); } }
/******************************************************************************************************************* * * @deprecated Use {@link #createProviderFor(Class)} instead. * ******************************************************************************************************************/ @Nonnull @Deprecated public static <T> Provider<T> findProvider (final @Nonnull Class<T> serviceClass) { return createProviderFor(serviceClass); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ public void init (final @Nonnull Repository repository) { taxonomyManager = Locator.find(TaxonomyManager.class); }
@Override @Nonnull public T get() { return find(serviceClass); } };
protected ModuleActorGroupActivator (final @Nonnull Class<? extends ActorGroupActivator> activatorClass) { actorActivator = Locator.find(activatorClass); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull private static String getActionPackage() { if (actionPackage == null) { actionPackage = Locator.find(Context.class).getPackageName() + ".action."; } return actionPackage; } }
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Override public void preVisit (final @Nonnull ObservationSet observationSet) { primaryTaxonLocale = Locator.find(TaxonomyPreferences.class).getTaxonomyLocales().get(0); buffer.append(NbBundle.getMessage(_, "csvHeader").replace("$", separator) + "\n"); }
public CoordinateFinder() throws NotFoundException { super(Coordinate.class, GeoCoderEntity.class); geoCoder = Locator.find(GeoCoderManager.class).findDefaultGeoCoder(); }
public RangeFinder() throws NotFoundException { super(Range.class, GeoCoderEntity.class); geoCoder = Locator.find(GeoCoderManager.class).findDefaultGeoCoder(); }
@Override public void close() { Locator.find(Persistence.class).shutdown(); } }
@Override @Nonnull protected GeoCoder create() { try { geoCoderName ="GeoNames"; // FIXME: it's always null // assert geoCoderName != null : "null geoCoderName"; return Locator.find(GeoCoderManager).findGeoCoderByName(geoCoderName); } catch (NotFoundException e) { throw new RuntimeException(e); } } };
@Override protected void performAction (@Nonnull final List<GeoCoderEntity> geoEntities) throws Exception { Locator.find(GeoExplorerPresentation.class).getLookup(). lookup(SelectionHandler.class).handleSelection(geoEntities); }
public IntegrityCheckerPresentationTopComponent() { super(Locator.find(IntegrityCheckerPresentationBuilder.class), new IntegrityCheckerUIActivator()); setName(NbBundle.getMessage(IntegrityCheckerPresentationTopComponent.class, "CTL_IntegrityCheckerPresentationTopComponent")); } }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public synchronized GeoCoder getGeoCoder() { if (geoCoder == null) { try { geoCoder = Locator.find(GeoCoderManager.class).findGeoCoderByName(geoCoderName); } catch (NotFoundException e) { throw new IllegalStateException(e); } } return geoCoder; }
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override protected void postUnreadNewsNotification() { final String title = getMessage(_, "unreadNewsTitle"); final String message = getMessage(_, "unreadNewsMessage"); final Context context = Locator.find(Context.class); final NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.bluebill_notification, title, System.currentTimeMillis()); final Intent notificationIntent = new Intent(context, NewsActivity.class); final PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); notification.setLatestEventInfo(context, title, message, contentIntent); notificationManager.notify(NEWS_NOTIFICATION_ID, notification); }