Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -25,10 +25,10 @@
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.ISources;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.IHandlerActivation;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;

import java.util.LinkedList;
import java.util.List;
Expand All @@ -40,15 +40,14 @@
* @author mitin_aa
*/
public abstract class AbstractControlActionsManager {
@SuppressWarnings("deprecation")
protected final Object[] COMMAND_HANDLER_IDS = new Object[]{
IWorkbenchActionDefinitionIds.COPY,
IWorkbenchActionDefinitionIds.CUT,
IWorkbenchActionDefinitionIds.PASTE,
IWorkbenchActionDefinitionIds.DELETE,
IWorkbenchActionDefinitionIds.SELECT_ALL,
IWorkbenchActionDefinitionIds.UNDO,
IWorkbenchActionDefinitionIds.REDO};
private final String[] COMMAND_HANDLER_IDS = new String[] {
IWorkbenchCommandConstants.EDIT_COPY,
IWorkbenchCommandConstants.EDIT_CUT,
IWorkbenchCommandConstants.EDIT_PASTE,
IWorkbenchCommandConstants.EDIT_DELETE,
IWorkbenchCommandConstants.EDIT_SELECT_ALL,
IWorkbenchCommandConstants.EDIT_UNDO,
IWorkbenchCommandConstants.EDIT_REDO};
////////////////////////////////////////////////////////////////////////////
//
// Constructor
Expand Down Expand Up @@ -123,7 +122,7 @@ public static IHandlerService getHandlerService() {
protected void activateHandlers() {
IHandlerService service = getHandlerService();
for (int i = 0; i < COMMAND_HANDLER_IDS.length; ++i) {
String actionName = (String) COMMAND_HANDLER_IDS[i];
String actionName = COMMAND_HANDLER_IDS[i];
IHandler handler = getHandlerFor(actionName);
activateHandler(actionName, service, handler, new Expression() {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* Copyright (c) 2011, 2026 Google, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -17,7 +17,7 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
import org.eclipse.ui.IWorkbenchCommandConstants;

/**
* Default manager for installing/unistalling global handlers for {@link Control} actions commands.
Expand All @@ -41,7 +41,7 @@ public DefaultControlActionsManager(final Control control) {
////////////////////////////////////////////////////////////////////////////
@Override
protected IHandler getHandlerFor(String actionName) {
if (actionName.equalsIgnoreCase(IWorkbenchActionDefinitionIds.SELECT_ALL)) {
if (IWorkbenchCommandConstants.EDIT_SELECT_ALL.equals(actionName)) {
return SELECTALL_HANDLER;
}
return super.getHandlerFor(actionName);
Expand Down
Loading