Search in sources :

Example 16 with IEntity

use of org.whole.lang.model.IEntity in project whole by wholeplatform.

the class ConnectionReconnectCommand method undo.

public void undo() {
    IEntity connection = getConnection();
    connect(oldNode, oldNodeFeature, connection);
    connection.wSet(getConnectionFeature(isSourceCommand() ? "source" : "target"), oldNode);
    disconnect(newNode, newNodeFeature, connection);
}
Also used : IEntity(org.whole.lang.model.IEntity)

Example 17 with IEntity

use of org.whole.lang.model.IEntity in project whole by wholeplatform.

the class ConnectionReconnectCommand method execute.

public void execute() {
    oldNodeFeature = getConnectionConnectedFeature(oldNode);
    IEntity connection = getConnection();
    connect(newNode, newNodeFeature, connection);
    connection.wSet(getConnectionFeature(isSourceCommand() ? "source" : "target"), newNode);
    disconnect(oldNode, oldNodeFeature, connection);
}
Also used : IEntity(org.whole.lang.model.IEntity)

Example 18 with IEntity

use of org.whole.lang.model.IEntity in project whole by wholeplatform.

the class DeleteGuideCommand method undo.

public void undo() {
    parent.addGuide(guide);
    Iterator iter = oldParts.keySet().iterator();
    while (iter.hasNext()) {
        IEntity part = (IEntity) iter.next();
        guide.attachPart(part, ((Integer) oldParts.get(part)).intValue());
    }
}
Also used : IEntity(org.whole.lang.model.IEntity) Iterator(java.util.Iterator)

Example 19 with IEntity

use of org.whole.lang.model.IEntity in project whole by wholeplatform.

the class ConnectionCreateCommand method execute.

public void execute() {
    IEntity connection = getConnection();
    // FIXME get transitions from presentation aspect
    IEntity transitionParent = EntityUtils.getCompoundRoot(source).wGet(1);
    connect(source, sourceFeature, connection);
    // FIXME should use presentation aspects
    connection.wSet(getConnectionFeature("source"), source);
    connection.wSet(getConnectionFeature("target"), target);
    connect(target, targetFeature, connection);
    transitionParent.wAdd(connection);
}
Also used : IEntity(org.whole.lang.model.IEntity)

Example 20 with IEntity

use of org.whole.lang.model.IEntity in project whole by wholeplatform.

the class AbstractCompositePart method getModelChildren.

protected List<IEntity> getModelChildren() {
    IEntity entity = getModelEntity();
    int size = entity.wSize();
    if (size == 0)
        return Collections.emptyList();
    List<IEntity> result = new ArrayList<IEntity>(size);
    if (isModelChildrenReversed())
        for (int i = size - 1; i >= 0; i--) result.add(entity.wGet(i));
    else
        for (int i = 0; i < size; i++) result.add(entity.wGet(i));
    return result;
}
Also used : IEntity(org.whole.lang.model.IEntity) ArrayList(java.util.ArrayList)

Aggregations

IEntity (org.whole.lang.model.IEntity)1407 ArrayList (java.util.ArrayList)604 Test (org.junit.Test)241 IBindingManager (org.whole.lang.bindings.IBindingManager)141 PathExpression (org.whole.lang.queries.model.PathExpression)68 ITemplateManager (org.whole.lang.templates.ITemplateManager)61 Grammar (org.whole.lang.grammars.model.Grammar)50 TestXmlGrammar (org.whole.lang.grammars.util.TestXmlGrammar)46 FeatureDescriptor (org.whole.lang.reflect.FeatureDescriptor)43 Model (org.whole.lang.models.model.Model)40 InternalIEntity (org.whole.lang.model.InternalIEntity)38 VisitException (org.whole.lang.visitors.VisitException)35 IEntityPartViewer (org.whole.lang.ui.viewers.IEntityPartViewer)30 ModelsModel (org.whole.lang.models.codebase.ModelsModel)27 WholeIllegalArgumentException (org.whole.lang.exceptions.WholeIllegalArgumentException)26 StreamPersistenceProvider (org.whole.lang.codebase.StreamPersistenceProvider)24 ModelBuilderOperation (org.whole.lang.builders.ModelBuilderOperation)22 XmlModel (org.whole.lang.models.codebase.XmlModel)22 MissingVariableException (org.whole.lang.visitors.MissingVariableException)22 IEntityPart (org.whole.lang.ui.editparts.IEntityPart)21