Package ariba.ui.meta.core

Examples of ariba.ui.meta.core.Rule


        // Any items after the new predecessor should now follow item
        reparentFollowers(dragContext, dropItem, draggedItem, editSet, preds);

        // Now place this field after its dropTarget
        Rule rule = editSet.editableRuleForContext(dragContext);
        editSet.updateRule(rule, Collections.singletonMap(UIMeta.KeyAfter, (Object)dropItem));
        Log.meta.debug("Resetting predecessor of %s to %s\n", draggedItem, dropItem);

        if (_selectedRecord != null) {
            setSelectedRecord((Context.AssignmentRecord)dragRec);
View Full Code Here


        List followers = preds.get(predecessor);
        if (!ListUtil.nullOrEmptyList(followers)) {
            for (Object item : followers) {
                if (item instanceof ItemProperties) {
                    String name = ((ItemProperties)item).name();
                    Rule rule = editSet.ruleForContextAlternate(dragContext, name);
                    editSet.updateRule(rule, Collections.singletonMap(UIMeta.KeyAfter, (Object)newPredecessor));
                    Log.meta.debug("Resetting predecessor of %s to %s\n", name, newPredecessor);
                }
            }
        }
View Full Code Here

        public Rule addRule (List<Rule.Selector> selectors, Map<String, Object> properties)
        {
            _dirty = true;
            _meta._resumeEditingRuleSet(ruleSet());
            Rule prevLast = ListUtil.lastElement(ruleSet().rules(false));
            int rank = Math.max(((prevLast != null) ? prevLast.getRank() + 1 : 0), Meta.EditorRulePriority);
            Rule rule = new Rule(selectors, properties, rank);
            List<Rule> extras = UIMeta.getInstance()._addRuleAndReturnExtras(rule);
            if (extras != null) _extrasForRule.put(rule, extras);
            getEditRules().add(rule);
            _meta.endRuleSet();
            return rule;
View Full Code Here

        public Rule existingEditableRuleMatchingContext (Context.InspectorInfo contextInfo)
        {
            List<Rule> rules = getEditRules();
            for (int i = rules.size()-1; i >=0; i--) {
                Rule rule = rules.get(i);
                if (ruleMatchesContext(rule, contextInfo)) return rule;
            }
            return null;
        }
View Full Code Here

            return null;
        }

        public Rule editableRuleForContext (Context.InspectorInfo contextInfo)
        {
            Rule rule = existingEditableRuleMatchingContext(contextInfo);
            return (rule != null)
                    ? rule
                    : addRule(selectorForContext(contextInfo), new HashMap());
        }
View Full Code Here

    public void toggleSelector ()
    {
        // add/remove _contextKey : _contextValue
        Set<String> predKeys = new HashSet();
        Rule rule = currentRule();
        for (Rule.Selector p : rule.getSelectors()) {
            predKeys.add(p.getKey());
        }

        if (selectorUsesContextKey()) {
            predKeys.remove(_contextKey);
View Full Code Here

    public void toggleTrait ()
    {
        boolean adding = !hasTrait();
        EditManager.EditSet editSet = _editManager.editSetForContext(_contextInfo);
        Rule rule = editSet.editableRuleForContext(_contextInfo);
        Map newProp = _editManager.updatedListProperty(rule.getProperties(), Meta.KeyTrait,
                            _trait, _editManager.newListForVal(activeTraits()),
                            adding, true);

        editSet.updateRule(rule, newProp);
        invalidateForEdit();
View Full Code Here

        if (_propertyKey == null && isPropertiesPanel()) {
            Confirmation.showConfirmation(requestContext(), AWEncodedString.sharedEncodedString("AddPropertyPanel"));
            return;
        }

        Rule rule = currentRule();
        if (rule == null) rule = _editSet.editableRuleForContext(_contextInfo);
        String key = "prop";
        if (_propertyKey != null) {
            key = _propertyKey;
        }
        Object value = rule.getProperties().get(key);
        if (value != null) {
            editProperty(rule, key, value);
        }
        else {
            value = _contextInfo.properties.get(key);
View Full Code Here

        }
    }

    public void deleteRule ()
    {
        Rule rule = currentRule();
        _editManager.editSetForRule(rule).deleteRule(rule);
        invalidateForEdit();
    }
View Full Code Here

    }

    public void deleteCurrentProperty ()
    {
        // FIXME!  Smashing rules directly is BAD!
        Rule rule = currentRule();
        Object val = null;

        if (!rule.isEditable()) {
            rule = _editSet.editableRuleForContext(_contextInfo);
            val = new Meta.OverrideValue(null);
        }
        _editSet.updateRule(rule, Collections.singletonMap(_assignment.getKey(), val));
        invalidateForEdit();
View Full Code Here

TOP

Related Classes of ariba.ui.meta.core.Rule

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.