| /******************************************************************************* |
| * Copyright (c) 2017 Exyte |
| * 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: |
| * Yuri Strot - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ui.glance.controls.descriptors; |
| |
| import org.eclipse.swt.widgets.Control; |
| import org.eclipse.swt.widgets.Table; |
| |
| import org.eclipse.ui.glance.controls.table.TableSource; |
| import org.eclipse.ui.glance.sources.ITextSource; |
| import org.eclipse.ui.glance.sources.ITextSourceDescriptor; |
| |
| /** |
| * @author Yuri Strot |
| * |
| */ |
| public class TableDescriptor implements ITextSourceDescriptor { |
| |
| public ITextSource createSource(Control control) { |
| return new TableSource((Table) control); |
| } |
| |
| public boolean isValid(Control control) { |
| return control instanceof Table; |
| } |
| |
| } |