@Override public void addContextManagerListener( final IContextManagerListener listener) { contextManager.addContextManagerListener(listener); }
public Context getContext(String id) { Context ctx = contextManager.getContext(id); return ctx; }
/** * Adds a listener to this context manager. The listener will be notified * when the set of defined contexts changes. This can be used to track the * global appearance and disappearance of contexts. * * @param listener * The listener to attach; must not be <code>null</code>. */ public final void addContextManagerListener(final IContextManagerListener listener) { addListenerObject(listener); }
@Override public final void contextChanged(final ContextEvent contextEvent) { if (contextEvent.isDefinedChanged()) { final Context context = contextEvent.getContext(); final String contextId = context.getId(); final boolean contextIdAdded = context.isDefined(); if (contextIdAdded) { definedHandleObjects.add(context); } else { definedHandleObjects.remove(context); } if (isListenerAttached()) { fireContextManagerChanged(new ContextManagerEvent(this, contextId, contextIdAdded, false, null)); } } }
@Override public boolean isEnabled() { return contextManager.getActiveContextIds().contains( wrappedContext.getId()); }
private void undefineContext(MBindingContext current) { Context context = contextManager.getContext(current.getElementId()); context.undefine(); }
@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); }
/** * Returns the set of identifiers for those contexts that are defined. * * @return The set of defined context identifiers; this value may be empty, * but it is never <code>null</code>. */ @SuppressWarnings("rawtypes") public final Set getDefinedContextIds() { return getDefinedHandleObjectIds(); }
/** * Removes a listener from this context manager. * * @param listener * The listener to be removed; must not be <code>null</code>. */ public final void removeContextManagerListener(final IContextManagerListener listener) { removeListenerObject(listener); }
@Override public void removeContextListener(IContextListener contextListener) { final LegacyContextListenerWrapper wrapper = new LegacyContextListenerWrapper( contextListener, contextManager, this); wrappedContext.removeContextListener(wrapper); contextManager.removeContextManagerListener(wrapper); }
@Override public void removeContextManagerListener( final IContextManagerListener listener) { contextManager.removeContextManagerListener(listener); }
@Override public final void contextChanged(final ContextEvent contextEvent) { if (contextEvent.isDefinedChanged()) { final Context context = contextEvent.getContext(); final String contextId = context.getId(); final boolean contextIdAdded = context.isDefined(); if (contextIdAdded) { definedHandleObjects.add(context); } else { definedHandleObjects.remove(context); } if (isListenerAttached()) { fireContextManagerChanged(new ContextManagerEvent(this, contextId, contextIdAdded, false, null)); } } }
@Override public Context getContext(String id) { Context ctx = contextManager.getContext(id); return ctx; }
/** * Adds a listener to this context manager. The listener will be notified * when the set of defined contexts changes. This can be used to track the * global appearance and disappearance of contexts. * * @param listener * The listener to attach; must not be <code>null</code>. */ public final void addContextManagerListener(final IContextManagerListener listener) { addListenerObject(listener); }
/** * Returns the set of identifiers for those contexts that are defined. * * @return The set of defined context identifiers; this value may be empty, * but it is never <code>null</code>. */ @SuppressWarnings("rawtypes") public final Set getDefinedContextIds() { return getDefinedHandleObjectIds(); }
/** * Removes a listener from this context manager. * * @param listener * The listener to be removed; must not be <code>null</code>. */ public final void removeContextManagerListener(final IContextManagerListener listener) { removeListenerObject(listener); }
@Override public Context getContext(String id) { Context ctx = contextManager.getContext(id); return ctx; }
/** * Adds a listener to this context manager. The listener will be notified * when the set of defined contexts changes. This can be used to track the * global appearance and disappearance of contexts. * * @param listener * The listener to attach; must not be <code>null</code>. */ public final void addContextManagerListener(final IContextManagerListener listener) { addListenerObject(listener); }
/** * Returns the set of identifiers for those contexts that are defined. * * @return The set of defined context identifiers; this value may be empty, * but it is never <code>null</code>. */ @SuppressWarnings("rawtypes") public final Set getDefinedContextIds() { return getDefinedHandleObjectIds(); }
/** * Removes a listener from this context manager. * * @param listener * The listener to be removed; must not be <code>null</code>. */ public final void removeContextManagerListener(final IContextManagerListener listener) { removeListenerObject(listener); }