blob: 9436250419d5eac50b6433c62060859152decca2 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2012, 2020 Original NatTable authors 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
# https://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Original NatTable authors and others - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.ecommons.waltable.selection;
import org.eclipse.swt.SWT;
public class SelectionFlags {
/** Extend current selection */
public static final int RANGE_SELECTION= SWT.SHIFT;
/** Retain or toggle */
public static final int RETAIN_SELECTION= SWT.CTRL;
public static final int swt2Flags(final int swtMask) {
int flags= 0;
if ((swtMask & SWT.MOD2) != 0) {
flags |= RANGE_SELECTION;
}
if ((swtMask & SWT.MOD1) != 0) {
flags |= RETAIN_SELECTION;
}
return flags;
}
}