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

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


                // children are already fetched? Maybe?
                // TODO: think about this situation

                if (getSubpropertiesOfSubproperties) {
                    for (Object element2 : children) {
                        EntityData child = (EntityData) element2;
                        getSubProperties(child.getName(), false);
                    }
                }
                return;
            }

            for (Object element2 : children) {
                EntityData childData = (EntityData) element2;

                // if (!hasChild(clsName, childName)) {
                parentNode.appendChild(createTreeNode(childData));
                // }
            }

            if (getSubpropertiesOfSubproperties) {
                for (Object element2 : children) {
                    EntityData childName = (EntityData) element2;
                    getSubProperties(childName.getName(), false);
                }
            }
        }
View Full Code Here


            public boolean doBeforeSelect(ComboBox comboBox, Record record, int index) {
                if (!isWriteOperationAllowed()) {
                    return false;
                }
                int oldIndex = store.find(ENTITY_NAME_FIELD, comboBox.getValue(), 0, true, true);
                EntityData oldValueEd = new EntityData(comboBox.getValue(), oldIndex >= 0 ? store.getAt(oldIndex).getAsString(BROWSER_TEXT_FIELD) : null);
                EntityData newValue = new EntityData(record.getAsString(ENTITY_NAME_FIELD), record.getAsString(BROWSER_TEXT_FIELD));
                onChangeValue(getSubject(), oldValueEd, newValue);
                return true;
            }
        });
    }
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

    @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

            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

                            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

        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

        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

            }
        });
    }

    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

    /**
     * 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

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.