Package org.apache.ace.client.repository

Examples of org.apache.ace.client.repository.RepositoryObject


import com.vaadin.ui.VerticalLayout;

public class ACETagEditorExtension implements UIExtensionFactory {

    public Component create(Map<String, Object> context) {
        final RepositoryObject sgo = getRepositoryObjectFromContext(context);
        VerticalLayout result = new VerticalLayout();
        result.setCaption("Tag Editor");
        final Table table = new Table();
        table.setWidth("100%");
        table.addContainerProperty("Tag", TextField.class, null);
        table.addContainerProperty("Value", TextField.class, null);
        table.setEditable(false);
        result.addComponent(table);
        result.setComponentAlignment(table, Alignment.MIDDLE_CENTER);
        final Map<Object, TagTableEntry> idToKey = new HashMap<Object, TagTableEntry>();
        Enumeration<String> keys = sgo.getTagKeys();
        while (keys.hasMoreElements()) {
            String keyString = keys.nextElement();
            String valueString = sgo.getTag(keyString);
            if ((valueString != null) && (valueString.trim().length() != 0)) {
                TagTableEntry tte = new TagTableEntry(sgo, keyString,
                        valueString);
                idToKey.put(tte.addTo(table), tte);
            }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public Component create(Map<String, Object> context) {
        RepositoryObject object = getRepositoryObjectFromContext(context);
        if (object instanceof StatefulTargetObject
            && !((StatefulTargetObject) object).isRegistered()) {
            VerticalLayout result = new VerticalLayout();
            result.setCaption(CAPTION);
            result.addComponent(new Label(
View Full Code Here

            m_activeSelection = value;

            if (value != null) {
                clear();
                for (Object val : value) {
                    RepositoryObject lo = lookup(val);
                    if (lo != null) {
                        List related = null;
                        for (int i = 0; i < m_left.length; i++) {
                            if (i == 0) {
                                related = getRelated(lo, m_left[i]);
View Full Code Here

                }
            }
        }

        public RepositoryObject lookup(Object value) {
            RepositoryObject object = null;
            if (value instanceof String) {
                object = m_repository.get((String) value);
                if (object instanceof StatefulTargetObject) {
                    StatefulTargetObject sgo = (StatefulTargetObject) object;
                    if (sgo.isRegistered()) {
View Full Code Here

                public void buttonClick(ClickEvent event) {
                    Set<?> selection = m_associations.getActiveSelection();
                    if (selection != null) {
                        if (m_associations.isActiveTable(toLeft)) {
                            for (Object item : selection) {
                                RepositoryObject selected = m_associations.lookupInActiveSelection(item);
                                removeHandler.removeLeftSideAssociation(object, selected);
                            }
                        }
                        else if (m_associations.isActiveTable(toRight)) {
                            for (Object item : selection) {
                                RepositoryObject selected = m_associations.lookupInActiveSelection(item);
                                removeHandler.removeRightSideAssocation(object, selected);
                            }
                        }
                    }
                }
View Full Code Here

    @Override
    public void handleEvent(Event event) {
        // We get a topic which ends in '/*', but the event contains a specialized topic.
        // for now, we chop of the star, and check whether the topic starts with that.
        RepositoryObject entity = (RepositoryObject) event.getProperty(RepositoryObject.EVENT_ENTITY);
        if ((event.getTopic().endsWith("ADDED")) || event.getTopic().endsWith("REMOVED")) {
            if (m_leftClass.isInstance(entity) && m_filterLeft.match(entity.getDictionary())) {
                locateLeftEndpoint(true);
            }
            if (m_rightClass.isInstance(entity) && m_filterRight.match(entity.getDictionary())) {
                locateRightEndpoint(true);
            }
        }
    }
View Full Code Here

        if (hasEdit) {
            addListener(new ItemClickListener() {
                public void itemClick(ItemClickEvent event) {
                    if (event.isDoubleClick()) {
                        String itemId = (String) event.getItemId();
                        RepositoryObject object = getFromId(itemId);
                        NamedObject namedObject = m_associations.getNamedObject(object);
                        showEditWindow(namedObject);
                    }
                }
            });
View Full Code Here

    /**
     * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)
     */
    public final void handleEvent(org.osgi.service.event.Event event) {
        final RepositoryObject entity = (RepositoryObject) event.getProperty(RepositoryObject.EVENT_ENTITY);
        final String topic = event.getTopic();

        synchronized (getApplication()) {
            if (isSupportedEntity(entity)) {
                try {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Component create(Map<String, Object> context) {
        RepositoryObject object = getRepositoryObjectFromContext(context);

        Component content = new Label("This target is not yet registered, so it can not verify anything.");
        if (object instanceof StatefulTargetObject) {
            StatefulTargetObject statefulTarget = (StatefulTargetObject) object;
            if (statefulTarget.isRegistered()) {
View Full Code Here

             * it every time.
             */
           
            boolean wasModified = isModified();
           
            RepositoryObject object = (RepositoryObject) event.getProperty(RepositoryObject.EVENT_ENTITY);
            String topic = event.getTopic();
           
            WorkingState newState = WorkingState.Unchanged;
            if (topic.endsWith("/ADDED")) {
                newState = WorkingState.New;
View Full Code Here

TOP

Related Classes of org.apache.ace.client.repository.RepositoryObject

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.