private String getDiagnosticItemsXML(List<List<String>> result) { StringBuilder buf = new StringBuilder(); for (List<String> status : result) { if (ObjectUtility.notEquals(DiagnosticFactory.STATUS_TITLE, status.get(2))) { buf.append("<status name='").append(status.get(0)).append("' status='").append(status.get(2)).append("'>"); buf.append(status.get(1)); buf.append("</status>"); } } return buf.toString(); }
public void popProperty(String propertyName) { if (ObjectUtility.notEquals(m_propertyStack.peek(), propertyName)) { throw new IllegalStateException("'" + propertyName + "' is not the last element in the stack: [" + CollectionUtility.format(m_propertyStack) + "]"); } m_propertyStack.pop(); }
public void setText(String s) { if (ObjectUtility.notEquals(m_text, s)) { m_text = s; notifyObserver(TEXT_BIT); } }
/** * Gets if the given cell values are equal to the given search values * * @param searchValues * The values to search in the given cells. Must not be <code>null</code>. * @param keyColumns * The columns describing the cells to be searched. Must not be <code>null</code>. * @param row * The row holding the cells to be searched. Must not be <code>null</code>. * @return <code>true</code> if the cells described by the given columns and row have the same content as the given * searchValues. <code>false</code> otherwise. If the number of columns is different than the number of search * values only the columns are searched for which a search value exists ( * <code>min(searchValues.size(), keyColumns.size()</code>). */ protected boolean areCellsEqual(List<?> searchValues, List<IColumn<?>> keyColumns, ITableRow row) { int keyIndex = 0; int numKeyColumns = keyColumns.size(); for (Object key : searchValues) { if (keyIndex >= numKeyColumns) { break; } Object cellValue = keyColumns.get(keyIndex).getValue(row); if (ObjectUtility.notEquals(key, cellValue)) { return false; } keyIndex++; } return true; }
@Override public void setDisplayModeOption(int displayMode, DisplayModeOptions displayModeOption) { DisplayModeOptions previousDisplayModeOption = getDisplayModeOptions().put(displayMode, displayModeOption); if (ObjectUtility.notEquals(displayModeOption, previousDisplayModeOption)) { propertySupport.firePropertyChange(new PropertyChangeEvent(this, PROP_DISPLAY_MODE_OPTIONS, null, getDisplayModeOptions())); } }
if (session != null && ObjectUtility.notEquals(theme, themeFromSession)) { session.setAttribute(THEME_SESSION_ATTRIBUTE, theme);
@Override public void setDisplayText(String s) { String oldDisplayText = getDisplayText(); super.setDisplayText(s); if (ObjectUtility.notEquals(oldDisplayText, s)) { interceptExecChangedDisplayText(); } }
@Override protected boolean execIsSaveNeeded() { boolean saveNeeded = super.execIsSaveNeeded(); if (saveNeeded) { return true; } return ObjectUtility.notEquals(getValue(), getInitValue()); }
public void setBackgroundColor(String c) { if (ObjectUtility.notEquals(m_cellSpecialization.getBackgroundColor(), c)) { ICellSpecialization newStyle = m_cellSpecialization.copy(); newStyle.setBackgroundColor(c); setValueInternal(BG_COLOR_BIT, newStyle); } }
public void setForegroundColor(String c) { if (ObjectUtility.notEquals(m_cellSpecialization.getForegroundColor(), c)) { ICellSpecialization newStyle = m_cellSpecialization.copy(); newStyle.setForegroundColor(c); setValueInternal(FG_COLOR_BIT, newStyle); } }
@Override public void setCssClass(String cssClass) { if (ObjectUtility.notEquals(m_cellSpecialization.getCssClass(), cssClass)) { ICellSpecialization newStyle = m_cellSpecialization.copy(); newStyle.setCssClass(cssClass); setValueInternal(CSS_CLASS_BIT, newStyle); } }
public void setIconId(String s) { if (ObjectUtility.notEquals(m_cellSpecialization.getIconId(), s)) { ICellSpecialization newStyle = m_cellSpecialization.copy(); newStyle.setIconId(s); setValueInternal(ICON_ID_BIT, newStyle); } }
protected void afterChildMenusAdd(Collection<? extends IMenu> newChildMenus) { if (CollectionUtility.hasElements(newChildMenus)) { final Object ownerValue = m_ownerValue; Consumer<IMenu> visitor = menu -> { if (ObjectUtility.notEquals(menu.getOwnerValue(), ownerValue)) { menu.handleOwnerValueChanged(ownerValue); } }; for (IMenu m : newChildMenus) { m.visit(visitor, IMenu.class); } } }
@Override public void setIconId(String id) { try { setRowChanging(true); // if (ObjectUtility.notEquals(getIconId(), id)) { super.setIconId(id); setRowPropertiesChanged(true); } } finally { setRowChanging(false); } }
public void setFont(FontSpec f) { if (m_cellSpecialization.getFont() == null && f != null || m_cellSpecialization.getFont() != null && f == null || ObjectUtility.notEquals(m_cellSpecialization.getFont(), f)) { ICellSpecialization newStyle = m_cellSpecialization.copy(); newStyle.setFont(f); setValueInternal(FONT_BIT, newStyle); } }
/** * Creates a {@link ServerRunContext} for the specified {@link Subject}. */ @Override public ServerRunContext produce(final Subject subject) { final ServerRunContext serverRunContext = ServerRunContexts.copyCurrent(true) .withSubject(subject) .withTransactionScope(TransactionScope.REQUIRES_NEW); // ensure that the session belongs to the specified subject // use the current set subject as subject of the session, because if the session is not null it must be the current session IServerSession session = serverRunContext.getSession(); if (session == null || ObjectUtility.notEquals(Subject.getSubject(AccessController.getContext()), subject)) { serverRunContext.withSession(BEANS.get(ServerSessionProviderWithCache.class).provide(serverRunContext.copy())); } return serverRunContext; } }
public void setMandatory(boolean mandatory) { if (m_cellSpecialization instanceof CellStyle) { if (mandatory) { ICellSpecialization newStyle = new CellExtension(m_cellSpecialization); newStyle.setMandatory(mandatory); setValueInternal(MANDATORY_BIT, newStyle); } } else if (ObjectUtility.notEquals(m_cellSpecialization.isMandatory(), mandatory)) { ICellSpecialization newStyle = m_cellSpecialization.copy(); newStyle.setMandatory(mandatory); setValueInternal(MANDATORY_BIT, newStyle); } }
public void setTooltipText(String s) { if (m_cellSpecialization instanceof CellStyle) { if (!StringUtility.isNullOrEmpty(s)) { ICellSpecialization newStyle = new CellExtension(m_cellSpecialization); newStyle.setTooltipText(s); setValueInternal(TOOLTIP_BIT, newStyle); } } else if (ObjectUtility.notEquals(m_cellSpecialization.getIconId(), s)) { ICellSpecialization newStyle = m_cellSpecialization.copy(); newStyle.setTooltipText(s); setValueInternal(TOOLTIP_BIT, newStyle); } }
@Override protected void handleUiPropertyChange(String propertyName, JSONObject data) { if (IBooleanField.PROP_VALUE.equals(propertyName)) { Object o = data.opt(propertyName); Boolean uiValue = null; if (ObjectUtility.isOneOf(o, Boolean.TRUE, Boolean.FALSE)) { uiValue = (Boolean) o; } addPropertyEventFilterCondition(propertyName, uiValue); getModel().getUIFacade().setValueFromUI(uiValue); // In some cases the widget in the UI is clicked, which causes the check-box to be de-/selected, but the model rejects the value-change. // in that case we must "revert" the click in the UI, so that UI and model are in-sync again. This may happen, when the model-field throws // a VetoExeception in its execValidateValue() method. Boolean modelValue = getModel().getValue(); if (ObjectUtility.notEquals(uiValue, modelValue)) { addPropertyChangeEvent(propertyName, modelValue); } } else { super.handleUiPropertyChange(propertyName, data); } } }
bm.setOrder(form.getBookmark().getOrder()); final BookmarkFolder newBmFolder = form.getFolder() != null ? form.getFolder() : form.getBookmarkRootFolder(); if (ObjectUtility.notEquals(oldBmFolder, newBmFolder)) {