Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSSelector


    public static void initialize() {
        String className = ERXProperties.stringForKeyWithDefault("er.corebusinesslogic.ERCAuditTrailClassName", ERCAuditTrailHandler.class.getName());
        Class c = ERXPatcher.classForName(className);
        _handler = (ERCAuditTrailHandler) _NSUtilities.instantiateObject(c, new Class[]{}, new Object[]{}, true, false);
        NSSelector sel = ERXSelectorUtilities.notificationSelector("modelGroupDidLoad");
        NSNotificationCenter.defaultCenter().addObserver(_handler, sel, ERXModelGroup.ModelGroupAddedNotification, null);
    }
View Full Code Here


                }
            }
        }
        log.info("Configuration : " + configuration);
        NSNotificationCenter.defaultCenter().removeObserver(_handler, ERXModelGroup.ModelGroupAddedNotification, null);
        NSSelector sel = ERXSelectorUtilities.notificationSelector("handleSave");
        NSNotificationCenter.defaultCenter().addObserver(_handler, sel, ERXEC.EditingContextWillSaveChangesNotification, null);
    }
View Full Code Here

        return ERXValueUtilities.booleanValueWithDefault(valueForKey(key), def);
    }

    public static class _UserPreferenceHandler {
        public _UserPreferenceHandler() {
            NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("handleBatchSizeChange", ERXConstant.NotificationClassArray), ERXBatchNavigationBar.BatchSizeChanged, null);
            NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("handleSortOrderingChange", ERXConstant.NotificationClassArray), ERXSortOrder.SortOrderingChanged, null);
        }
View Full Code Here

    }

    private NSSelector _primaryKeySortOrderingSelector()
    {
        EOSortOrdering eosortordering = _primarySortOrdering();
        NSSelector nsselector = null;
        if(eosortordering != null)
            nsselector = eosortordering.selector();
        return nsselector;
    }
View Full Code Here

    public String imageName()
    {
        String s = "Unsorted.gif";
        if(_isCurrentKeyPrimary())
        {
          NSSelector nsselector = _primaryKeySortOrderingSelector();
          if(nsselector.equals(EOSortOrdering.CompareAscending)
              || nsselector.equals(EOSortOrdering.CompareCaseInsensitiveAscending)) {
            s = "Ascending.gif";
          } else if(nsselector.equals(EOSortOrdering.CompareDescending)
              || nsselector.equals(EOSortOrdering.CompareCaseInsensitiveDescending)) {
            s = "Descending.gif";
          }
        }
        return s;
    }
View Full Code Here

    public WOComponent toggleClicked()
    {
        String s = key();
        boolean caseInsensitive = caseInsensitive();
        NSSelector asc = caseInsensitive ? EOSortOrdering.CompareCaseInsensitiveAscending : EOSortOrdering.CompareAscending;
        NSSelector desc = caseInsensitive ? EOSortOrdering.CompareCaseInsensitiveDescending : EOSortOrdering.CompareDescending;
        if(_isCurrentKeyPrimary())
        {
            NSSelector nsselector = _primaryKeySortOrderingSelector();
            if(nsselector.equals(EOSortOrdering.CompareAscending)
                || nsselector.equals(EOSortOrdering.CompareCaseInsensitiveAscending)) {
                _removeSortOrderingWithKey(s);
                _makePrimarySortOrderingWithSelector(desc);
            } else if (nsselector.equals(EOSortOrdering.CompareDescending)
                || nsselector.equals(EOSortOrdering.CompareCaseInsensitiveDescending)) {
                _removeSortOrderingWithKey(s);
                _makePrimarySortOrderingWithSelector(asc);
            } else {
                _removeSortOrderingWithKey(s);
                _makePrimarySortOrderingWithSelector(asc);
View Full Code Here

     *
     * @param key sort key
     * @return selector for the given sort ordering key or <code>null</code>
     */
    public static NSSelector sortSelectorWithKey(String key) {
        NSSelector result = null;
        if (key != null && !key.equals("")) {
            result = _selectorsByKey.objectForKey(key);
            if (result == null) {
              result = new NSSelector(key, ERXConstant.ObjectClassArray);
            }
        }
        return result;
    }
View Full Code Here

        ERXValidation.setPushChangesDefault(ERXValueUtilities.booleanValueWithDefault(ERXSystem.getProperty("er.extensions.ERXValidationShouldPushChangesToObject"), ERXValidation.DO_NOT_PUSH_INCORRECT_VALUE_ON_EO));

        if (WOApplication.application()!=null && !WOApplication.application().isCachingEnabled()) {
            NSNotificationCenter center = NSNotificationCenter.defaultCenter();
            center.addObserver(this,
                               new NSSelector("resetTemplateCache",  ERXConstant.NotificationClassArray),
                               ERXLocalizer.LocalizationDidResetNotification,
                               null);
        }
    }
View Full Code Here

        _timeout = timeout;
        registerForNotifications();
    }

  protected void registerForNotifications() {
    NSSelector selector = ERXSelectorUtilities.notificationSelector("editingContextDidSaveChanges");
        NSNotificationCenter.defaultCenter().addObserver(this, selector,
                EOEditingContext.EditingContextDidSaveChangesNotification, null);
        selector = ERXSelectorUtilities.notificationSelector("clearCaches");
        NSNotificationCenter.defaultCenter().addObserver(this, selector,
                ERXEnterpriseObjectCache.ClearCachesNotification, null);
View Full Code Here

            log.warn("Registering the pool with only one coordinator doesn't make a lot of sense.");
            _maxObjectStoreCoordinators = 1;
        }
        _oscForSession = new HashMap<String, EOObjectStore>();
       
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector/*<Void>*/("sessionDidCreate", ERXConstant.NotificationClassArray), WOSession.SessionDidCreateNotification, null);
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector/*<Void>*/("sessionDidTimeout", ERXConstant.NotificationClassArray), WOSession.SessionDidTimeOutNotification, null);
    }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.