scout.RightClickTable = function() { scout.RightClickTable.parent.call(this); }; scout.inherits(scout.RightClickTable, scout.Table); scout.RightClickTable.prototype.onContextMenu = function(event) { // ignore event };
@Override protected void execRowClick(ITableRow row, MouseButton mouseButton) throws ProcessingException { super.execRowClick(row, mouseButton); if (MouseButton.Right == mouseButton) { removeOldKonfliktHandlingMenuItems(); if (!isGrundZugSelected()) { addKonflikHandlingMenuItems(row); } } }
What we like to do is, when the User clicks the right mouse button on a table row with conflict data, it should add some more specific MenuItems to choose from (addKonflikHandlingMenuItems()). If the row has no conflict Data, the specific MenuItems should be removed again.
So maybe there's a way to move this things in the context menu handler?
public class ResolveConflictMenu extends AbstractMenu { @Override protected String getConfiguredText() { return TEXTS.get("ResolveConflict"); } @Override protected Set<? extends IMenuType> getConfiguredMenuTypes() { return CollectionUtility.hashSet(TableMenuType.SingleSelection, TableMenuType.MultiSelection); } @Override protected void execOwnerValueChanged(Object newOwnerValue) { boolean visible = false; for (ITableRow row : getSelectedRows()) { if (getHasConflictColumn() .getValue(row)) { visible = true; break; } } setVisible(visible); } @Override protected void execAction() { for (ITableRow row : getSelectedRows()) { resolveConflict(getKeyColumn().getValue(row)); } } }