Examples of canonicalToDisplayValue()


Examples of org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter.canonicalToDisplayValue()

    @Test
    public void happyPath() throws Exception {
        final DefaultDateDisplayConverter converter = new DefaultDateDisplayConverter(
                "yyyy.MM.dd HH:mm:ss", utc);
        assertEquals("1970.01.01 00:00:00",
                converter.canonicalToDisplayValue(FROZEN_DATE));
        assertEquals(FROZEN_DATE,
                converter.displayToCanonicalValue("1970.01.01 00:00:00"));
    }

    @Test
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter.canonicalToDisplayValue()

        sdf.setTimeZone(utc);

        final DefaultDateDisplayConverter converter = new DefaultDateDisplayConverter(
                utc);
        assertEquals(sdf.format(FROZEN_DATE),
                converter.canonicalToDisplayValue(FROZEN_DATE));
        assertEquals(FROZEN_DATE,
                converter.displayToCanonicalValue(sdf.format(FROZEN_DATE)));
    }

    @Test
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter.canonicalToDisplayValue()

    @Test
    public void invalidDataType() throws Exception {
        final DefaultDateDisplayConverter converter = new DefaultDateDisplayConverter();

        System.err.println("** THE FOLLOWING STACK TRACE IS EXPECTED **");
        assertEquals("XXX", converter.canonicalToDisplayValue("XXX"));

        try {
            converter.displayToCanonicalValue("AAA");
            fail("ConversionFailedException should have been throwed");
        } catch (ConversionFailedException e) {}
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter.canonicalToDisplayValue()

        IDisplayConverter displayConverter = configRegistry.getConfigAttribute(
                CellConfigAttributes.DISPLAY_CONVERTER, cell.getDisplayMode(),
                cell.getConfigLabels().getLabels());

        if (displayConverter != null) {
            displayValue = displayConverter.canonicalToDisplayValue(cell,
                    configRegistry, canonicalValue);
        } else {
            displayValue = canonicalValue;
        }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter.canonicalToDisplayValue()

            Collection valueCollection = (Collection) object;
            for (Object value : valueCollection) {
                if (result.length() > 0) {
                    result += "|"; //$NON-NLS-1$
                }
                String convertedValue = displayConverter
                        .canonicalToDisplayValue(value).toString();
                if (convertedValue.isEmpty()) {
                    // for an empty String add the regular expression for empty
                    // String
                    convertedValue = "^$"; //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter.canonicalToDisplayValue()

                result += convertedValue;
            }
            return "(" + result + ")"; //$NON-NLS-1$//$NON-NLS-2$
        }

        return displayConverter.canonicalToDisplayValue(object).toString();
    }

    @SuppressWarnings("rawtypes")
    protected boolean filterCollectionsEqual(Collection filter1,
            Collection filter2) {
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter.canonicalToDisplayValue()

    protected String getStringFromColumnObject(final int columnIndex,
            final Object object) {
        final IDisplayConverter displayConverter = this.configRegistry
                .getConfigAttribute(FILTER_DISPLAY_CONVERTER, NORMAL,
                        FILTER_ROW_COLUMN_LABEL_PREFIX + columnIndex);
        return displayConverter.canonicalToDisplayValue(object).toString();
    }

    /**
     * Set up a threshold matcher for tokens like '>20', '<=10' etc.
     *
 
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter.canonicalToDisplayValue()

                CellConfigAttributes.DISPLAY_CONVERTER, cell.getDisplayMode(),
                cell.getConfigLabels().getLabels());
        Boolean convertedValue = null;
        if (displayConverter != null) {
            try {
                convertedValue = (Boolean) displayConverter
                        .canonicalToDisplayValue(cell, configRegistry,
                                cell.getDataValue());
            } catch (Exception e) {
                log.debug(e);
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter.canonicalToDisplayValue()

        Object dataValue = null;
        if (displayConverter != null) {
            ILayerCell cell = layer.getCellByPosition(columnPosition,
                    rowPosition);
            if (cell != null) {
                dataValue = displayConverter.canonicalToDisplayValue(cell,
                        configRegistry, cell.getDataValue());
            }
        }

        // Compare with valueToMatch
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter.canonicalToDisplayValue()

            IConfigRegistry configRegistry) {
        Object dataValue = cell.getDataValue();
        IDisplayConverter displayConverter = configRegistry.getConfigAttribute(
                CellConfigAttributes.DISPLAY_CONVERTER, cell.getDisplayMode(),
                cell.getConfigLabels().getLabels());
        return displayConverter.canonicalToDisplayValue(dataValue);
    }

}
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.