blob: 52e98d7cde4283727313ead81b1d54c95d2c7418 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2016 CEA LIST.
*
*
* 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:
* David LOPEZ BETANCUR (CEA LIST)
* Sebastien REVOL (CEA LIST)
*
*****************************************************************************/
package org.eclipse.papyrus.moka.xygraph.properties.modelelement;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.papyrus.infra.widgets.providers.IGraphicalContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.papyrus.moka.xygraph.model.xygraph.XYGraphDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
public class VisibleTracesContentProvider implements IStaticContentProvider, IGraphicalContentProvider{
private XYGraphDescriptor xyDesc;
public VisibleTracesContentProvider(XYGraphDescriptor xyDesc) {
super();
this.xyDesc = xyDesc;
}
@Override
public Object[] getElements(Object inputElement) {
return getElements();
}
@Override
public Object[] getElements() {
return xyDesc.getTraceDescriptors().toArray();
}
@Override
public void createBefore(Composite parent) {
Label label = new Label(parent, SWT.NONE);
FontDescriptor boldDescriptor = FontDescriptor.createFrom(label.getFont()).setStyle(SWT.BOLD);
Font boldFont = boldDescriptor.createFont(label.getDisplay());
label.setFont( boldFont );
label.setText("Hidden");
}
@Override
public void createAfter(Composite parent) {
}
}