@Override protected String formatValueInternal(ITableRow row, Boolean value) { if (isTriStateEnabled() && value == null) { return UNDEFINED_TEXT; } return (BooleanUtility.nvl(value)) ? TRUE_TEXT : ""; }
public boolean isUpdateEnabled() { return BooleanUtility.nvl(UPDATE_ENABLED.get()); }
@Override protected void handleModelPropertyChange(PropertyChangeEvent event) { super.handleModelPropertyChange(event); if (IStringField.PROP_INPUT_MASKED.equals(event.getPropertyName()) && !BooleanUtility.nvl((Boolean) event.getNewValue())) { // Send display text if input is not masked anymore (otherwise obfuscated display text might be made visible instead of real one). // Disable obfuscation because it still active and user focuses field, the content would be cleared. JsonProperty<?> displayTextProperty = getJsonProperty(IBasicField.PROP_DISPLAY_TEXT); addPropertyChangeEvent(PROP_INPUT_OBFUSCATED, false); addPropertyChangeEvent(displayTextProperty, getModel().getDisplayText()); } }
LOG.warn("HealthCheck[{}] failed, future={}.", getName(), m_future, t); m_lastStatus.set(BooleanUtility.nvl(result)); m_timestamp.set(System.currentTimeMillis()); m_future = null;
protected void initRequestReply(final Map<Object, Object> properties) throws JMSException { m_requestReplyEnabled = BooleanUtility.nvl( TypeCastUtility.castValue(properties.get(REQUEST_REPLY_ENABLED), Boolean.class), CONFIG.getPropertyValue(RequestReplyEnabledProperty.class)); if (!m_requestReplyEnabled) { LOG.info("{}: 'request-reply' messaging is disabled", m_symbolicName); return; } // Register consumer to handle cancellation requests for 'request-reply' communication. Object prop = properties.get(IMomImplementor.REQUEST_REPLY_CANCELLATION_TOPIC); if (prop instanceof IDestination) { m_requestReplyCancellationTopic = (IDestination<?>) prop; } else { final String cancellationTopicName = ObjectUtility.toString(prop); if (cancellationTopicName != null) { final DestinationConfigPropertyParser p = BEANS.get(DestinationConfigPropertyParser.class).parse(cancellationTopicName); m_requestReplyCancellationTopic = MOM.newDestination(p.getDestinationName(), DestinationType.TOPIC, p.getResolveMethod(), p.getParameters()); } else { m_requestReplyCancellationTopic = CONFIG.getPropertyValue(RequestReplyCancellationTopicProperty.class); } } }
/** * Called by {@link #execCopy(List)} for each row and each visible column in case of a <code>CTRL-C</code> event on * the table to copy the given rows into the clipboard. */ protected void appendCopyTextForColumn(StringBuilder clipboardPlainText, ITableRow row, IColumn<?> column, boolean firstColumn) { String text; if (column instanceof IBooleanColumn) { boolean value = BooleanUtility.nvl(((IBooleanColumn) column).getValue(row), false); text = value ? "X" : ""; } else { text = StringUtility.emptyIfNull(row.getCell(column).getText()); } // special intercept for html if (text != null && row.getCell(column).isHtmlEnabled()) { text = HTML.raw(text).toPlainText(); } // text/plain if (!firstColumn) { clipboardPlainText.append("\t"); } clipboardPlainText.append(StringUtility.emptyIfNull(StringUtility.unwrapText(text))); }
@Override public void importFormFieldData(AbstractFormFieldData source, boolean valueChangeTriggersEnabled) { Assertions.assertNotNull(source); if (source.isValueSet() && m_table != null) { try { if (!valueChangeTriggersEnabled) { setValueChangeTriggerEnabled(false); } if (source instanceof AbstractTableFieldBeanData) { AbstractTableFieldBeanData tableBeanData = (AbstractTableFieldBeanData) source; m_table.importFromTableBeanData(tableBeanData); } if (m_table.isCheckable() && m_table.getCheckableColumn() != null) { for (ITableRow row : m_table.getRows()) { row.setChecked(BooleanUtility.nvl(m_table.getCheckableColumn().getValue(row))); } } } finally { if (!valueChangeTriggersEnabled) { setValueChangeTriggerEnabled(true); } } } }
private String createCellIcon(ITableRow row) { if (row == null) { return ""; } String iconId = null; if (row.getTable().isCheckable()) { iconId = computeCheckboxIconId(row.isChecked()); } else { iconId = row.getIconId(); IColumn<?> firstVisibleColumn = row.getTable().getColumnSet().getFirstVisibleColumn(); if (iconId == null) { iconId = row.getCell(firstVisibleColumn).getIconId(); } if (iconId == null) { if (isCheckBoxColumn(firstVisibleColumn)) { IBooleanColumn booleanColumn = (IBooleanColumn) firstVisibleColumn; iconId = computeCheckboxIconId(BooleanUtility.nvl(booleanColumn.getValue(row))); } } } if (iconId == null) { return ""; } else { return "<img width=\"16\" height=\"16\" src=\"cid:" + iconId + "\"/>"; } }