blob: 89eb08c29fc2eadd7ed8a1e4f1363abf190ea860 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2009, 2021 Stephan Wahlbrink 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, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.r.ui.rtool;
import static org.eclipse.statet.ltk.ui.sourceediting.assist.InfoHover.MODE_FOCUS;
import org.eclipse.jface.text.AbstractReusableInformationControlCreator;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.statet.internal.r.debug.ui.assist.RElementInfoControl;
public class RElementInfoHoverCreator extends AbstractReusableInformationControlCreator {
private final int mode;
public RElementInfoHoverCreator(final int mode) {
this.mode= mode;
}
@Override
protected IInformationControl doCreateInformationControl(final Shell parent) {
return ((this.mode & MODE_FOCUS) != 0) ?
new RElementInfoControl(parent, this.mode, true) :
new RElementInfoControl(parent, this.mode);
}
}