private JLabel createPropertyLabel(IPropertyDescriptor propertyDescriptor, JComponent propertyComponent, Locale locale) { JLabel propertyLabel = createJLabel(); StringBuffer labelText = new StringBuffer(propertyDescriptor.getI18nName( getTranslationProvider(), locale)); if (propertyDescriptor.isMandatory()) { labelText.append("*"); propertyLabel.setForeground(Color.RED); } propertyLabel.setText(labelText.toString()); propertyLabel.setLabelFor(propertyComponent); return propertyLabel; }
private SLabel createPropertyLabel(IPropertyDescriptor propertyDescriptor, @SuppressWarnings("unused") SComponent propertyComponent, Locale locale) { SLabel propertyLabel = createSLabel(); StringBuffer labelText = new StringBuffer(propertyDescriptor.getI18nName( getTranslationProvider(), locale)); if (propertyDescriptor.isMandatory()) { labelText.append("*"); propertyLabel.setForeground(Color.RED); } propertyLabel.setText(labelText.toString()); return propertyLabel; }
private ULCLabel createPropertyLabel(IPropertyDescriptor propertyDescriptor, ULCComponent propertyComponent, Locale locale) { ULCLabel propertyLabel = createULCLabel(); StringBuffer labelText = new StringBuffer(propertyDescriptor.getI18nName( getTranslationProvider(), locale)); if (propertyDescriptor.isMandatory()) { labelText.append("*"); propertyLabel.setForeground(Color.red); } propertyLabel.setText(labelText.toString()); propertyLabel.setLabelFor(propertyComponent); return propertyLabel; }
private JLabel createFormPropertyLabel(IActionHandler actionHandler, Locale locale, IPropertyViewDescriptor propertyViewDescriptor, IPropertyDescriptor propertyDescriptor, IView<JComponent> propertyView, boolean forbidden) { JLabel propertyLabel = createPropertyLabel(propertyViewDescriptor, propertyView.getPeer(), actionHandler, locale); if (!propertyViewDescriptor.isReadOnly() && propertyDescriptor != null && propertyDescriptor.isMandatory() && !(propertyDescriptor instanceof IBooleanPropertyDescriptor)) { if (propertyViewDescriptor.getLabelForeground() == null) { propertyLabel.setForeground(createColor(getFormLabelMandatoryPropertyColorHex())); } propertyLabel.setText(decorateMandatoryPropertyLabel(propertyLabel.getText())); } if (forbidden) { propertyLabel.setText(" "); propertyLabel.setIcon(null); } return propertyLabel; }
StringBuffer columnName = new StringBuffer(propertyDescriptor .getI18nName(getTranslationProvider(), locale)); if (propertyDescriptor.isMandatory()) { columnName.append("*");
private void checkMandatoryProperties(Object proxy) { if (propertyProcessorsEnabled) { for (IPropertyDescriptor propertyDescriptor : componentDescriptor.getPropertyDescriptors()) { if (!propertyDescriptor.isComputed()) { if (propertyDescriptor.isMandatory()) { Object newValue = straightGetProperty(proxy, propertyDescriptor.getName()); if (newValue == null || (isInitialized(newValue) && newValue instanceof Collection<?> && ((Collection<?>) newValue).isEmpty())) { throw new MandatoryPropertyException(propertyDescriptor, proxy); } } if (propertyDescriptor instanceof ICollectionPropertyDescriptor<?> && !((ICollectionPropertyDescriptor<?>) propertyDescriptor).getReferencedDescriptor() .isNullElementAllowed()) { Object newValue = straightGetProperty(proxy, propertyDescriptor.getName()); if (isInitialized(newValue) && newValue instanceof Collection<?>) { for (Object element : ((Collection<?>) newValue)) { if (element == null) { throw new MandatoryPropertyException(propertyDescriptor, proxy); } } } } } } } }
private RLabel createFormPropertyLabel(IActionHandler actionHandler, Locale locale, IPropertyViewDescriptor propertyViewDescriptor, IPropertyDescriptor propertyDescriptor, IView<RComponent> propertyView, boolean forbidden) { RLabel propertyLabel = createPropertyLabel(propertyViewDescriptor, propertyView.getPeer(), actionHandler, locale); if (!propertyViewDescriptor.isReadOnly() && propertyDescriptor != null && propertyDescriptor.isMandatory() && !(propertyDescriptor instanceof IBooleanPropertyDescriptor)) { if (propertyViewDescriptor.getLabelForeground() == null) { propertyLabel.setForeground(getFormLabelMandatoryPropertyColorHex()); } propertyLabel.setLabel(decorateMandatoryPropertyLabel(propertyLabel.getLabel())); } if (forbidden) { propertyLabel.setLabel(" "); propertyLabel.setIcon(null); } return propertyLabel; }
StringBuffer labelText = new StringBuffer( propertyViewDescriptor.getI18nName(translationProvider, locale)); if (propertyDescriptor.isMandatory() && !(propertyDescriptor instanceof IBooleanPropertyDescriptor)) { labelText.append("*");
StringBuffer columnName = new StringBuffer(propertyDescriptor .getI18nName(getTranslationProvider(), locale)); if (propertyDescriptor.isMandatory()) { columnName.append("*");
StringBuffer columnName = new StringBuffer( columnViewDescriptor.getI18nName(actionHandler, locale)); if (propertyDescriptor.isMandatory()) { columnName.append("*");
headerLabel.setToolTip(viewDescription); columnHeaders.add(headerLabel); if (!columnViewDescriptor.isReadOnly() && propertyDescriptor.isMandatory() && !(propertyDescriptor instanceof IBooleanPropertyDescriptor)) { if (columnViewDescriptor.getLabelForeground() == null) {
IPropertyDescriptor propertyDescriptor = rowDescriptor.getPropertyDescriptor(propertyName); String columnName = columnViewDescriptor.getI18nName(actionHandler, locale); if (!columnViewDescriptor.isReadOnly() && propertyDescriptor.isMandatory() && !(propertyDescriptor instanceof IBooleanPropertyDescriptor)) { columnName = decorateMandatoryPropertyLabel(columnName); EvenOddTableCellRenderer headerRenderer = new EvenOddTableCellRenderer(); configurePropertyLabel(headerRenderer, columnViewDescriptor); if (propertyDescriptor.isMandatory() && !(propertyDescriptor instanceof IBooleanPropertyDescriptor)) { if (columnViewDescriptor.getLabelForeground() == null) { headerRenderer.setForeground(createColor(getTableHeaderMandatoryPropertyColorHex()));
StringBuffer columnName = new StringBuffer(propertyDescriptor .getI18nName(getTranslationProvider(), locale)); if (propertyDescriptor.isMandatory()) { columnName.append("*");