Package com.volantis.mcs.eclipse.common.odom.undo

Examples of com.volantis.mcs.eclipse.common.odom.undo.UndoRedoManager


     *
     * @param vocabulary the new value for the vocabulary.
     */
    private void updateVocabulary(String vocabulary) {
        selectedElement.removeChangeListener(selectedElementListener);
        UndoRedoManager undoRedoManager = context.getUndoRedoManager();
        undoRedoManager.demarcateUOW();
        try {
            if (vocabulary != null && vocabulary.length() > 0) {
                selectedElement.setAttribute(
                        DeviceRepositorySchemaConstants.VOCABULARY_ATTRIBUTE_NAME,
                        vocabulary);
            } else {
                selectedElement.removeAttribute(
                        DeviceRepositorySchemaConstants.VOCABULARY_ATTRIBUTE_NAME);
                updateUAProfName(null);
            }
        } finally {
            selectedElement.removeChangeListener(selectedElementListener);
            undoRedoManager.demarcateUOW();
        }
    }
View Full Code Here


     * @param uaProfName the UAProf name.
     */
    private void updateUAProfName(String uaProfName) {
        selectedElement.removeChangeListener(selectedElementListener);

        UndoRedoManager undoRedoManager = context.getUndoRedoManager();
        undoRedoManager.demarcateUOW();

        try {
            Element uaProfElement = getUAProfElement();
            if ((uaProfName == null) || (uaProfName.trim().length() == 0)) {
                if (uaProfElement != null) {
                    uaProfElement.detach();
                }
            } else {
                if (uaProfElement == null) {
                    // create a new element
                    uaProfElement = context.getODOMFactory().element(
                            DeviceRepositorySchemaConstants.UAPROF_ELEMENT_NAME,
                            selectedElement.getNamespace());
                    selectedElement.addContent(uaProfElement);
                }
                uaProfElement.setAttribute(
                        DeviceRepositorySchemaConstants.UAPROF_ATTRIBUTE_NAME,
                        uaProfName);
            }
        } finally {
            selectedElement.addChangeListener(selectedElementListener);
            undoRedoManager.demarcateUOW();
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.common.odom.undo.UndoRedoManager

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.