use of org.eclipse.scout.rt.platform.util.CompositeObject in project scout.rt by eclipse.
the class PlannerContextMenu method handleOwnerValueChanged.
protected void handleOwnerValueChanged() {
IPlanner<?, ?> container = getContainer();
if (container != null) {
final CompositeObject ownerValue = new CompositeObject(container.getSelectedResources(), container.getSelectedActivity(), container.getSelectionRange());
setCurrentMenuTypes(MenuUtility.getMenuTypesForPlannerSelection(container.getSelectedResources(), container.getSelectedActivity(), container.getSelectionRange()));
acceptVisitor(new MenuOwnerChangedVisitor(ownerValue, getCurrentMenuTypes()));
calculateLocalVisibility();
}
}
use of org.eclipse.scout.rt.platform.util.CompositeObject in project scout.rt by eclipse.
the class AbstractTable method discardDeletedRows.
@Override
public void discardDeletedRows(Collection<? extends ITableRow> deletedRows) {
if (deletedRows != null) {
for (ITableRow row : deletedRows) {
m_deletedRows.remove(new CompositeObject(getRowKeys(row)));
((InternalTableRow) row).setTableInternal(null);
}
}
}
use of org.eclipse.scout.rt.platform.util.CompositeObject in project scout.rt by eclipse.
the class AbstractTable method restoreSelection.
private void restoreSelection(List<CompositeObject> selectedKeys) {
ArrayList<ITableRow> selectedRows = new ArrayList<ITableRow>();
if (selectedKeys.size() > 0) {
for (ITableRow r : m_rows) {
if (selectedKeys.remove(new CompositeObject(getRowKeys(r)))) {
selectedRows.add(r);
if (selectedKeys.size() == 0) {
break;
}
}
}
}
selectRows(selectedRows, false);
}
use of org.eclipse.scout.rt.platform.util.CompositeObject in project scout.rt by eclipse.
the class ColumnSet method initialize.
public void initialize() {
ClientUIPreferences prefs = ClientUIPreferences.getInstance();
// clean up visible column index hints, make as permutation of model indices
int n = getColumnCount();
TreeMap<CompositeObject, IColumn> sortMap = new TreeMap<CompositeObject, IColumn>();
int viewIndex = 0;
for (int modelIndex = 0; modelIndex < n; modelIndex++) {
IColumn col = getColumn(modelIndex);
double viewHint = col.getVisibleColumnIndexHint();
if (viewHint < 0) {
viewHint = col.getOrder();
}
if (viewHint < 0) {
viewHint = viewIndex;
}
sortMap.put(new CompositeObject(viewHint, viewIndex), col);
// next
viewIndex++;
}
viewIndex = 0;
for (Map.Entry<CompositeObject, IColumn> e : sortMap.entrySet()) {
e.getValue().setVisibleColumnIndexHint(viewIndex);
viewIndex++;
}
reorganizeIndexes();
applySortingAndGrouping(null);
/*
* ticket 93309
* sanity check: when there is no visible column at all, reset visibilities to model init defaults
*/
if (getVisibleColumnCount() == 0) {
viewIndex = 0;
for (IColumn c : getColumns()) {
if (c.isDisplayable() && c.isInitialVisible()) {
c.setVisible(true);
} else {
c.setVisible(false);
}
c.setWidth(c.getInitialWidth());
c.setVisibleColumnIndexHint(viewIndex);
prefs.removeAllTableColumnPreferences(c, null, true);
// next
viewIndex++;
}
reorganizeIndexes();
}
checkMultiline();
}
use of org.eclipse.scout.rt.platform.util.CompositeObject in project scout.rt by eclipse.
the class ColumnSet method calculateVisibleIndexes.
private void calculateVisibleIndexes() {
int viewIndex = 0;
Map<CompositeObject, Integer> visibleMap = new TreeMap<CompositeObject, Integer>();
for (int modelIndex = 0; modelIndex < getColumnCount(); modelIndex++) {
IColumn col = getColumn(modelIndex);
if (col.isDisplayable() && col.isVisible()) {
double viewHint = col.getVisibleColumnIndexHint();
if (viewHint < 0) {
viewHint = col.getOrder();
}
if (viewHint < 0) {
viewHint = viewIndex;
}
visibleMap.put(new CompositeObject(viewHint, viewIndex), modelIndex);
viewIndex++;
}
}
m_visibleIndexes = new int[visibleMap.size()];
viewIndex = 0;
for (int modelIndex : visibleMap.values()) {
m_visibleIndexes[viewIndex++] = modelIndex;
}
}
Aggregations