Package edu.stanford.bmir.protege.web.client.rpc.data

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


    protected void valueChanged(CheckBox checkBox) {
        if (isWriteOperationAllowed()) {
            String newValue = checkBox.getElement().getId();
            if (checkBox.getValue() == true) {
                addPropertyValue(getSubject().getName(), getProperty().getName(), ValueType.Instance, new EntityData(newValue),
                    getAddValueOperationDescription(newValue, checkBox.getText()));
            }
            else {
                removePropertyValue(getSubject().getName(), getProperty().getName(), ValueType.Instance, new EntityData(newValue),
                        getRemoveValueOperationDescription(newValue, checkBox.getText()));
            }

        } else {
            refresh();
View Full Code Here


        Map<String, String> allowedValuesMap = UIUtil.getAllowedValuesConfigurationProperty(widgetConfiguration);
        List<EntityData> allowedValues = null;
        if (allowedValuesMap != null) {
            allowedValues = new ArrayList<EntityData>(allowedValuesMap.size());
            for (String allowedValueLabel : allowedValuesMap.keySet()) {
                EntityData entityData = new EntityData(allowedValuesMap.get(allowedValueLabel), allowedValueLabel);
                entityData.setValueType(ValueType.Instance);
                allowedValues.add(entityData);
            }
        }
        propertyEntityData.setAllowedValues(allowedValues);
View Full Code Here

    protected void displayValues(Collection<EntityData> values) {
        if (values == null || values.size() == 0) {
            comboBox.clearValue();
        } else {
            //FIXME: for now only deal with one value
            EntityData value = values.iterator().next();
            if (value != null) {
                comboBox.setValue(value.getName());
            } else {
                comboBox.clearValue();
            }
        }
    }
View Full Code Here

                public void onAfterEdit(GridPanel grid, Record record, String field, Object newValueO, Object oldValueO,
                        int rowIndex, int colIndex) {
                    // special handling rdfs:Literal

                    // TODO:
                    EntityData rowEntity = (EntityData) record.getAsObject(VALUE);
                    ValueType valueTypeT = rowEntity == null ? null : rowEntity.getValueType();

                    String oldPropValue = null;
                    String newPropValue = null;

                    String newValueS = newValueO.toString();
View Full Code Here

    public Collection<EntityData> getSelection() {
        return currentSelection;
    }

    protected void onDelete(Record record) {
        EntityData valueEd = ((EntityData) record.getAsObject(VALUE));
        String value = valueEd.getName();
        if (valueEd == null || value == null) {
            return; //nothing to delete
        }

        ValueType valueType = valueEd.getValueType();
        String lang = record.getAsString(LANGUAGE);
        if (lang != null && lang.length() > 0) {
            valueType = ValueType.Literal; //TODO: check if necessary
        }
        PropertyEntityData prop = (PropertyEntityData) (record.getAsObject(PROPERTY));
View Full Code Here

        @Override
        public void handleSuccess(List<Triple> triples) {
            store.removeAll();
            if (triples == null) {return;}
            for (Triple triple : triples) {
                EntityData value = triple.getValue();
                String str = value.getName();
                String lan = "";
                if (isLiteralWithLang(str)) {
                    lan = getLang(str);
                    str = getText(str);
                } else {
View Full Code Here

            Button selectButton = new Button("Select", new ButtonListenerAdapter() {
                @Override
                public void onClick(Button button, EventObject e) {
                    Collection<EntityData> selection = SelectionDialog.this.selectable.getSelection();
                    if (selection != null && selection.size() > 0) {
                        EntityData singleSelection = selection.iterator().next();
                        SelectionDialog.this.parent.close();
                        addEmptyPropertyRow((PropertyEntityData) singleSelection);
                    }
                }
            });
View Full Code Here

    public Optional<OWLEntityData> getSelectedEntityData() {
        Collection<EntityData> selection = getSelection();
        // Not sure what the difference is here
        if(selection == null || selection.isEmpty()) {
            EntityData entityData = getEntity();
            if(entityData != null) {
                selection = Collections.singleton(entityData);
            }
        }

        if(selection == null) {
            return Optional.absent();
        }
        if(selection.isEmpty()) {
            return Optional.absent();
        }
        EntityData entityData = selection.iterator().next();
        return toOWLEntityData(entityData);
    }
View Full Code Here

                }
            }
        }
        else {
            for(OWLIndividual individual : cls.getIndividuals(rootOntology.getImportsClosure())) {
                EntityData entityData = null;
                if(individual.isAnonymous()) {
                    entityData = rm.getEntityData(individual.asOWLAnonymousIndividual());
                }
                else {
                    entityData = rm.getEntityData(individual.asOWLNamedIndividual());
View Full Code Here

    public List<Triple> getAnnotationAssertionTriples() {
        List<Triple> result = new ArrayList<Triple>();
        for (OWLOntology ontology : getRootOntologyImportsClosure()) {
            for(OWLAnnotationAssertionAxiom ax : ontology.getAnnotationAssertionAxioms(entity.getIRI())) {
                RenderingManager rm = getRenderingManager();
                EntityData subjectData = rm.getEntityData(entity);
                PropertyEntityData propData = rm.getPropertyEntityData(ax.getProperty());
                EntityData valueData = rm.getEntityData(ax.getValue());
                Triple triple = new Triple(subjectData, propData, valueData);
                result.add(triple);
            }
        }
        return result;
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.client.rpc.data.EntityData

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.