| /******************************************************************************* |
| * 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, |
| * Sebastien Gemme - initial API and implementation |
| * |
| * SPDX-License-Identifier: EPL-1.0 |
| * |
| *******************************************************************************/ |
| package org.eclipse.apogy.common.converters.ui.part; |
| |
| import javax.annotation.PostConstruct; |
| |
| import org.eclipse.apogy.common.converters.ApogyCommonConvertersFacade; |
| import org.eclipse.apogy.common.converters.ApogyCommonConvertersGraphsFacade; |
| import org.eclipse.apogy.common.converters.ConverterEdge; |
| import org.eclipse.apogy.common.converters.ui.composites.AvailableConversionComposite; |
| import org.eclipse.apogy.common.converters.ui.composites.ConverterGraphComposite; |
| import org.eclipse.apogy.common.converters.ui.composites.ConvertersUIConstants.ClassNameDisplayMode; |
| import org.eclipse.swt.SWT; |
| import org.eclipse.swt.layout.FillLayout; |
| import org.eclipse.swt.widgets.Composite; |
| import org.jgrapht.graph.SimpleDirectedWeightedGraph; |
| |
| public class ConvertersPart { |
| private Composite parent = null; |
| private ConverterGraphComposite converterGraphComposite = null; |
| private AvailableConversionComposite availableConversionComposite = null; |
| |
| @PostConstruct |
| public void createPartControl(Composite parent) { |
| this.parent = parent; |
| this.parent.setLayout(new FillLayout()); |
| SimpleDirectedWeightedGraph<Class<?>, ConverterEdge> graph = ApogyCommonConvertersFacade.INSTANCE.getGraph(); |
| this.converterGraphComposite = new ConverterGraphComposite(parent, SWT.NONE, graph); |
| this.availableConversionComposite = new AvailableConversionComposite(parent, SWT.NONE, graph); |
| ApogyCommonConvertersGraphsFacade.INSTANCE.getAvailableDestinationTypeMap(graph); |
| } |
| |
| public void setClassNameDisplayMode(ClassNameDisplayMode classNameDisplayMode) { |
| if (this.converterGraphComposite != null) { |
| this.converterGraphComposite.setClassNameDisplayMode(classNameDisplayMode); |
| } |
| |
| if (this.availableConversionComposite != null) { |
| this.availableConversionComposite.setClassNameDisplayMode(classNameDisplayMode); |
| } |
| } |
| } |