/** * {@inheritDoc} */ @Override public boolean isPageComplete() { if (optional) { return true; } else if (!labelsToAdd.isEmpty()) { for (AbstractStorageLabel<?> label : labelsToAdd) { if (null != label.getValue()) { return true; } } } return false; }
/** * Gets {@link #labelsToAdd}. * * @return {@link #labelsToAdd} */ public List<AbstractStorageLabel<?>> getLabelsToAdd() { Iterator<AbstractStorageLabel<?>> it = labelsToAdd.iterator(); while (it.hasNext()) { if (null == it.next().getValue()) { it.remove(); } } return labelsToAdd; }
return "null"; } else if (CreationDateLabelType.class.equals(label.getStorageLabelType().getClass())) { Date date = (Date) ((AbstractStorageLabel<?>) label).getValue(); if (grouped) { return DateFormat.getDateInstance().format(date);
/** * {@inheritDoc} */ @Override protected Object getValue(Object element) { AbstractStorageLabel<?> label = (AbstractStorageLabel<?>) element; editingLabel = label; if (null != label.getValue()) { if (label instanceof BooleanStorageLabel) { if (((BooleanStorageLabel) label).getValue().booleanValue()) { return 0; } else { return 1; } } else { String value = TextFormatter.getLabelValue(label, false); int i = 1; for (AbstractStorageLabel<?> suggestionLabel : suggestionLabelList) { if (Objects.equals(value, TextFormatter.getLabelValue(suggestionLabel, false))) { return i; } i++; } } } return -1; }
/** * Reforms the value change and informs the listeners. * * @param label * Label to have value changed. * @param newValue * New value to set. */ private void changeValue(AbstractStorageLabel<Object> label, Object newValue) { if (!Objects.equals(label.getValue(), newValue)) { synchronized (labelEditListeners) { for (LabelEditListener listener : labelEditListeners) { listener.preLabelValueChange(label); } } label.setValue(newValue); synchronized (labelEditListeners) { for (LabelEditListener listener : labelEditListeners) { listener.postLabelValueChange(label); } } } }
/** * Returns initial data time frame if one is defined. * * @return Returns initial data time frame if one is defined. */ private TimeFrame getInitialDataTimeFrame() { RepositoryDefinition repositoryDefinition = getRootEditor().getInputDefinition().getRepositoryDefinition(); if (repositoryDefinition instanceof StorageRepositoryDefinition) { StorageRepositoryDefinition storageRepositoryDefinition = (StorageRepositoryDefinition) repositoryDefinition; List<AbstractStorageLabel<TimeFrame>> labels = storageRepositoryDefinition.getLocalStorageData().getLabels(new DataTimeFrameLabelType()); if (CollectionUtils.isNotEmpty(labels)) { return labels.get(0).getValue(); } } return null; }
for (AbstractStorageLabel<String> exploredByLabel : exploredBySet) { confirmText.append("\n * "); confirmText.append(exploredByLabel.getValue());
if (createValueDialog.getReturnCode() == Window.OK) { AbstractStorageLabel<?> createdLabel = createValueDialog.getCreatedLabel(); changeValue(label, createdLabel.getValue()); if (!suggestionLabelList.contains(createdLabel)) { suggestionLabelList.add(createdLabel); Object labelValue = suggestionLabel.getValue(); changeValue(label, labelValue);