Examples of EntityData


Examples of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

    @Override
    protected void valueChanged(CheckBox radioButton) {
        if (isWriteOperationAllowed()) {
            String newValue = radioButton.getElement().getId();
            setPropertyValues(getSubject().getName(), getProperty().getName(), ValueType.Instance, new EntityData(newValue),
                    getSetValuesOperationDescription(values, newValue));
        } else {
            refresh();
        }
    }
View Full Code Here

Examples of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

            refresh();
        }
    }

    protected String getSetValuesOperationDescription(Collection<EntityData> oldValues, String newValue) {
        EntityData oldValue = UIUtil.getFirstItem(oldValues);
        String oldValueLabel = oldValue == null ? "(empty)" : getCheckBox(oldValue.getName()).getText();
        String newValueLabel = newValue == null ? "(empty)" : getCheckBox(newValue).getText();

        return UIUtil.getAppliedToTransactionString("Set " +
                UIUtil.getStringConfigurationProperty(getWidgetConfiguration(), FormConstants.LABEL, getProperty().getBrowserText())
                + " for " + getSubject().getBrowserText() + ". Old value: " + oldValueLabel
View Full Code Here

Examples of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

                            if(containerPortlet != null) {
                                String parentName = URL.decodeComponent(
                                        href.substring(
                                                href.indexOf(local_goto_prefix) +
                                                local_goto_prefix.length() ) );
                                containerPortlet.setSelection(UIUtil.createCollection(new EntityData(parentName)));
                            }
                        }

                    }
                }
View Full Code Here

Examples of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

        return html;
    }

    protected void onRemove(String entityNameToRemove) {
        GWT.log("To remove: " + entityNameToRemove, null);
        EntityData entityToRemove = getEntityData(entityNameToRemove);
        HTML htmlPanel = entityToParentPanelMap.get(entityToRemove);
        if (htmlPanel != null) {
            parentsPanel.remove(htmlPanel);
            entityToParentPanelMap.remove(entityToRemove);
            parentsPanel.doLayout();
View Full Code Here

Examples of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

        retiredClassesField.setClsValues(parents);
    }

    private void onRetire() {
        Collection<EntityData> classesToRetire = retiredClassesField.getClsValues();
        EntityData newParent = newParentField.getClsValue();
        final String reasonForChange = reasonField.getValueAsString();
        boolean retireChildren = retireChildrenCheckbox.getValue();

        if (classesToRetire == null || classesToRetire.size() == 0) {
            MessageBox.alert("No classes to retire selected", "No class to retire was selected." +
View Full Code Here

Examples of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

            }
        });
    }

    protected void updateTitle() {
        EntityData currentEntity = getEntity();
        StringBuilder sb = new StringBuilder();
        sb.append("Definition");
        if(currentEntity != null) {
            sb.append(" for ");
            sb.append(currentEntity.getBrowserText());
        }
        setTitle(sb.toString());
    }
View Full Code Here

Examples of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

    /**
     * Gets the current entity which should be displayed.
     * @return The current entity.  May be <code>null</code>.
     */
    public OWLEntity getCurrentEntity() {
        EntityData entityData = getEntity();
        if(entityData == null) {
            return null;
        }
        IRI iri = IRI.create(entityData.getName());
        if(entityData.getValueType() == ValueType.Cls) {
            return DataFactory.getOWLClass(iri);
        }
        else if(entityData.getValueType() == ValueType.Property) {
            return DataFactory.getOWLObjectProperty(iri);
        }
        else if(entityData.getValueType() == ValueType.Instance) {
            return DataFactory.getOWLNamedIndividual(iri);
        }
        else {
            return null;
        }
View Full Code Here

Examples of org.sakaiproject.entitybus.entityprovider.extension.EntityData

    /**
     * Convert a single object to an entity data object (DOES NOT populate it),
     * will preserve null (i.e. null in => null out)
     */
    public static EntityData convertToEntityData(Object entity, EntityReference ref) {
        EntityData ed = null;
        if (entity != null) {
            ed = makeEntityData(ref, entity);
        }
        return ed;
    }
View Full Code Here

Examples of org.sakaiproject.entitybus.entityprovider.extension.EntityData

     */
    public static Object convertToEntity(Object object) {
        Object togo = null;
        if (object != null) {
            if (EntityData.class.isAssignableFrom(object.getClass())) {
                EntityData ed = (EntityData)object;
                if (ed.getData() != null) {
                    togo = ed.getData();
                } else {
                    togo = ed;
                }
            } else {
                togo = object;
View Full Code Here

Examples of org.sakaiproject.entitybus.entityprovider.extension.EntityData

    /**
     * Make an entity data object out of whatever entity is given,
     * use the given reference, if there is no id then this will attempt to get one otherwise it will use prefix only
     */
    public static EntityData makeEntityData(EntityReference ref, Object entity) {
        EntityData ed = null;
        if (entity != null) {
            if (ref == null) {
                throw new IllegalArgumentException("ref must not be null or no entity data object can be created");
            }
            Class<?> resultClass = entity.getClass();
            if (EntityData.class.isAssignableFrom(resultClass)) {
                ed = (EntityData) entity;
            } else {
                if (ref.getId() == null) {
                    // attempt to get the id if it was not provided
                    String entityId = getEntityId(entity);
                    if (entityId != null) {
                        ref = new EntityReference(ref.getPrefix(), entityId);
                    }
                }
                Object entityObject = entity;
                if (ActionReturn.class.isAssignableFrom(resultClass)) {
                    ActionReturn ar = (ActionReturn) entity;
                    if (ar.entityData == null) {
                        // make entity data from AR
                        if (ar.outputString != null) {
                            entityObject = ar.outputString;
                        } else if (ar.output != null) {
                            entityObject = ar.output;
                        }
                    } else {
                        ed = ar.entityData;
                    }
// removed because it makes a mess of the output, maybe add this in later though -AZ
//                } else if (Map.class.isAssignableFrom(resultClass)) {
//                    props = EntityDataUtils.extractMapProperties((Map)entity);
                }
                if (ed == null) {
                    ed = new EntityData(entityObject);
                }
            }
        }
        return ed;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.