blob: 2448ca1bedd8de8dd97971045efeabc292c705f7 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2008 Tasktop Technologies and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.monitor.core.collection;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
/**
* @author Mik Kersten
*/
public class InteractionEventUtil {
public static String getCleanOriginId(InteractionEvent event) {
String cleanOriginId = ""; //$NON-NLS-1$
String originId = event.getOriginId();
if (event.getKind().equals(InteractionEvent.Kind.COMMAND)) {
for (int i = 0; i < originId.length(); i++) {
char curChar = originId.charAt(i);
if (!(curChar == '&')) {
if (Character.getType(curChar) == Character.CONTROL) {
cleanOriginId = cleanOriginId.concat(" "); //$NON-NLS-1$
} else {
cleanOriginId = cleanOriginId.concat(String.valueOf(curChar));
}
}
}
return cleanOriginId;
} else {
return originId;
}
}
}