blob: 00cd37bdd80ab432a34677dfbe89e41551c4b9be [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pierre Allard,
* Regent L'Archeveque,
* Olivier L. Larouche - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.core.invocator.ui.parts;
import org.eclipse.apogy.core.invocator.InvocatorSession;
import org.eclipse.apogy.core.invocator.ui.composites.ScriptBasedProgramsListComposite;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
public class ScriptBasedProgramsListPart extends AbstractSessionBasedPart {
@Override
protected void createContentComposite(Composite parent, int style) {
new ScriptBasedProgramsListComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL) {
@Override
protected void newSelection(ISelection selection) {
ScriptBasedProgramsListPart.this.selectionService
.setSelection(((ScriptBasedProgramsListComposite) getActualComposite()).getSelectedProgram());
}
};
}
@Override
protected void newInvocatorSession(InvocatorSession invocatorSession) {
((ScriptBasedProgramsListComposite) getActualComposite()).setProgramsList(invocatorSession.getProgramsList());
}
}