Examples of DefaultJDOMFactory


Examples of org.jdom.input.DefaultJDOMFactory

     * associated with the given DeviceEditorContext.
     * @param context the DeviceEditorContext
     */
    private void createLocationDetailsRegistry(DeviceEditorContext context) {
        LocationDetailsRegistry registry = new LocationDetailsRegistry();
        DefaultJDOMFactory factory = new DefaultJDOMFactory();

        Element element = factory.element(DeviceRepositorySchemaConstants.
                POLICY_ELEMENT_NAME,
                MCSNamespace.DEVICE_DEFINITIONS);

        ODOMElement root = (ODOMElement)
                context.getDeviceRepositoryAccessorManager().
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

            if (registry == null) {
                registry = new LocationDetailsRegistry();
                errorReporter.setLocationDetailsRegistry(registry);
            }

            DefaultJDOMFactory factory = new DefaultJDOMFactory();

            Element element = factory.element(DeviceRepositorySchemaConstants.
                    NUMBER_ELEMENT_NAME,
                    MCSNamespace.DEVICE_TAC_IDENTIFICATION);

            LocationDetails details =
                    new DeviceLocationDetails(ERROR_LOCATION_FORMAT,
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

                DeviceRepositoryAccessorManager deviceRAM =
                        new DeviceRepositoryAccessorManager(
                                repository.getPath(),
                                new TestTransformerMetaFactory(),
                                new DefaultJDOMFactory(), false);

                PolicyValueModifierFactory pvmodFactory =
                        new PolicyValueModifierFactory(deviceRAM);
                Shell shell = new Shell(Display.getDefault(), SWT.SHELL_TRIM);
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

    public void testSetProxiedElementsReasons() {
        PolicyProxyElementDetails details =
                new PolicyProxyElementDetails("imageComponent");
        ProxyElementDetails.ChangeReason reason =
                ProxyElementDetails.ATTRIBUTES;
        JDOMFactory factory = new DefaultJDOMFactory();
        ArrayList elements = new ArrayList();
        Element element = factory.element("deviceImageAsset");
        elements.add(element);

        assertFalse("Should be false with an ATTRIBUTES reason.",
                details.setProxiedElements(elements.iterator(), reason));
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

    public void testSetProxiedElementsNoChange() {
        PolicyProxyElementDetails details =
                new PolicyProxyElementDetails("imageComponent");
        ProxyElementDetails.ChangeReason reason =
                ProxyElementDetails.ELEMENTS;
        JDOMFactory factory = new DefaultJDOMFactory();
        ArrayList elements = new ArrayList();
        elements.add(factory.element(ODOMElement.NULL_ELEMENT_NAME));

        assertFalse("Should be false since the first time " +
                "setProxiedElements is called, element should be \"" +
                ODOMElement.NULL_ELEMENT_NAME + "\".",
                details.setProxiedElements(elements.iterator(), reason));
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

    public void testSetProxiedElementsChanged() {
        PolicyProxyElementDetails details =
                new PolicyProxyElementDetails("imageComponent");
        ProxyElementDetails.ChangeReason reason =
                ProxyElementDetails.ELEMENTS;
        JDOMFactory factory = new DefaultJDOMFactory();
        ArrayList elements = new ArrayList();

        // Test that when the element changes then the element name changes.
        elements.add(factory.element("deviceImageAsset"));
        assertTrue("Element name has changed and reason is ELEMENTS.",
                details.setProxiedElements(elements.iterator(), reason));

        assertEquals("Element name should now be \"deviceImageAsset\"",
                "deviceImageAsset", details.getElementName());

        // Test that different element names produce UNDEFINED_ELEMENT_NAME
        Element element = factory.element("genericImageAsset");
        elements.add(element);
        assertTrue("Element name has changed and reason is ELEMENTS.",
                details.setProxiedElements(elements.iterator(), reason));
        assertEquals("Element name should now be \"" +
                ODOMElement.UNDEFINED_ELEMENT_NAME + "\"",
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

        extends TestCaseAbstract {
    /**
     * Test getElements with no skip or stop elements.
     */
    public void testGetChildrenSimple() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element parent = factory.element("parent");
        Element child1 = factory.element("child1");
        Element child2 = factory.element("child2");
        parent.addContent(child1);
        parent.addContent(child2);

        ElementChildrenTreeContentProvider provider =
                new ElementChildrenTreeContentProvider();
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

    /**
     * Test getChildren with stop elements.
     */
    public void testGetChildrenStopElements() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element parent1 = factory.element("parent1");
        Element child1a = factory.element("child1a");
        Element child2a = factory.element("child2a");
        parent1.addContent(child1a);
        parent1.addContent(child2a);

        Element parent2 = factory.element("parent2");
        Element child1b = factory.element("child1b");
        Element child2b = factory.element("child2b");
        parent2.addContent(child1b);
        parent2.addContent(child2b);

        String [] stopElements = { parent1.getName(), parent2.getName() };

        ElementChildrenTreeContentProvider provider =
                new ElementChildrenTreeContentProvider(null, stopElements,
                        false, false);

        Object [] elements = provider.getChildren(parent1);
        assertEquals("There should be no child elements for parent1", 0,
                elements.length);

        elements = provider.getChildren(parent2);
        assertEquals("There should be no child elements for parent2", 0,
                elements.length);

        // Make parent1 and parent2 child of some root element to ensure that
        // they do appear in the root's children.
        Element root = factory.element("root");
        root.addContent(parent1);
        root.addContent(parent2);

        elements = provider.getChildren(root);
        assertEquals("There should be two child elements for root.", 2,
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

   
    /**
     * Test the event with a valid JDOM Element.
     */
    public void testEventWithJDOMElement() throws Exception {
        DefaultJDOMFactory factory = new DefaultJDOMFactory();
        Element source = factory.element("testElement");
        ElementSelectionChangeEvent event =
                new ElementSelectionChangeEvent(source);

        String mustBeNull = "Value should be null";
        assertNull(mustBeNull, event.getNewValue());
View Full Code Here

Examples of org.jdom.input.DefaultJDOMFactory

    /**
     * Test the event with a valid ODOMChangeEvent object.
     */
    public void testEventWithODOMChangeEvent() throws Exception {
        ODOMElement source = (ODOMElement)factory.element("test");
        DefaultJDOMFactory factory = new DefaultJDOMFactory();
        Element oldObject = factory.element("oldObject");
        Element newObject = factory.element("newObject");
        ODOMChangeEvent event = ODOMChangeEvent.createNew(source, oldObject, newObject,
                ChangeQualifier.NAMESPACE);

        ElementSelectionChangeEvent selectionChangeEvent =
                new ElementSelectionChangeEvent(event);
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.