private void addWorkbenchAction(ActionFactory factory, int textOp) { IWorkbenchAction action = factory.create(window); TextAction textAction = new TextAction(textOp); textAction.setId(action.getId()); textAction.setActionDefinitionId(action.getActionDefinitionId()); textAction.setText(action.getText()); textAction.setToolTipText(action.getToolTipText()); textAction.setDescription(action.getDescription()); textAction.setImageDescriptor(action.getImageDescriptor()); textAction.setDisabledImageDescriptor(action.getDisabledImageDescriptor()); textAction.setHoverImageDescriptor(action.getHoverImageDescriptor()); action.dispose(); actionHandlers.put(action.getActionDefinitionId(), textAction); textActions.put(textAction.getId(), textAction); }
public void update(TextViewer textViewer) { for (TextAction action : textActions.values()) { action.update(textViewer); } }