@Override public void selectResources(List<? extends Resource<RI>> resources) { setPlannerChanging(true); try { List<Resource<RI>> newSelection = new ArrayList<>(resources); if (newSelection.size() > 1 && !isMultiSelectResources()) { Resource<RI> first = newSelection.get(0); newSelection.clear(); newSelection.add(first); } if (!CollectionUtility.equalsCollection(m_selectedResources, newSelection, false)) { m_selectedResources = new ArrayList<>(newSelection); List<Resource<RI>> notificationCopy = CollectionUtility.arrayList(m_selectedResources); fireResourcesSelected(notificationCopy); } } finally { setPlannerChanging(false); } }
@Override public void selectRows(List<? extends ITableRow> rows, boolean append) { rows = resolveRows(rows); TreeSet<ITableRow> newSelection = new TreeSet<>(new RowIndexComparator()); if (append) { newSelection.addAll(m_selectedRows); newSelection.addAll(rows); } else { newSelection.addAll(rows); } // check selection count with multiselect if (newSelection.size() > 1 && !isMultiSelect()) { ITableRow first = newSelection.first(); newSelection.clear(); newSelection.add(first); } if (!CollectionUtility.equalsCollection(m_selectedRows, newSelection, true)) { m_selectedRows = new ArrayList<>(newSelection); // notify menus List<ITableRow> notificationCopy = CollectionUtility.arrayList(m_selectedRows); fireRowsSelected(notificationCopy); } }
@Override protected boolean isIdenticalEvent(PlannerEvent event1, PlannerEvent event2) { if (event1 == null && event2 == null) { return true; } if (event1 == null || event2 == null) { return false; } boolean identical = (event1.getType() == event2.getType() && CollectionUtility.equalsCollection(event1.getResources(), event2.getResources(), true) && CollectionUtility.equalsCollection(event1.getPopupMenus(), event2.getPopupMenus())); return identical; }
@Override public void selectTiles(List<T> tiles) { if (!isSelectable()) { setSelectedTiles(new ArrayList<>()); return; } List<T> newSelection = filterTiles(tiles); if (newSelection.size() > 1 && !isMultiSelect()) { T first = newSelection.get(0); newSelection.clear(); newSelection.add(first); } if (!CollectionUtility.equalsCollection(getSelectedTilesInternal(), newSelection, false)) { setSelectedTiles(newSelection); } }
@Override public void setGroups(List<? extends IGroup> groups) { if (CollectionUtility.equalsCollection(getGroupsInternal(), groups, true)) { return; } List<? extends IGroup> existingGroups = ObjectUtility.nvl(getGroupsInternal(), new ArrayList<>()); groups = ObjectUtility.nvl(groups, new ArrayList<>()); // Dispose old groups (only if they are not in the new list) List<IGroup> groupsToDelete = new ArrayList<IGroup>(existingGroups); groupsToDelete.removeAll(groups); deleteGroupsInternal(groupsToDelete); // Initialize new groups // Only initialize when groups are added later, // if they are added while initConfig runs, initGroups() will take care of the initialization which will be called by the container (e.g. GroupsField) List<IGroup> groupsToInsert = new ArrayList<IGroup>(groups); groupsToInsert.removeAll(existingGroups); addGroupsInternal(groupsToInsert); sortInternal(groups); setGroupsInternal(groups); }
@Override public void setTiles(List<T> tiles) { if (CollectionUtility.equalsCollection(getTilesInternal(), tiles, true)) { return; } List<T> existingTiles = ObjectUtility.nvl(getTilesInternal(), new ArrayList<>()); tiles = ObjectUtility.nvl(tiles, new ArrayList<>()); // Dispose old tiles (only if they are not in the new list) List<T> tilesToDelete = new ArrayList<>(existingTiles); tilesToDelete.removeAll(tiles); deleteTilesInternal(tilesToDelete); deselectTiles(tilesToDelete); // Initialize new tiles // Only initialize when tiles are added later, // if they are added while initConfig runs, initTiles() will take care of the initialization which will be called by the container (e.g. TileField) List<T> tilesToInsert = new ArrayList<>(tiles); tilesToInsert.removeAll(existingTiles); addTilesInternal(tilesToInsert); sortInternal(tiles); setTilesInternal(tiles); m_filteredTilesDirty = true; applyFilters(tilesToInsert); }
if (previous.getType() == TableEvent.TYPE_ROWS_INSERTED && event.getRowCount() == previous.getRowCount() && CollectionUtility.equalsCollection(event.getRows(), previous.getRows(), false)) {
return CollectionUtility.equalsCollection((List<?>) value, (List<?>) defaultValue); // same order return CollectionUtility.equalsCollection((Collection<?>) value, (Collection<?>) defaultValue); // any order
boolean sameKeys = CollectionUtility.equalsCollection(valueObject.keySet(), defaultValueObject.keySet()); for (Iterator it = valueObject.keys(); it.hasNext();) { String prop = (String) it.next();
if (CollectionUtility.equalsCollection(checkedRows, condition.getCheckedRows()) && CollectionUtility.equalsCollection(uncheckedRows, condition.getUncheckedRows())) { if (CollectionUtility.equalsCollection(m_jsonTable.getColumnsInViewOrder(), condition.getColumns())) { return null;
if (CollectionUtility.equalsCollection(checkedNodes, condition.getCheckedNodes()) && CollectionUtility.equalsCollection(uncheckedNodes, condition.getUncheckedNodes())) {
if (!CollectionUtility.equalsCollection(newMenus, table.getContextMenu().getChildActions())) { table.getContextMenu().setChildActions(newMenus);
protected void enhanceDetailFormWithPageMenus() { if (getOutline() == null) { return; } IForm form = getDetailForm(); IFormFieldContextMenu mainBoxContextMenu = form.getRootGroupBox().getContextMenu(); List<IMenu> menus = mainBoxContextMenu.getChildActions(); for (IMenu menu : getOutline().getMenusForPage(this)) { // TODO [6.2] hmu, bsh: menues im ui sammeln anstelle in forms injecten if (menu.getMenuTypes().contains(TreeMenuType.Header) && menu.getMenuTypes().size() == 1) { // Don't show TreeMenuType.Header. These menus should only be shown on outline title continue; } menus.add(OutlineMenuWrapper.wrapMenu(menu)); } if (!CollectionUtility.equalsCollection(menus, mainBoxContextMenu.getChildActions())) { mainBoxContextMenu.setChildActions(menus); } }
@Override protected boolean isIdenticalEvent(TreeEvent event1, TreeEvent event2) { if (event1 == null && event2 == null) { return true; } if (event1 == null || event2 == null) { return false; } boolean identical = event1.getType() == event2.getType() && event1.isConsumed() == event2.isConsumed() && event1.getNodeCount() == event2.getNodeCount() && ObjectUtility.equals(event1.getCommonParentNode(), event2.getCommonParentNode()) && CollectionUtility.equalsCollection(event1.getNodes(), event2.getNodes(), true) && CollectionUtility.equalsCollection(event1.getDeselectedNodes(), event2.getDeselectedNodes(), true) && CollectionUtility.equalsCollection(event1.getNewSelectedNodes(), event2.getNewSelectedNodes(), true) && CollectionUtility.equalsCollection(event1.getPopupMenus(), event2.getPopupMenus()) && ObjectUtility.equals(event1.getDragObject(), event2.getDragObject()) && ObjectUtility.equals(event1.getDropObject(), event2.getDropObject()); return identical; }
protected void enhanceTableWithPageMenus() { if (isPageMenusAdded()) { return; } setPageMenusAdded(); ITable table = getTable(); if (table != null) { ITableContextMenu contextMenu = table.getContextMenu(); List<IMenu> menus = contextMenu.getChildActions(); for (IMenu menu : getOutline().getContextMenu().getChildActions()) { if (!OutlineMenuWrapper.containsWrappedMenu(table.getMenus(), menu)) { // mapping from TreeMenuType to TableMenuType menus.add(new OutlineMenuWrapper(menu, TREE_MENU_TYPE_MAPPER)); } } if (!CollectionUtility.equalsCollection(menus, contextMenu.getChildActions())) { contextMenu.setChildActions(menus); } } }
@Override protected boolean isIdenticalEvent(TableEvent event1, TableEvent event2) { if (event1 == null && event2 == null) { return true; } if (event1 == null || event2 == null) { return false; } boolean identical = event1.getType() == event2.getType() && event1.isConsumed() == event2.isConsumed() && event1.isSortInMemoryAllowed() == event2.isSortInMemoryAllowed() && event1.getRowCount() == event2.getRowCount() && CollectionUtility.equalsCollection(event1.getRows(), event2.getRows()) && CollectionUtility.equalsCollection(event1.getPopupMenus(), event2.getPopupMenus()) && ObjectUtility.equals(event1.getDragObject(), event2.getDragObject()) && ObjectUtility.equals(event1.getDropObject(), event2.getDropObject()) && ObjectUtility.equals(event1.getCopyObject(), event2.getCopyObject()) && ObjectUtility.equals(event1.getColumns(), event2.getColumns()); return identical; }
if (!CollectionUtility.equalsCollection(checkedKeys, validatedCheckedKeys)) { resync = true;
if (!CollectionUtility.equalsCollection(checkedKeys, validatedCheckedKeys)) { resync = true;