use of com.vaadin.ui.Component in project Activiti by Activiti.
the class AdminRunningInstancesPanel method addTaskItem.
protected void addTaskItem(HistoricTaskInstance task, Table taskTable) {
Item item = taskTable.addItem(task.getId());
if (task.getEndTime() != null) {
item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_FINISHED_22));
} else {
item.getItemProperty("finished").setValue(new Embedded(null, Images.TASK_22));
}
item.getItemProperty("name").setValue(task.getName());
item.getItemProperty("priority").setValue(task.getPriority());
item.getItemProperty("startDate").setValue(new PrettyTimeLabel(task.getStartTime(), true));
item.getItemProperty("endDate").setValue(new PrettyTimeLabel(task.getEndTime(), true));
if (task.getDueDate() != null) {
Label dueDateLabel = new PrettyTimeLabel(task.getEndTime(), i18nManager.getMessage(Messages.TASK_NOT_FINISHED_YET), true);
item.getItemProperty("dueDate").setValue(dueDateLabel);
}
if (task.getAssignee() != null) {
Component taskAssigneeComponent = getTaskAssigneeComponent(task.getAssignee());
if (taskAssigneeComponent != null) {
item.getItemProperty("assignee").setValue(taskAssigneeComponent);
}
}
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class CubaTabSheet method silentCloseTabAndSelectPrevious.
public void silentCloseTabAndSelectPrevious(Component tab) {
while (openedComponents.removeElement(tab)) {
openedComponents.removeElement(tab);
}
if ((!openedComponents.empty()) && (selected.equals(tab))) {
Component c = openedComponents.pop();
while (!components.contains(c) && !openedComponents.isEmpty()) {
c = openedComponents.pop();
}
setSelectedTab(c);
}
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class CubaTreeTable method iterator.
@Override
public Iterator<Component> iterator() {
List<Component> additionalConnectors = null;
CubaTreeTableState tableState = getState(false);
if (tableState.presentations != null) {
additionalConnectors = new LinkedList<>();
additionalConnectors.add((Component) tableState.presentations);
}
if (tableState.contextMenu != null) {
if (additionalConnectors == null) {
additionalConnectors = new LinkedList<>();
}
additionalConnectors.add((Component) tableState.contextMenu);
}
if (tableState.customPopup != null) {
if (additionalConnectors == null) {
additionalConnectors = new LinkedList<>();
}
additionalConnectors.add((Component) tableState.customPopup);
}
if (additionalConnectors == null) {
return super.iterator();
} else if (visibleComponents != null) {
return Iterables.concat(visibleComponents, additionalConnectors).iterator();
} else {
return additionalConnectors.iterator();
}
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class CubaWidgetsTree method refreshRenderedComponents.
protected void refreshRenderedComponents() {
detachGeneratedComponents();
nodeWidgets.clear();
itemIds.clear();
if (widgetBuilder != null) {
// Iterates through hierarchical tree using a stack of iterators
final Stack<Iterator<?>> iteratorStack = new Stack<>();
Collection<?> ids = rootItemIds();
if (ids != null) {
iteratorStack.push(ids.iterator());
}
while (!iteratorStack.isEmpty()) {
// Gets the iterator for current tree level
final Iterator<?> i = iteratorStack.peek();
// If the level is finished, back to previous tree level
if (!i.hasNext()) {
// Removes used iterator from the stack
iteratorStack.pop();
} else {
final Object itemId = i.next();
itemIds.add(itemId);
Component c = widgetBuilder.buildWidget(this, itemId, areChildrenAllowed(itemId));
c.setParent(this);
c.markAsDirty();
nodeWidgets.add(c);
if (hasChildren(itemId) && areChildrenAllowed(itemId)) {
iteratorStack.push(getChildren(itemId).iterator());
}
}
}
}
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class ComponentRenderer method generateData.
@Override
public void generateData(Object itemId, Item item, JsonObject jsonRow) {
JsonObject jsonData = jsonRow.getObject("d");
for (String key : jsonData.keys()) {
if (getColumn(key).getRenderer() == this) {
if (jsonData.get(key) != Json.createNull()) {
Component current = lookupComponent(jsonData, key);
trackComponent(itemId, current);
}
}
}
}
Aggregations