Package org.jdom.input

Examples of org.jdom.input.DefaultJDOMFactory


    /**
     * Test the removal of 'px' if no value for pixels and there is a previous
     * non-empty value in the list.
     */
    public void testFormatAttributesEndWithX() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);
        attr = factory.attribute("pixelsX", "100");
        attributes.add(attr);

        String message = "{pixelDepth}bits,  {pixelsX}x{pixelsY}px  and that is the end";

        PolicyAttributesDetails details =
View Full Code Here


    /**
     * Test the removal of 'px' if no value for pixels and there is NO previous
     * non-empty value in the list.
     */
    public void testFormatAttributesNoElements() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);

        String message = "{pixelsX}x{pixelsY}px";

        PolicyAttributesDetails details =
View Full Code Here

    /**
     * Test the removal of 'px' if no value for pixels and there is spaces and
     * commas.
     */
    public void testFormatAttributesCommasSpaces() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("pixelDepth", "24");
        attributes.add(attr);
        attr = factory.attribute("pixelsY", "100");
        attributes.add(attr);

        String message = "{pixelDepth}bits , {pixelsX}x{pixelsY}px";

        PolicyAttributesDetails details =
View Full Code Here

    /**
     * Test the missing first bracket (or char) if no value present.
     */
    public void testFormatAttributesMissingGridOpenBracket() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("rows", "1");
        attributes.add(attr);
        attr = factory.attribute("columns", "2");
        attributes.add(attr);

        String message = "{element}: ''{name}'' ({rows}x{columns})";

        PolicyAttributesDetails details =
View Full Code Here

    /**
     * Test the missing first bracket (or char) if value present.
     */
    public void testFormatAttributesGridOpenBracket() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Attribute attr;
        List attributes = new ArrayList();
        attr = factory.attribute("name", "name");
        attributes.add(attr);
        attr = factory.attribute("rows", "1");
        attributes.add(attr);
        attr = factory.attribute("columns", "2");
        attributes.add(attr);

        String message = "{element}: ''{name}'' ({rows}x{columns})";

        PolicyAttributesDetails details =
View Full Code Here

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

            DefaultJDOMFactory factory = new DefaultJDOMFactory();

            Element element = factory.element(DeviceRepositorySchemaConstants.
                    HEADER_PATTERN_ELEMENT_NAME,
                    MCSNamespace.DEVICE_IDENTIFICATION);

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

     * 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

            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

                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

    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

TOP

Related Classes of org.jdom.input.DefaultJDOMFactory

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.