private IView<JComponent> createDecimalPropertyView( IDecimalPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, Locale locale) { if (propertyDescriptor instanceof IPercentPropertyDescriptor) { return createPercentPropertyView( (IPercentPropertyDescriptor) propertyDescriptor, actionHandler, locale); } JTextField viewComponent = createJTextField(); IFormatter formatter = createDecimalFormatter(propertyDescriptor, locale); JFormattedFieldConnector connector = new JFormattedFieldConnector( propertyDescriptor.getName(), viewComponent, formatter); connector.setExceptionHandler(actionHandler); adjustSizes(viewComponent, formatter, getDecimalTemplateValue(propertyDescriptor)); return constructView(viewComponent, null, connector); }
private IView<SComponent> createDecimalPropertyView( IDecimalPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, Locale locale) { if (propertyDescriptor instanceof IPercentPropertyDescriptor) { return createPercentPropertyView( (IPercentPropertyDescriptor) propertyDescriptor, actionHandler, locale); } STextField viewComponent = createSTextField(); IFormatter formatter = createDecimalFormatter(propertyDescriptor, locale); SFormattedFieldConnector connector = new SFormattedFieldConnector( propertyDescriptor.getName(), viewComponent, formatter); connector.setExceptionHandler(actionHandler); adjustSizes(viewComponent, formatter, getDecimalTemplateValue(propertyDescriptor)); return constructView(viewComponent, null, connector); }
if (propertyViewDescriptor.isReadOnly()) { viewComponent = createSLabel(true); connector = new SLabelConnector(propertyDescriptor.getName(), (SLabel) viewComponent); ((SLabelConnector) connector).setFormatter(formatter); } else { viewComponent = createSTextField(); connector = new SFormattedFieldConnector(propertyDescriptor.getName(), (STextField) viewComponent, formatter); adjustSizes(propertyViewDescriptor, viewComponent, formatter,
private IView<ULCComponent> createDecimalPropertyView( IDecimalPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, Locale locale) { if (propertyDescriptor instanceof IPercentPropertyDescriptor) { return createPercentPropertyView( (IPercentPropertyDescriptor) propertyDescriptor, actionHandler, locale); } ULCTextField viewComponent = createULCTextField(); NumberFormat format = createDecimalFormat(propertyDescriptor, locale); viewComponent.setDataType(createDecimalDataType(propertyDescriptor, locale, format)); ULCTextFieldConnector connector = new ULCTextFieldConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); adjustSizes(viewComponent, createFormatter(format), getDecimalTemplateValue(propertyDescriptor)); return constructView(viewComponent, null, connector); }
viewComponent = createJLabel(propertyViewDescriptor, true); connector = new JLabelConnector(propertyDescriptor.getName(), (JLabel) viewComponent); ((JLabelConnector) connector).setFormatter(formatter); } else { viewComponent = createJTextField(propertyViewDescriptor); connector = new JFormattedFieldConnector(propertyDescriptor.getName(), (JTextField) viewComponent, formatter);
actionHandler, locale); if (propertyViewDescriptor.isReadOnly()) { connector = getConnectorFactory().createFormattedValueConnector(propertyDescriptor.getName(), formatter); if (propertyViewDescriptor.getAction() != null && actionHandler.isAccessGranted( propertyViewDescriptor.getAction())) { } else { if (isNumberServerParse() || getOverloadedPattern(propertyViewDescriptor, propertyDescriptor) != null) { connector = getConnectorFactory().createFormattedValueConnector(propertyDescriptor.getName(), formatter); viewComponent = createRTextField(propertyViewDescriptor); } else { connector = getConnectorFactory().createValueConnector(propertyDescriptor.getName()); viewComponent = createRDecimalField(propertyViewDescriptor); ((RDecimalComponent) viewComponent).setMaxFractionDigit(propertyDescriptor.getMaxFractionDigit());