@Override public void addContextListener(IContextListener contextListener) { final LegacyContextListenerWrapper wrapper = new LegacyContextListenerWrapper( contextListener, contextManager, this); wrappedContext.addContextListener(wrapper); /* * We need to add the listener to the context manager as well, as only * the manager advertises changes to the enabled state. */ contextManager.addContextManagerListener(wrapper); }
/** * Gets the context with the given identifier. If no such context currently * exists, then the context will be created (but be undefined). * * @param contextId * The identifier to find; must not be <code>null</code>. * @return The context with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Context */ public final Context getContext(final String contextId) { checkId(contextId); Context context = (Context) handleObjectsById.get(contextId); if (context == null) { context = new Context(contextId); handleObjectsById.put(contextId, context); context.addContextListener(this); } return context; }
/** * Gets the context with the given identifier. If no such context currently * exists, then the context will be created (but be undefined). * * @param contextId * The identifier to find; must not be <code>null</code>. * @return The context with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Context */ public final Context getContext(final String contextId) { checkId(contextId); Context context = (Context) handleObjectsById.get(contextId); if (context == null) { context = new Context(contextId); handleObjectsById.put(contextId, context); context.addContextListener(this); } return context; }
/** * Gets the context with the given identifier. If no such context currently * exists, then the context will be created (but be undefined). * * @param contextId * The identifier to find; must not be <code>null</code>. * @return The context with the given identifier; this value will never be * <code>null</code>, but it might be undefined. * @see Context */ public final Context getContext(final String contextId) { checkId(contextId); Context context = (Context) handleObjectsById.get(contextId); if (context == null) { context = new Context(contextId); handleObjectsById.put(contextId, context); context.addContextListener(this); } return context; }