Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSSelector


  }

  private void _registerForCleanup() {
    String notificationName = ERXProperties.stringForKey("er.extensions.jgroupsSynchronizer.applicationWillTerminateNotificationName");
    if (notificationName != null && notificationName.length() > 0) {
      NSSelector applicationLaunchedNotification = new NSSelector("_applicationWillTerminateNotification", new Class[] { NSNotification.class });
      NSNotificationCenter.defaultCenter().addObserver(this, applicationLaunchedNotification, notificationName, null);
    }

    if (ERXProperties.booleanForKeyWithDefault("er.extensions.jgroupsSynchronizer.useShutdownHook", true)) {
      new ERJGroupsCleanupTask(_channel);
View Full Code Here


    public static class Factory {
     
      /** Public constructor */
      public Factory() {
        // Need to be able to preempt the model registering descriptions.
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("modelWasAdded", ERXConstant.NotificationClassArray), EOModelGroup.ModelAddedNotification, null);
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("modelGroupWasAdded", ERXConstant.NotificationClassArray), ERXModelGroup.ModelGroupAddedNotification, null);
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("classDescriptionNeededForEntityName", ERXConstant.NotificationClassArray), EOClassDescription.ClassDescriptionNeededForEntityNameNotification, null);
        NSNotificationCenter.defaultCenter().addObserver(this, new NSSelector("classDescriptionNeededForClass", ERXConstant.NotificationClassArray), EOClassDescription.ClassDescriptionNeededForClassNotification, null);
      }
View Full Code Here

                    if(cd instanceof ERXEntityClassDescription) {
                        ((ERXEntityClassDescription)cd).readDefaultValues();

                        if(isRapidTurnaroundEnabled() && modelPath != null) {
                            String path = modelPath + File.separator + entity.name() + ".plist";
                            ERXFileNotificationCenter.defaultCenter().addObserver(cd, new NSSelector("modelFileDidChange", ERXConstant.NotificationClassArray), path);
                        }
                    } else {
                        defaultLog.warn("Entity classDescription is not ERXEntityClassDescription: " + entity.name());
                    }
                }
View Full Code Here

    ///////////
    // Utility
    ///////////
    public String imageName() {
        if (_isCurrentKeyPrimary()) {
            NSSelector aCurrentState = _primaryKeyOrderingSelector();
            if (aCurrentState==EOSortOrdering.CompareCaseInsensitiveAscending) {
                return "Ascending.gif";
            }
            if (aCurrentState==EOSortOrdering.CompareCaseInsensitiveDescending) {
                return "Descending.gif";
View Full Code Here

    /////////////


    public WOComponent toggleClicked() {
        if (_isCurrentKeyPrimary()) {
            NSSelector aCurrentState = _primaryKeyOrderingSelector();
            if (aCurrentState==EOSortOrdering.CompareCaseInsensitiveAscending) {
                _removeOrderingWithKey(key());
                _makePrimaryOrderingWithSelector( EOSortOrdering.CompareCaseInsensitiveDescending);
            } else if (aCurrentState==EOSortOrdering.CompareCaseInsensitiveDescending) {
                _removeOrderingWithKey(key());
View Full Code Here

    Sort sort = null;
    if (sortOrderings != null && sortOrderings.count() > 0) {
      NSMutableArray<SortField> fields = new NSMutableArray<SortField>(sortOrderings.count());
      for (EOSortOrdering s : sortOrderings) {
        String name = s.key();
        NSSelector sel = s.selector();
        boolean reverse = sel.equals(EOSortOrdering.CompareDescending) || sel.equals(EOSortOrdering.CompareCaseInsensitiveDescending);
        SortField sf = new SortField(name, SortField.DOC, reverse);
        fields.addObject(sf);
      }
      if (fields.count() > 0) {
        sort = new Sort();
View Full Code Here

    public ERD2WHead(WOContext context) {
        super(context);
    }

    public String displayNameForPageConfiguration() {
        NSSelector sel = new NSSelector("d2wContext");
        if(sel.implementedByObject(context().page())) {
            D2WContext context = (D2WContext) context().page().valueForKey("d2wContext");
            return (String) context.valueForKey("displayNameForPageConfiguration");
        } else {
            if(_d2wContext == null)
                _d2wContext = ERD2WContext.newContext();
View Full Code Here

        // the EOObjectStoreCoordinator changes.
        _publisher = new ERCNPublisher(this);

        NSNotificationCenter.defaultCenter().addObserver(
            this,
            new NSSelector("publishChange", new Class[] { NSNotification.class } ),
            EOObjectStoreCoordinator.ObjectsChangedInStoreNotification,
            EOObjectStoreCoordinator.defaultCoordinator());

        // Create the notification subscriber object and register it as the observer for
        // the distributed change notifications. 
View Full Code Here

              if(url != null) {
               
                // If in development mode, observe the indexModel file for changes
                // so that the index can be recreated
                  if(ERXApplication.isDevelopmentModeSafe()) {
                      NSSelector selector = ERXSelectorUtilities.notificationSelector("fileDidChange");
                      ERXFileNotificationCenter.defaultCenter().addObserver(this, selector, url.getFile());
                  }
                 
                  // Get contents of indexModel file
                  String string = ERXStringUtilities.stringFromResource(name, "indexModel", bundle);
View Full Code Here

    NSMutableArray<EOSortOrdering> sortOrderings = new NSMutableArray<EOSortOrdering>();
    for (String sortKeyStr : sortKeysStr.split(",")) {
      String[] sortAttributes = sortKeyStr.split("\\|");
      String sortKey = sortAttributes[0];

      NSSelector sortDirection;
      if (sortAttributes.length == 2) {
        if (sortAttributes[1].equalsIgnoreCase("asc")) {
          sortDirection = EOSortOrdering.CompareCaseInsensitiveAscending;
        }
        else if (sortAttributes[1].equalsIgnoreCase("desc")) {
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.