当前位置: 首页>>代码示例>>Java>>正文


Java AdapterFactoryLabelProvider类代码示例

本文整理汇总了Java中org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider的典型用法代码示例。如果您正苦于以下问题:Java AdapterFactoryLabelProvider类的具体用法?Java AdapterFactoryLabelProvider怎么用?Java AdapterFactoryLabelProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AdapterFactoryLabelProvider类属于org.eclipse.emf.edit.ui.provider包,在下文中一共展示了AdapterFactoryLabelProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPartControl

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
@Override
public void createPartControl ( final Composite parent )
{
    this.container = parent;
    createEditingDomain ();

    parent.setLayout ( new FillLayout () );
    this.viewer = new TreeViewer ( parent );
    this.viewer.setAutoExpandLevel ( 2 );

    this.viewer.setContentProvider ( new AdapterFactoryContentProvider ( this.factory ) );
    this.viewer.setLabelProvider ( new AdapterFactoryLabelProvider ( this.factory ) );

    createContextMenuFor ( this.viewer );

    new AdapterFactoryTreeEditor ( this.viewer.getTree (), this.factory );
    getViewSite ().setSelectionProvider ( this.viewer );

    attachSelectionService ();

    getViewSite ().getActionBars ().getMenuManager ().add ( new Separator ( "additions" ) );

    this.actionBarContributor.init ( getViewSite ().getActionBars () );
    this.actionBarContributor.setViewPart ( this );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:26,代码来源:ChartConfiguratorView.java

示例2: createFieldEditors

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
/**
 * Create contents of the preference page.
 */
@Override
protected void createFieldEditors() {
	// Create the field editors
	IPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.bbaw.bts.app");
	Composite container = (Composite) this.getControl();
	container.setLayout(new GridLayout(1, false));

	Label activeConfigLB = new Label(container, SWT.NONE);
	activeConfigLB.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false,
			false, 1, 1));
	activeConfigLB.setText("Currently active Configuration");

	activeConfigcomboViewer = new ComboViewer(container, SWT.READ_ONLY);
	activeConfigcomboViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
			false, 1, 1));
	ComposedAdapterFactory factory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
	AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(factory);
	activeConfigcomboViewer.setContentProvider(new AdapterFactoryContentProvider(factory));
	activeConfigcomboViewer.setLabelProvider(labelProvider);		
	
	
	init(null);
	loaded = true;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:28,代码来源:ConfigurationPage.java

示例3: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			StatemachineDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.StatemachineModelingAssistantProviderMessage);
	dialog.setTitle(Messages.StatemachineModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:21,代码来源:StatemachineModelingAssistantProvider.java

示例4: init

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
private void init() {
	this.setLayout(new GridLayout(2, false));
	viewer = new TableViewer(this, SWT.SINGLE | SWT.BORDER);
	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setLabelProvider(new AdapterFactoryLabelProvider(new SGraphItemProviderAdapterFactory()));
	Composite buttonComposite = getToolkit().createComposite(this);
	buttonComposite.setLayout(new FillLayout(SWT.VERTICAL));
	btnUp = getToolkit().createButton(buttonComposite, "up", SWT.PUSH);
	btnDown = getToolkit().createButton(buttonComposite, "down", SWT.PUSH);
	viewer.addSelectionChangedListener(enableButtonListener);
	viewer.addSelectionChangedListener(editPartSelectionListener);
	btnUp.addSelectionListener(upButtonListener);
	btnDown.addSelectionListener(downButtonListener);
	GridDataFactory.fillDefaults().applyTo(viewer.getControl());
	GridDataFactory.fillDefaults().applyTo(buttonComposite);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(viewer.getControl());
	GridDataFactory.fillDefaults().grab(true, false).applyTo(this);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:OrderElementControl.java

示例5: openFirstInstructionSelection

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
/**
 * Opens the {@link EObject first instruction} selection dialog.
 * 
 * @param shell
 *            the {@link Shell} to use for display
 * @param resourceSet
 *            the {@link ResourceSet} to get the first instruction from
 * @return the selected first instruction {@link URI} if any selected, <code>null</code> otherwise
 */
public static EObject openFirstInstructionSelection(final Shell shell, ResourceSet resourceSet) {
	final EObject res;
	final ComposedAdapterFactory fatory = new ComposedAdapterFactory(
			ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
	fatory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
	fatory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());

	ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
			new AdapterFactoryLabelProvider(fatory), new AdapterFactoryContentProvider(fatory));
	dialog.setTitle("Select first instruction");
	dialog.setMessage("Select the first instruction:");
	dialog.setInput(resourceSet);
	if (dialog.open() == Window.OK) {
		res = (EObject)dialog.getFirstResult();
	} else {
		res = null;
	}
	fatory.dispose();
	return res;
}
 
开发者ID:SiriusLab,项目名称:ModelDebugging,代码行数:30,代码来源:DSLLaunchConfigurationTab.java

示例6: build

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
@Override
public TimelineViewer build(PlanTimeline timeline, PlanReferencedObjectSection s) {
	EPlan plan = timeline.getPlan();
	PlanReferencedObjectSection section = s;
	PlanTimelineContentProvider contentProvider = new PlanReferencedObjectSectionContentProvider(plan, section);
	contentProvider.activate();
	
	PlanTimelineViewer viewer = new PlanTimelineViewer(timeline);
	viewer.setTreeTimelineContentProvider(contentProvider);
	viewer.setEditPartFactory(new PlanTimelineEditPartFactory());
	viewer.setTimelineSectionModel(section);
	viewer.setLabelProvider(new AdapterFactoryLabelProvider(EMFUtils.getAdapterFactory(section)));
	viewer.setProperty(TimelineConstants.TIMELINE_GROUP_ELEMENTS, false);
	viewer.setContents(plan);
	return viewer;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:PlanReferencedObjectSectionTimelineBuilder.java

示例7: build

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
@Override
public TimelineViewer build(PlanTimeline timeline, final Section section) {
	EPlan plan = timeline.getPlan();
	CustomContentProvider contentProvider = new CustomContentProvider(plan, (PlanSection) section);
	contentProvider.activate();
	
	final PlanTimelineViewer viewer = new PlanTimelineViewer(timeline);
	viewer.setTreeTimelineContentProvider(contentProvider);
	viewer.setLabelProvider(new AdapterFactoryLabelProvider(EMFUtils.getAdapterFactory(section)));
	viewer.setEditPartFactory(new PlanTimelineEditPartFactory());
	viewer.setTimelineSectionModel(section);
	viewer.setProperty(TimelineConstants.TIMELINE_GROUP_ELEMENTS, false);
	viewer.setContents(plan);
	viewer.setTimelineToolBarContributionItem(new CustomTimelineToolBarContributor(viewer, section));
	return viewer;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:CustomTimelineBuilder.java

示例8: build

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
@Override
public TimelineViewer build(Timeline timeline, Chart chart) {
	final EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(chart);
	AdapterFactory factory = new ChartItemProviderAdapterFactory();//.getAdapterFactory(chart);
	AdapterFactoryLabelProvider labeler = new AdapterFactoryLabelProvider(factory);
	TimelineViewer viewer = new TimelineViewer(timeline);
	ChartStyle chartStyle = chart.getStyle();
	viewer.setTimelineSectionModel(chart);
	viewer.setImageDescriptor(ImageDescriptor.createFromImage(labeler.getImage(chart)));
	viewer.setLabelProvider(labeler);
	switch (chartStyle) {
	case HEAT_MAP:
		viewer.setTreeTimelineContentProvider(new ChartTimelineContentProvider());
		viewer.setEditPartFactory(new HeatMapChartTimelineEditPartFactory());
		viewer.setProperty(TimelineConstants.TIMELINE_GROUP_ELEMENTS, true);
		break;
	case LINE:
		viewer.setEditPartFactory(new LineChartTimelineFactory());
		break;
	}
	viewer.setTimelineToolBarContributionItem(new ChartTimelineToolBarContributor(timeline, chart, domain));
	viewer.setContents(chart);
	return viewer;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:25,代码来源:ChartTimelineBuilder.java

示例9: createViewer

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
protected TreeViewer createViewer(Composite composite) {
	TreeViewer treeViewer = new TreeViewer(composite);
	treeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	
	ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory();
	adapterFactory.addAdapterFactory(new DecoratorEXTLibraryItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new EXTLibraryItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new TreeItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
	adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
	
	treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
	treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
	
	return treeViewer;
}
 
开发者ID:mbarbero,项目名称:econ-na-2014-emf-edit,代码行数:18,代码来源:NotYourFathersSWT.java

示例10: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			SmcDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.SmcModelingAssistantProviderMessage);
	dialog.setTitle(Messages.SmcModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:21,代码来源:SmcModelingAssistantProvider.java

示例11: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			Wc2014DiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.Wc2014ModelingAssistantProviderMessage);
	dialog.setTitle(Messages.Wc2014ModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:ggxx,项目名称:HelloBrazil,代码行数:21,代码来源:Wc2014ModelingAssistantProvider.java

示例12: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			SimpleBPMN.diagram.part.SimpleBPMNDiagramEditorPlugin
					.getInstance().getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(SimpleBPMN.diagram.part.Messages.SimpleBPMNModelingAssistantProviderMessage);
	dialog.setTitle(SimpleBPMN.diagram.part.Messages.SimpleBPMNModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:21,代码来源:SimpleBPMNModelingAssistantProvider.java

示例13: selectElement

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
/**
 * @generated
 */
protected EObject selectElement(EObject[] elements) {
	Shell shell = Display.getCurrent().getActiveShell();
	ILabelProvider labelProvider = new AdapterFactoryLabelProvider(
			ArmyDiagramEditorPlugin.getInstance()
					.getItemProvidersAdapterFactory());
	ElementListSelectionDialog dialog = new ElementListSelectionDialog(
			shell, labelProvider);
	dialog.setMessage(Messages.ArmyModelingAssistantProviderMessage);
	dialog.setTitle(Messages.ArmyModelingAssistantProviderTitle);
	dialog.setMultipleSelection(false);
	dialog.setElements(elements);
	EObject selected = null;
	if (dialog.open() == Window.OK) {
		selected = (EObject) dialog.getFirstResult();
	}
	return selected;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:21,代码来源:ArmyModelingAssistantProvider.java

示例14: createPartControl

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	layout = new StackLayout();
	parent.setLayout(layout);
	treeViewer = new TreeViewer(parent);
	
	treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
	treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
	
	new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
	
	textViewer = new TextViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
	
	layout.topControl = treeViewer.getControl();
	
	makeActions();
	contributeToActionBars();		
}
 
开发者ID:markus1978,项目名称:clickwatch,代码行数:19,代码来源:ResultView.java

示例15: createDialogArea

import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
  this.parent = parent;
  Composite area = (Composite) super.createDialogArea(parent);
  Composite container = new Composite(area, SWT.NONE);
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout = new GridLayout(1, false);
  container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
  container.setLayout(layout);

  treeViewer = new CheckboxTreeViewer(area, SWT.BORDER);

  Tree tree = treeViewer.getTree();
  tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

  treeViewer
      .setLabelProvider(new AdapterFactoryLabelProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer
      .setContentProvider(new AdapterFactoryContentProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer.setInput(modelRoot);
  return area;
}
 
开发者ID:atlanmod,项目名称:emfviews,代码行数:25,代码来源:ModelSelectionDialog.java


注:本文中的org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。