GT-3044 - Table Actions - updated table actions to use the modern action

system
This commit is contained in:
dragonmacher 2019-08-02 19:41:30 -04:00
parent 392c0846d1
commit 28f6500039
70 changed files with 642 additions and 493 deletions

View file

@ -24,7 +24,6 @@ import java.util.*;
import javax.swing.JPopupMenu;
import docking.action.*;
import docking.actions.PopupActionProvider;
import docking.menu.*;
public class PopupActionManager implements PropertyChangeListener {
@ -76,7 +75,7 @@ public class PopupActionManager implements PropertyChangeListener {
actionContext = new ActionContext();
}
actionContext.setSource(e.getSource());
actionContext.setSourceObject(e.getSource());
actionContext.setMouseEvent(e);
MenuHandler popupMenuHandler = new PopupMenuHandler(windowManager, actionContext);
@ -145,7 +144,7 @@ public class PopupActionManager implements PropertyChangeListener {
Object source = actionContext.getSourceObject();
// this interface is deprecated in favor of the next block
// this interface is deprecated in favor the code that calls this method; this will be deleted
if (source instanceof DockingActionProviderIf) {
DockingActionProviderIf actionProvider = (DockingActionProviderIf) source;
List<DockingActionIf> dockingActions = actionProvider.getDockingActions();
@ -158,23 +157,6 @@ public class PopupActionManager implements PropertyChangeListener {
}
}
}
// note: this is temporary; there is only one client that needs this. This will be
// removed in a future ticket when that client uses the standard tool action system
if (source instanceof PopupActionProvider) {
PopupActionProvider actionProvider = (PopupActionProvider) source;
DockingTool tool = windowManager.getTool();
List<DockingActionIf> dockingActions =
actionProvider.getPopupActions(tool, actionContext);
for (DockingActionIf action : dockingActions) {
MenuData popupMenuData = action.getPopupMenuData();
if (popupMenuData != null && action.isValidContext(actionContext) &&
action.isAddToPopup(actionContext)) {
action.setEnabled(action.isEnabledForContext(actionContext));
menuMgr.addAction(action);
}
}
}
}
private boolean isRemovingFromPopup(MenuData oldData, MenuData newData) {